(gamma-random<1) ( alpha beta rnd -- n )


Vocabulary
random.private

Inputs
alphaan object
betaan object
rndan object


Outputs
nan object


Definition


:: (gamma-random<1) ( alpha beta rnd -- n )
alpha e + e / :> b 0 :> x! 0 :> p! [
p 1.0 >
[ rnd random-unit* x alpha 1 - ^ > ]
[ rnd random-unit* x neg e^ > ] if
] [
rnd random-unit* b * p! p 1.0 <=
[ p 1.0 alpha / ^ ] [ b p - alpha / log neg ] if x!
] do while x beta * ;