talira

mwc-random

Fast, high-quality pseudo-random number generation for Haskell

open sourceBSD-2-Clausefree

mwc-random is a Haskell library (the System.Random.MWC module) for generating high-quality pseudo-random numbers, fast and with little memory, suitable for statistical work. Its uniform generator is Marsaglia's MWC256 (MWC8222) multiply-with-carry, with a period of 2^8222, which does well in randomness tests and runs two to three times faster than the Mersenne Twister. It samples uniform, normal and other distributions, including binomial and Poisson, and works with version 1.3 of the random package.

Problems it solves

  • generate lots of random numbers fast in Haskell for a simulation
  • sample from a normal distribution in Haskell
  • a statistically sound random number generator for Haskell

Features

  • MWC256 multiply-with-carry generator with a 2^8222 period
  • two to three times faster than the Mersenne Twister
  • uniform, normal, binomial and Poisson sampling
  • works with the random 1.3 interface

Alternatives

The same job

These do what mwc-random does.

  1. random Pseudo-random number generation for Haskell
  2. MonadRandom Random-number generation monad for Haskell

Compare mwc-random with the top 3