[Paper Review] An experimental exploration of Marsaglia's xorshift generators, scrambled
This paper introduces highly efficient, high-quality pseudorandom number generators based on Marsaglia's xorshift generators enhanced with a nonlinear scrambling multiplication. By systematically testing parameter combinations and exploring high-dimensional variants, the author identifies generators—particularly xorshift1024* and xorshift64*—that achieve full periods of $2^{1024}-1$ and $2^{4096}-1$, pass all BigCrush tests, and outperform existing alternatives in speed and statistical quality using only eight logical operations, one addition, and one multiplication.
Marsaglia proposed recently xorshift generators as a class of very fast, good-quality pseudorandom number generators. Subsequent analysis by Panneton and L'Ecuyer has lowered the expectations raised by Marsaglia's paper, showing several weaknesses of such generators, verified experimentally using the TestU01 suite. Nonetheless, many of the weaknesses of xorshift generators fade away if their result is scrambled by a non-linear operation (as originally suggested by Marsaglia). In this paper we explore the space of possible generators obtained by multiplying the result of a xorshift generator by a suitable constant. We sample generators at 100 equispaced points of their state space and obtain detailed statistics that lead us to choices of parameters that improve on the current ones. We then explore for the first time the space of high-dimensional xorshift generators, following another suggestion in Marsaglia's paper, finding choices of parameters providing periods of length $2^{1024} - 1$ and $2^{4096} - 1$. The resulting generators are of extremely high quality, faster than current similar alternatives, and generate long-period sequences passing strong statistical tests using only eight logical operations, one addition and one multiplication by a constant.
Motivation & Objective
- To evaluate and improve the statistical quality of Marsaglia's xorshift generators through systematic experimentation.
- To investigate the impact of nonlinear scrambling via multiplication on xorshift generators' statistical properties.
- To design high-dimensional xorshift generators with extremely long periods ($2^{1024}-1$ and $2^{4096}-1$) using optimized parameter sets.
- To compare the performance and statistical quality of the proposed generators against established non-cryptographic PRNGs like MT19937 and WELL.
Proposed method
- Systematic sampling of xorshift64 generators at 100 state points to detect statistical weaknesses and evaluate parameter choices.
- Application of a multiplication by a constant to scramble the output of xorshift generators, emulating avalanche behavior to reduce linear artifacts.
- Design of high-dimensional xorshift generators using 1024-bit and 4096-bit states, with parameter sets selected to achieve full periods.
- Implementation and benchmarking of generators using C99 code, including jump functions for non-overlapping sequence generation.
- Evaluation using the TestU01 suite, particularly BigCrush, to assess statistical quality, with reverse generator testing to mitigate high-bit bias.
- Comparison of proposed generators against MT19937, WELL1024a, WELL19937a, and other standard generators in terms of speed, period length, and test suite performance.
Experimental results
Research questions
- RQ1Which parameter combinations for xorshift64 generators, when scrambled with multiplication, yield the highest statistical quality and pass all BigCrush tests?
- RQ2Can high-dimensional xorshift generators with state sizes of 1024 and 4096 bits achieve full periods of $2^{1024}-1$ and $2^{4096}-1$ while maintaining high performance and quality?
- RQ3How does the choice of multiplier (e.g., $M_{32}$, $M_8$, $M_2$) affect the statistical quality of the scrambled xorshift generators?
- RQ4How do the proposed generators compare in speed and statistical quality to widely used generators like MT19937 and WELL19937a?
- RQ5To what extent does scrambling the output of xorshift generators eliminate the linear artifacts that plague unscrambled versions?
Key findings
- The xorshift1024* generator achieves a period of $2^{1024}-1$, passes all BigCrush tests, and is the fastest generator tested, with a performance of 1.62 ns per output on average.
- The xorshift64* generator with parameters $A_1(12,25,27) \cdot M_{32}$, while failing the MatrixRank test, exhibits fewer linear artifacts than MT19937, WELL1024a, or WELL19937a.
- High-dimensional xorshift generators with 1024-bit and 4096-bit states were successfully constructed, achieving full periods of $2^{1024}-1$ and $2^{4096}-1$ respectively, using optimized shift and rotation parameters.
- The multiplier used for scrambling has no significant effect on statistical quality; $M_{32}$, $M_8$, and $M_2$ perform similarly, suggesting robustness to multiplier choice.
- The xorshift1024* generator is faster than WELL19937a (by a factor of nearly four) and outperforms it in BigCrush, despite having a much smaller state space.
- The study confirms that TestU01 provides significantly more resolution than Dieharder in high-dimensional testing, and that reverse generator testing is essential to detect high-bit biases.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.