Implementation of a 2006 version of Wichmann-Hull random number generator for Erlang/OTP

Kenji Rikitake kenji.rikitake@REDACTED
Tue Nov 23 12:15:42 CET 2010


The random module of Erlang/OTP library uses the 1982(!)[1] version of
Wichmann-Hull random number generator (RNG), which has been known to
have a limitation of short cycle length (~ 7 x (10^12)).  The authors
have published a new version of 2006[2], which has a much longer cycle
length (~ 2^120 (~ 10^36)) at the expense of adding one more variable to
the seed/state (from three 16-bit integers to four 32-bit integers).

I've briefly tested the implementation, available at:
https://gist.github.com/709614
under the name of
random_wh06.erl

[1]
B. A. Wichmann, I. D. Hill, 
Algorithm AS 183: An efficient and portable pseudo-random number generator,
Journal of Applied Statistics, 31, 188-190 (1982).

[2]
B. A. Wichmann, I. D. Hill, 
Generating good pseudo-random numbers,
Computational Statistics & Data Analysis, 51, 1614-1622 (2006).
Reference implementation in C and Ada with the drafts of the paper
PDFs available at:
http://resource.npl.co.uk/docs/science_technology/scientific_computing/ssfm/documents/wh_rng_version096.zip

Suggestions and comments appreciated.

Regards,
Kenji Rikitake


More information about the erlang-questions mailing list