TY - JOUR
AU - Marsaglia, George
AU - Tsang, Wai Wan
PY - 2000/10/02
Y2 - 2022/09/30
TI - The Ziggurat Method for Generating Random Variables
JF - Journal of Statistical Software
JA - J. Stat. Soft.
VL - 5
IS - 8
SE - Articles
DO - 10.18637/jss.v005.i08
UR - https://www.jstatsoft.org/index.php/jss/article/view/v005i08
SP - 1 - 7
AB - We provide a new version of our ziggurat method for generating a random variable from a given decreasing density. It is faster and simpler than the original, and will produce, for example, normal or exponential variates at the rate of 15 million per second with a C version on a 400MHz PC. It uses two tables, integers k<sub>i</sub>, and reals w<sub>i</sub>. Some 99% of the time, the required x is produced by: Generate a random 32-bit integer j and let i be the index formed from the rightmost 8 bits of j. If j < k, return x = j x w<sub>i</sub>. We illustrate with C code that provides for inline generation of both normal and exponential variables, with a short procedure for settting up the necessary tables.
ER -