The mersenne-random package

[Tags:bsd3, library]

The Mersenne twister is a pseudorandom number generator developed by Makoto Matsumoto and Takuji Nishimura that is based on a matrix linear recurrence over a finite binary field. It provides for fast generation of very high quality pseudorandom numbers

This library uses SFMT, the SIMD-oriented Fast Mersenne Twister, a variant of Mersenne Twister that is much faster than the original. It is designed to be fast when it runs on 128-bit SIMD. It can be compiled with either SSE2 and PowerPC AltiVec support, to take advantage of these instructions.

By default the period of the function is 2^19937-1, however, you can compile in other defaults. Note that this algorithm on its own is not cryptographically secure.

For more information about the algorithm and implementation, see the SFMT homepage,

and, Mutsuo Saito and Makoto Matsumoto, /SIMD-oriented Fast Mersenne Twister: a 128-bit Pseudorandom Number Generator/, in the Proceedings of MCQMC2006, here:

[Skip to Readme]


Versions 0.1, 0.1.1, 0.1.2, 0.1.3, 1.0,
Dependencies base, old-time [details]
License BSD3
Copyright (c) 2008. Don Stewart <>
Author Don Stewart
Maintainer Don Stewart <>
Category Math, System
Home page
Uploaded Tue Aug 19 00:01:51 UTC 2008 by DonaldStewart
Distributions Debian:, LTSHaskell:, NixOS:, Stackage:, Tumbleweed:
Downloads 2318 total (18 in the last 30 days)
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]




small_baseBuild with new smaller base libraryDisabledAutomatic
use_sse2Build with SSE2 support.DisabledAutomatic
use_altivecBuild with Altivec support.DisabledAutomatic
big_endian64Build for a big endian 64 bit machine.DisabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

For package maintainers and hackage trustees

Readme for mersenne-random

Readme for mersenne-random-0.1.3

To build with sse2 support (core2 and other intels)

    $ runhaskell Setup.lhs -f use_sse2

Similar flags for altivec on the mac