Summary
Mersenne Twister (MT) is a widely-used fast pseudorandom number generator (PRNG) with a long period of 219937 - 1, designed 10 years ago based on 32-bit operations. In this decade, CPUs for personal computers have acquired new features, such as Single Instruction Multiple Data (SIMD) operations (i.e., 128-bit operations) and multi-stage pipelines. Here we propose a 128-bit based PRNG, named SIMD-oriented Fast Mersenne Twister (SFMT), which is analogous to MT but making full use of these features. Its recursion fits pipeline processing better than MT, and it is roughly twice as fast as optimised MT using SIMD operations. Moreover, the dimension of equidistribution of SFMT is better than MT.
We also introduce a block-generation function, which fills an array of 32-bit integers in one call. It speeds up the generation by a factor of two. A speed comparison with other modern generators, such as multiplicative recursive generators, shows an advantage of SFMT. The implemented C-codes are downloadable from http ://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/index.html.
Keywords
- Function Call
- Single Instruction Multiple Data
- Pseudorandom Number Generator
- Linear Feedbacked Shift Register
- Dimension Defect
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
R.P. Brent and P. Zimmermann. Random number generators with period divisible by a Mersenne prime. In Computational Science and its Applications - ICCSA 2003, volume 2667, pages 1–10, 2003.
R.P. Brent and P. Zimmermann. Algorithms for finding almost irreducible and almost primitive trinomials. Fields Inst. Commun., 41:91–102, 2004.
R. Couture, P. L'Ecuyer, and S. Tezuka. On the distribution of k-dimensional vectors for simple and combined Tausworthe sequences. Math. Comp., 60(202):749–761, 1993.
M. Fushimi. Random number generation with the recursion x t = x t−3p ⊕x t−3q . Journal of Computational and Applied Mathematics, 31:105–118, 1990.
D.E. Knuth. The Art of Computer Programming. Vol. 2. Seminumerical Algorithms. Addison-Wesley, Reading, Mass., 3rd edition, 1997.
P. L'Ecuyer. A search for good multiple recursive random number genarators. ACM Transactions on Modeling and Computer Simulation, 3(2):87–98, April 1993.
P. L'Ecuyer. Maximally equidistributed combined tausworthe generators. Math. Comp., 65(213):203–213, 1996.
P. L'Ecuyer. Tables of maximally equidistributed combined LFSR generators. Math. Comp., 68(225):261–269, 1999.
P. L'Ecuyer and R. Simard. TestU01: A C library for empirical testing of random number generators. ACM Transactions on Mathematical Software, 2006. to appear.
G. Marsaglia. Xorshift RNGs. Journal of Statistical Software, 8(14):1–6, 2003.
M. Matsumoto and T. Nishimura. Mersenne twister: A 623-dimensionally equidistributed uniform pseudorandom number generator. ACM Trans. on Modeling and Computer Simulation, 8 (1):3–30, January 1998. http://www.math.sci.hiroshima-u.ac.jp/˜m-mat/MT/emt.html.
M. Matsumoto and T. Nishimura. A nonempirical test on the weight of pseudorandom number generators. In Monte Carlo and Quasi-Monte Carlo methods 2000, pages 381–395. Springer-Verlag, 2002.
M. Matsumoto and T. Nishimura. Sum-discrepancy test on pseudorandom number generators. Mathematics and Computers in Simulation, 62 (3–6):431–442, 2003.
F. Panneton and P. L'Ecuyer. On the Xorshift random number generators. ACM Transactions on Modeling and Computer Simulation, 15(4):346–361, 2005.
F. Panneton, P. L'Ecuyer, and M. Matsumoto. Improved long-period generators based on linear reccurences modulo 2. ACM Transactions on Mathematical Software, 32(1):1–16, 2006.
M. Saito, H. Haramoto, F. Panneton, T. Nishimura, and M. Matsumoto. Pulmonary LFSR: pseudorandom number generators with multiple feedbacks and reducible transitions. 2006. submitted.
M. Saito and M. Matsumoto. SFMT Homepage. http://www.math.sci.hiroshima-u.ac.jp/˜m-mat/MT/SFMT/index.html.
Endianness from Wikipedia, the free encyclopedia. http://en.wikipedia.org/wiki/Endianness.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Saito, M., Matsumoto, M. (2008). SIMD-Oriented Fast Mersenne Twister: a 128-bit Pseudorandom Number Generator. In: Keller, A., Heinrich, S., Niederreiter, H. (eds) Monte Carlo and Quasi-Monte Carlo Methods 2006. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-74496-2_36
Download citation
DOI: https://doi.org/10.1007/978-3-540-74496-2_36
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-74495-5
Online ISBN: 978-3-540-74496-2
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)