Current Volume | Browse
Vol. 25Vol. 24*Vol. 23Vol. 22*
Vol. 21Vol. 20*Vol. 19Vol. 18*
Vol. 17Vol. 16Vol. 15Vol. 14
Vol. 13*Vol. 12Vol. 11Vol. 10*
Vol. 9Vol. 8Vol. 7Vol. 6
Vol. 5Vol. 4Vol. 3Vol. 2
Vol. 1
* = Special Volume
| Search | RSS
Home | Instructions for Authors | LaTeX Style Files | Editorial Board

Authors: George Marsaglia, Wai Wan Tsang
Title: [download]
(5626)
The Ziggurat Method for Generating Random Variables
Reference: Vol. 5, Issue 8, Oct 2000
Submitted 2000-04-15, Accepted 2000-10-02
Type: Article
Abstract:

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 ki, and reals wi. 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 wi.

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.

Paper: [download]
(5626)
The ziggurat method for generating random variables
(application/pdf, 183.3 KB)
Supplements: [download]
(1172)
rnorrexp.c: C code for the ziggurat method for RNOR and REXP
(application/octet-stream, 3.1 KB)
Resources: BibTeX | OAI
Current Volume | Browse
Vol. 25Vol. 24*Vol. 23Vol. 22*
Vol. 21Vol. 20*Vol. 19Vol. 18*
Vol. 17Vol. 16Vol. 15Vol. 14
Vol. 13*Vol. 12Vol. 11Vol. 10*
Vol. 9Vol. 8Vol. 7Vol. 6
Vol. 5Vol. 4Vol. 3Vol. 2
Vol. 1
* = Special Volume
| Search | RSS
Home | Instructions for Authors | LaTeX Style Files | Editorial Board