Skip to main content

SIMD-Oriented Fast Mersenne Twister: a 128-bit Pseudorandom Number Generator

  • Conference paper
Monte Carlo and Quasi-Monte Carlo Methods 2006

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 169.00
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.

    Google Scholar 

  2. R.P. Brent and P. Zimmermann. Algorithms for finding almost irreducible and almost primitive trinomials. Fields Inst. Commun., 41:91–102, 2004.

    MathSciNet  Google Scholar 

  3. 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.

    Article  MATH  MathSciNet  Google Scholar 

  4. 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.

    Article  MATH  MathSciNet  Google Scholar 

  5. D.E. Knuth. The Art of Computer Programming. Vol. 2. Seminumerical Algorithms. Addison-Wesley, Reading, Mass., 3rd edition, 1997.

    Google Scholar 

  6. 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.

    Article  MATH  Google Scholar 

  7. P. L'Ecuyer. Maximally equidistributed combined tausworthe generators. Math. Comp., 65(213):203–213, 1996.

    Article  MATH  MathSciNet  Google Scholar 

  8. P. L'Ecuyer. Tables of maximally equidistributed combined LFSR generators. Math. Comp., 68(225):261–269, 1999.

    Article  MATH  MathSciNet  Google Scholar 

  9. 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.

    Google Scholar 

  10. G. Marsaglia. Xorshift RNGs. Journal of Statistical Software, 8(14):1–6, 2003.

    Google Scholar 

  11. 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.

    Article  MATH  Google Scholar 

  12. 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.

    Google Scholar 

  13. M. Matsumoto and T. Nishimura. Sum-discrepancy test on pseudorandom number generators. Mathematics and Computers in Simulation, 62 (3–6):431–442, 2003.

    Article  MATH  MathSciNet  Google Scholar 

  14. F. Panneton and P. L'Ecuyer. On the Xorshift random number generators. ACM Transactions on Modeling and Computer Simulation, 15(4):346–361, 2005.

    Article  Google Scholar 

  15. 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.

    Article  MathSciNet  Google Scholar 

  16. M. Saito, H. Haramoto, F. Panneton, T. Nishimura, and M. Matsumoto. Pulmonary LFSR: pseudorandom number generators with multiple feedbacks and reducible transitions. 2006. submitted.

    Google Scholar 

  17. M. Saito and M. Matsumoto. SFMT Homepage. http://www.math.sci.hiroshima-u.ac.jp/˜m-mat/MT/SFMT/index.html.

  18. Endianness from Wikipedia, the free encyclopedia. http://en.wikipedia.org/wiki/Endianness.

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics