[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: random
- From: email@example.com (Bill St. Clair)
- Date: Fri, 28 May 1993 17:01:27 -0600
>I'm looking for information on the algorithm used by the MCL
>random number generator. CLtL says the generator is implementation
>dependent, but no information or reference to the algorithm used
>is given in the MCL reference manual.
>Is the generator reliable? What are its properties?
MCL's random-state is two 15-bit integers. The next random-state
value is generated basically by multiplying each of the two integers
by 7**5, swapping the words of one of the products, adding the two
products together, and using the low 30 bits of the result as the
next two 15 bit seeds. The actual code doesn't do exactly that, but
it's pretty close. The algorithm used had a fixed point at <0,0>.
A patch will be part of patch 3 for MCL 2.0, or ask for "random-patch"
if you want it earlier.