splitmix: Fast Splittable PRNG

[ bsd3, library, random, system ] [ Propose Tags ] [ Report a vulnerability ]

Pure Haskell implementation of SplitMix described in

Guy L. Steele, Jr., Doug Lea, and Christine H. Flood. 2014. Fast splittable pseudorandom number generators. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA '14). ACM, New York, NY, USA, 453-472. DOI: https://doi.org/10.1145/2660193.2660195


[Skip to Readme]

Modules

[Index]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.1, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.0.4, 0.1.0.5
Dependencies base (>=4.5 && <4.12), random (>=1.1 && <1.2), time (>=1.4.0.1 && <1.9) [details]
Tested with ghc ==7.6.3, ghc ==7.8.4, ghc ==7.10.3, ghc ==8.0.2, ghc ==8.2.2, ghc ==8.4.1
License BSD-3-Clause
Author
Maintainer Oleg Grenrus <oleg.grenrus@iki.fi>
Revised Revision 2 made by phadej at 2018-04-06T05:35:24Z
Category System
Bug tracker https://github.com/phadej/splitmix#issues
Source repo head: git clone https://github.com/phadej/splitmix.git
Uploaded by phadej at 2017-06-30T20:46:29Z
Distributions Arch:0.1.0.5, Debian:0.0.5, Fedora:0.1.0.4, LTSHaskell:0.1.0.5, NixOS:0.1.0.5, Stackage:0.1.0.5, openSUSE:0.1.0.5
Reverse Dependencies 18 direct, 10535 indirect [details]
Downloads 59825 total (498 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-06-30 [all 1 reports]

Readme for splitmix-0

[back to package description]

splitmix

Pure Haskell implementation of SplitMix pseudo-random number generator.

dieharder

Dieharder is a random number generator (rng) testing suite. It is intended to test generators, not files of possibly random numbers as the latter is a fallacious view of what it means to be random. Is the number 7 random? If it is generated by a random process, it might be. If it is made up to serve the purpose of some argument (like this one) it is not. Perfect random number generators produce "unlikely" sequences of random numbers – at exactly the right average rate. Testing a rng is therefore quite subtle.

time dieharder-input splitmix | dieharder -a -g 200

The test-suite takes around half-an-hour to complete. All tests are PASSED (occasionally WEAK).

In comparison, built-in Marsenne Twister test takes around 15min.

time dieharder-input -a

benchmarks

benchmarking list/random
time                 96.77 μs   (96.28 μs .. 97.35 μs)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 96.77 μs   (96.35 μs .. 97.63 μs)
std dev              2.001 μs   (1.028 μs .. 3.796 μs)
variance introduced by outliers: 15% (moderately inflated)

benchmarking list/tf-random
time                 60.43 μs   (60.12 μs .. 60.79 μs)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 60.52 μs   (60.26 μs .. 60.91 μs)
std dev              1.120 μs   (780.2 ns .. 1.513 μs)
variance introduced by outliers: 14% (moderately inflated)

benchmarking list/splitmix
time                 16.38 μs   (16.29 μs .. 16.47 μs)
                     1.000 R²   (0.999 R² .. 1.000 R²)
mean                 16.34 μs   (16.25 μs .. 16.51 μs)
std dev              386.8 ns   (201.5 ns .. 669.8 ns)
variance introduced by outliers: 24% (moderately inflated)

benchmarking tree/random
time                 115.4 μs   (108.6 μs .. 126.0 μs)
                     0.942 R²   (0.910 R² .. 0.977 R²)
mean                 116.0 μs   (110.3 μs .. 124.2 μs)
std dev              23.47 μs   (16.60 μs .. 33.95 μs)
variance introduced by outliers: 95% (severely inflated)

benchmarking tree/tf-random
time                 132.4 μs   (132.2 μs .. 132.5 μs)
                     1.000 R²   (1.000 R² .. 1.000 R²)
mean                 132.5 μs   (132.3 μs .. 132.6 μs)
std dev              403.3 ns   (323.0 ns .. 516.5 ns)

benchmarking tree/splitmix
time                 59.80 μs   (59.42 μs .. 60.15 μs)
                     1.000 R²   (0.999 R² .. 1.000 R²)
mean                 59.61 μs   (59.26 μs .. 60.36 μs)
std dev              1.683 μs   (864.5 ns .. 3.206 μs)
variance introduced by outliers: 27% (moderately inflated)

Note: the performance can be potentially further improved when GHC gets SIMD Support.