zipf-random* ( a rnd -- n )


Vocabulary
random

Inputs
aan object
rndan object


Outputs
nan object


Definition


:: zipf-random* ( a rnd -- n )
a 1.0 - :> am1 2.0 am1 ^ :> b 1.0 rnd random-unit* -
:> U rnd random-unit* :> V U am1 recip neg ^
floor :> X 1.0 X recip + am1 ^ :> T V X * T 1.0 - * b 1.0 -
/ T b / <= [ X ] [ a rnd zipf-random* ] if ;