The ACORN family (published 1989) is another k-distributed PRNG, which shows similar computational speed to MT, and better statistical properties as it satisfies all the current (2019) TestU01 criteria when used with appropriate choices of parameters, ACORN can have arbitrarily long period and precision.
Ħ4-bit MELGs ("64-bit Maximally Equidistributed F 2-Linear Generators with Mersenne Prime Period") are completely optimized in terms of the k-distribution properties. Marsaglia's xorshift generators and variants are the fastest in the class of LFSRs. The reason is that observing a sufficient number of iterations (624 in the case of MT19937, since this is the size of the state vector from which future iterations are produced) allows one to predict all future iterations.Īn alternative generator, WELL ("Well Equidistributed Long-period Linear"), offers quicker recovery, and equal randomness, and nearly equal speed.
The 2002 update to the MT algorithm has improved initialization, so that beginning with such a state is very unlikely. A consequence of this is that two instances of the generator, started with initial states that are almost the same, will usually output nearly the same sequence for many iterations, before eventually diverging. Poor diffusion: can take a long time to start generating output that passes randomness tests, if the initial state is highly non-random-particularly if the initial state has many zeros.Multiple instances that differ only in seed value (but not other parameters) are not generally appropriate for Monte-Carlo simulations that require independent random number generators, though there exists a method for choosing multiple sets of parameter values.There are a number of other generators that pass all the tests (and numerous generators that fail badly). The test, like Mersenne Twister, is based on an F 2-algebra. Exhibits two clear failures (linear complexity) in both Crush and BigCrush in the TestU01 suite.Mediocre throughput by modern standards, unless the SFMT variant (discussed below) is used.Relatively large state buffer, of 2.5 KiB, unless the TinyMT variant (discussed below) is used.A study found that the Mersenne Twister creates 64-bit floating point random numbers approximately twenty times faster than the hardware-implemented, processor-based RDRAND instruction set. Implementations generally create random numbers faster than true random methods.k-distributed to 32-bit accuracy for every 1 ≤ k ≤ 623 (for a definition of k-distributed, see below).
Note that while a long period is not a guarantee of quality in a random number generator, short periods, such as the 2 32 common in many older software packages, can be problematic.
The Mersenne Twister is one of two PRNGs in SPSS: the other generator is kept only for compatibility with older programs, and the Mersenne Twister is stated to be "more reliable". Add-on implementations are provided in many program libraries, including the Boost C++ Libraries, the CUDA Library, and the NAG Numerical Library.
It is also available in Apache Commons, in standard C++ (since C++11), and in Mathematica.
Programming languages: Dyalog APL, IDL, R, Ruby, Free Pascal, PHP, Python (also used in NumPy, while there changed to PCG64 by default as of 1.17 ), Julia CMU Common Lisp, Embeddable Common Lisp, Steel Bank Common Lisp,.The Mersenne Twister is used as default PRNG by the following software: Main article: Pseudorandom number generator Software