Mersenne Twister (Bug?)

Brian Gough bjg@network-theory.co.uk
Fri Jul 28 12:02:00 GMT 2000


Thanks. I've just checked the original developers website and they
have released an updated version of MT19937 to fix the weakness in the
seeding procedure.  I shall update the GSL version accordingly.  I've
attached their new procedure below.  

It would be worthwhile to run tests for bad seeds across all the
generators, to supplement the serial tests from DIEHARD.  I shall add
that to the TODO list.

best regards

Brian Gough


/* Initializing the array with a seed */
void
sgenrand(seed)
    unsigned long seed; 
{
    int i;

    for (i=0;i<N;i++) {
         mt[i] = seed & 0xffff0000;
         seed = 69069 * seed + 1;
         mt[i] |= (seed & 0xffff0000) >> 16;
         seed = 69069 * seed + 1;
    }
    mti = N;
}



More information about the Gsl-discuss mailing list