Handbook
Glossary
(gamma-random<1) ( alpha beta rnd -- n )
Vocabulary
random
.
private
Inputs
alpha
an
object
beta
an
object
rnd
an
object
Outputs
n
an
object
Definition
USING:
kernel
math
math.constants
math.functions
random
;
IN:
random.private
::
(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
*
;