Uncommons Maths is a Java library consisting of a comprehensive random numbers package and other useful mathematical utility classes. The most compelling feature of the Uncommons Maths library is its comprehensive random numbers package.
The standard Java Random Number Generator (RNG) is statistically flawed. The java.security.SecureRandom class is much better in this respect but can be very slow. Uncommons Maths provides 3 alternative RNGs. Each of these is significantly faster than SecureRandom and the first 2 are also faster than java.util.Random. In addition, unlike java.util.Random, all 3 RNGs complete the full Diehard Battery of Tests of Randomness without any problems.
Mersenne Twister RNG
A Java port of the fast and reliable Mersenne Twister pseudorandom number generator developed by Makoto Matsumoto and Takuji Nishimura.
Cellular Automaton RNG
A Java port of the ultra-fast cellular automaton pseudorandom number generator developed by Tony Pasqualoni.
AES Non-linear RNG
An RNG based on the AES block cipher.
The standard Java RNGs make it easy to work with a uniform probability distribution. They also provide basic support for the normal (Gaussian) distribution via the nextGaussian method. Uncommons Maths improves the support for normally-distributed random numbers and also provides classes for working with the Binomial, Poisson and Exponential distributions.
Good RNGs need good seed data. Uncommons Maths provides pluggable seeding strategies, including ones to read random data from /dev/random (where available) and from random.org.
· Java 5 or later
What's New in This Release:
· Support for exponential distribution was added.
· Support for large keys (up to 256 bits) in AESCounterRNG was added.