Request: The best random generator available today for JUCE


JUCE deserves the best…


Random number generation is a deceptively complex topic, and there is no single good “best solution” because there are tradeoffs in speed, storage, preprocessing, and quality.

But in the past five years or so, the dominant algorithm in practice has emerged to be the Mersenne Twister by Makoto Matsumoto. It has an excellent balance of speed and quality. The downside is the entropy pool requires about 2K of storage. MT has a slightly similar structure to Marsaglia’s 1992 algorithm you linked to, but MT goes beyond that with a better tempering of high/low bits, and more theoretical analysis to support it. MT’s default period is much longer as well, though that probably doesn’t make much difference.

JUCE currently has a very simple random number system that would be good enough for 95% of all applications. Anyone needing “better” random numbers could easily use a library like the Mersenne Twister.[/code]