This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Mersenne Twister (Bug?)
- To: "Franz Eder" <franz at eder-home dot de>
- Subject: Re: Mersenne Twister (Bug?)
- From: Brian Gough <bjg at network-theory dot co dot uk>
- Date: Fri, 28 Jul 2000 19:58:48 +0100 (BST)
- Cc: <gsl-discuss at sourceware dot cygnus dot com>
- References: <000501bff8b1$e70186c0$56ddfea9@southerncross>
- Reply-To: gsl-discuss at sources dot redhat dot com
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;
}