The source code of version 3.06 is available here (xorgens306.tar.gz) and here (xorgens306.zip). The theory is described in my paper . The only difference between versions 3.04, 3.05 and 3.06 are a small correction to the comments regarding the constant weyl (thanks to G. Weijers for this) and a change in some declarations from int to unsigned int to avoid a compiler warning about comparison of signed and unsigned integers.
xorgens has been tested using various statistical tests and appears to be satisfactory. However, we recommend that you do your own tests.
If you want to experiment with different sets of parameters, a short table of possibilities is available here (xortable.txt, 2K). Note that the code assumes that r is a power of two, so some small changes are required if this is not the case. We do not recommend the generators with n < 256 because their state space is too small.
xorgens is available (free, but with absolutely no warranty) as open-source software under the GNU General Public License.
ranut has been tested using George Marsaglia's Diehard package and appears to be satisfactory. However, we recommend that you do your own tests and, if necessary, combine the output of ranut with that of an independent random number generator.
ranut is based on an earlier generator RANU4 (1991) which is described in .
Note that ranut and RANU4 implemented the "fast jump ahead" idea (using arithmetic modulo the generating polynomial) which was recently rediscovered by Haramoto, Matsumoto, Nishimura, Panneton and L'Ecuyer [INFORMS Journal on Computing 20, 3, Summer 2008, 385-390, DOI: 10.1287/ijoc.1070.0251]. The implementation in RANU4 was described in [Sec. 8, 132].
Nowadays I prefer xorgens to ranut since generators based on primitive trinomials have some theoretical weaknesses. However, the trinomials used in ranut have such high degree that these weaknesses are probably insignificant in practice.
Most algorithms for generating normally distributed random numbers are slow because they first generate uniformly distributed numbers and then transform them to normally distributed numbers. rannw is potentially faster because it generates normally distributed numbers directly, without using uniformly distributed numbers (except occasionally, for initialisation etc).
rannw has been tested using Marsaglia's Diehard package and appears to be satisfactory. (Because Diehard is designed to test uniformly distributed numbers, the output of rannw was transformed appropriately before input to Diehard.)
rannw is based on an earlier generator RANN4 which is described in [170, 185].
Wallace's own implementation of his method (written in C) used to be available here (but the last time that I looked this link was broken).
A gzipped tar file of random version 1.03 is available here (48 KB). There is also a zip file (55 KB). The distribution contains the Fortran source code, test programs, output obtained from testing with Diehard, etc.
Return to Richard Brent's index page