This page is OLD: OUTDATED (1998)

Standard Mersenne Twister and outputs

A lot of users of MT indicated us improvements of the code. Some recommended us to include "standard" C-code and its output sequences for the certification that their improvements do not change the output sequence.

Twice faster!! C-code

Shawn J. Cokus, a graduate student at the University of Washington, kindly gave us an optimized version of MT19937.

He said: "The code is for the uniform integer in 0..(2^32 - 1) case, and runs about 2.15 times faster than the code on the web page. (I'm on a DEC Alpha running OSF/1 and I am using the GNU C compiler at optimization level -O3.) With the faster code, I can generate about 12.5 million random numbers per second on the machine here. The code is not completely ANSI: I have a tendency to use `//'-style comments, and I do use the `inline' keyword of GNU C once. If you change the comments to `/* ... */'-style and remove the `inline' keyword (or, better yet, change the small function tagged with it to a macro), then I'm pretty sure the code would be ANSI (except for some assumptions about the representation of unsigned numbers due to the &'s, |'s, and ^'s). Feel free to do whatever you'd like with this implementation-- and thanks for putting your information on the web."