# WELL pseudo-random number generations

I've used MT19937 in a test harness to generate uniformly (unsigned) 32-bit [0, $2^{32}$- 1] values, based on the original Authors' mt19937.c implementation, to generate an (essentially inexhaustible) supply of statistically random stream of bit-octets. This is in lieu of a CSPRNG, which isn't necessary for these particular tests. However, I've recently been considering the WELL PRNGs - not because of the statistical properties as such (both seem more than adequate for my needs) - but they seem to suggest more a efficient implementation.

I lack the mathematical background for the academic papers, though I could at least follow the 'twist' matrix and tempering transform for the former. However, much of the code provided by the Authors of the WELL-n functions seem to focus of floating-point generation, with some magic floating point constants (e.g., 2.32830643653869628906e-10). Can steps be omitted from the WELL code to provide a uniform 32-bit distribution? Or is the algorithm designed / biased specifically for floating-point distributions?

Or I'm an incorrect in thinking that WELL will yield a performance gain for 'bulk' uint32 vector generation, while satisfying my requirements?

• If this is just curiosity, that's fine, but real performance always depends on what else is going on. If generating random numbers is consuming 10% of total time, and you can reduce it by half, that gives you a speedup of 5%, which might not be worth the trouble. – Mike Dunlavey Feb 9 '14 at 17:19
• Perhaps off topic, but it's also worth considering counter mode generators such as deshawresearch.com/resources_random123.html, which require far, far less memory and parallelize trivially. – Geoffrey Irving Feb 9 '14 at 18:18
• As an update, I'm now leaning toward the PCG RNGs. They are much faster, can supply very long periods (as well as multiple streams) with statistically excellent properties, and appear to recover very quickly from poor IVs. – Brett Hale Jul 14 '17 at 7:56