Fast splittable pseudorandom number generators

We describe a new algorithm SplitMix for an object-oriented and splittable pseudorandom number generator (PRNG) that is quite fast: 9 64-bit arithmetic/logical operations per 64 bits generated. A conventional linear PRNG object provides a generate method that returns one pseudorandom value and updates the state of the PRNG, but a splittable PRNG object also has a second operation, split, that replaces the original PRNG object with two (seemingly) independent PRNG objects, by creating and returning a new such object and updating the state of the original object. Splittable PRNG objects make it easy to organize the use of pseudorandom numbers in multithreaded programs structured using fork-join parallelism. No locking or synchronization is required (other than the usual memory fence immediately after object creation). Because the generate method has no loops or conditionals, it is suitable for SIMD or GPU implementation. We derive SplitMix from the DotMix algorithm of Leiserson, Schardl, and Sukha by making a series of program transformations and engineering improvements. The end result is an object-oriented version of the purely functional API used in the Haskell library for over a decade, but SplitMix is faster and produces pseudorandom sequences of higher quality; it is also far superior in quality and speed to java.util.Random, and has been included in Java JDK8 as the class java.util.SplittableRandom. We have tested the pseudorandom sequences produced by SplitMix using two standard statistical test suites (DieHarder and TestU01) and they appear to be adequate for "everyday" use, such as in Monte Carlo algorithms and randomized data structures where speed is important.

[1]  Pierre L'Ecuyer,et al.  Software for uniform random number generation: distinguishing the good and the bad , 2001, Proceeding of the 2001 Winter Simulation Conference (Cat. No.01CH37304).

[2]  George Michailides Statistical Analysis of Financial Data in S-PLUS , 2004 .

[3]  Mark A. Moraes,et al.  Parallel random numbers: As easy as 1, 2, 3 , 2011, 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC).

[4]  Victor Luchangco,et al.  The Fortress Language Specification Version 1.0 , 2007 .

[5]  Pierre L'Ecuyer,et al.  Efficient and portable combined random number generators , 1988, CACM.

[6]  S. K. Park,et al.  Random number generators: good ones are hard to find , 1988, CACM.

[7]  Koen Claessen,et al.  Splittable pseudorandom number generators using cryptographic hashing , 2013, Haskell '13.

[8]  Guy L. Steele,et al.  The Java Language Specification, Java SE 8 Edition , 2013 .

[9]  H. Feistel Cryptography and Computer Privacy , 1973 .

[10]  Pierre L'Ecuyer Uniform random number generators , 1998, WSC '98.

[11]  Stafford E. Tavares,et al.  On the Design of S-Boxes , 1985, CRYPTO.

[12]  Richard P. Brent,et al.  Note on Marsaglia's Xorshift Random Number Generators , 2004 .

[13]  C. S. Roberts Implementing and testing new versions of a good, 48-bit, pseudo-random number generator , 1982, The Bell System Technical Journal.

[14]  F. Warren Burton,et al.  Distributed Random Number Generation , 1992, J. Funct. Program..

[15]  Charles E. Leiserson,et al.  Deterministic parallel random-number generation for dynamic-multithreading platforms , 2012, PPoPP '12.

[16]  David Thomas,et al.  The Art in Computer Programming , 2001 .

[17]  Pierre L'Ecuyer,et al.  An Object-Oriented Random-Number Package with Many Long Streams and Substreams , 2002, Oper. Res..

[18]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[19]  Takuji Nishimura,et al.  Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator , 1998, TOMC.

[20]  H. Niederreiter,et al.  Monte Carlo and Quasi-Monte Carlo Methods in Scientific Computing , 1995 .

[21]  Pierre L'Ecuyer,et al.  TestU01: A C library for empirical testing of random number generators , 2006, TOMS.

[22]  Peter Hellekalek Don't trust parallel Monte Carlo! , 1998, Workshop on Parallel and Distributed Simulation.

[23]  Pierre L'Ecuyer,et al.  Good Parameters and Implementations for Combined Multiple Recursive Random Number Generators , 1999, Oper. Res..