A modified ziggurat algorithm for generating exponentially- and normally-distributed pseudorandom numbers

Christopher D McFarland
2014
2 references

Abstract

The Ziggurat Algorithm is a very fast rejection sampling method for generating PseudoRandom Numbers (PRNs) from common statistical distributions. The algorithm divides a distribution into rectangular layers that stack on top of each other (resembling a Ziggurat), subsuming the desired distribution. Random values within these rectangular layers are then sampled by rejection. This implementation splits layers into two types: those constituting the majority that fall completely under the distribution and can be sampled extremely fast without a rejection test, and a few additional layers that encapsulate the fringe of the distribution and require a rejection test. This method offers speedups of 65% for exponentially- and 82% for normally-distributed PRNs when compared to the best available C implementations of these generators. Even greater speedups are obtained when the algorithm is extended to the Python and MATLAB/OCTAVE programming environments.

1 repository
2 references

Code References

openjdk/jdk
1 file
src/java.base/share/classes/jdk/internal/util/random/RandomSupport.java
2
* Also at https://arxiv.org/abs/1403.6870 (26 March 2014).
* Also at https://arxiv.org/abs/1403.6870 (26 March 2014).
Link copied to clipboard!