Improved basic generator (Ranq1)


vigna
04-11-2014, 07:23 AM
I've recently spent some time doing large-scale experiments with xorshift generators combined with a multiplication (as suggested by Marsaglia and in NR) and also with an addition (as in the 32-bit XSadd generator). I ran the BigCrush test suite from TestU01 from 100 equispaced points of the state space of a large number of candidates. I tested also reverse generators, as suggested in NR (a great suggestion, BTW).

TestU01 appeared in 2007; BigCrush is a statistical test suite much more powerful than Diehard or Dieharder (and takes much more time).

The Ran generator does not fail systematically any test.

However, the basic, easy generator Ranq1 suggested in NR (xorshift followed by a multiplication, triple (21,35,4)) fails the MatrixRank and the BirthdaySpacings tests systematically (i.e., starting from all 100 seeds). I was able to find, however, groups of triples failing *just* the MatrixRank test, which are of better quality.

Moreover, when considering 64-bit xorshift generators *not* followed by a multiplication, the good triples are quite different, and even the best triple fails systematically the BirthdaySpacings, MatrixRank and LinearComp tests.

Note the Dieharder is not able to distinguish among these generators. The scores are more or less the same, and no test is failed systematically. It is BigCrush that is able to tell good from bad among the best generators in this class.

The results of the tests and the suggested generators can be found at http://prng.di.unimi.it/, which contains also link to the relevant papers, containing lists of triples of high quality.