vix.ing · top · new · best · stats · spec

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

2014/03/26 by Christopher D. McFarland, Christopher D McFarland, McFarland, Christopher D
Biochemistry, Genetics and Molecular Biology · Computer Science · #Chaos-based Image/Signal Encryption #Computational Physics and Python Applications #FOS: Computer and information sciences #Fractal and DNA sequence analysis #Mathematical Software (cs.MS) #Numerical Methods and Algorithms #cs.MS

paper · pdf · doi:10.48550/arxiv.1403.6870

openalex publication_date 2014/03/26 · arxiv created 2014/04/21 · arxiv updated 2014/04/22 · openalex created_date 2022/08/23 · openalex updated_date 2026/07/28

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.

Related