Glen <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > "Alan Miller" <[EMAIL PROTECTED]> wrote in message news:<K1Fa8.25709$[EMAIL PROTECTED]>... > > The fastest way to generate random normals and exponentials is to use George > > Marsaglia's ziggurat algorithm. > > I've seen both ziggurat and Monty Python approaches claimed as being > "about the fastest" or "close to the fastest" among reasonably general > algorithms (not restricted to a single distribution), and they are > both nice and easy to understand and reasonably easy to code. > > But in the case of gaussian distributions, which is faster? > > Glen ============================================= (3-year old) Timings, in nanoseconds, using Microsoft Visual C++ and gcc under DOS on a 400MHz PC. Comparisons are with methods by Leva and by Ahrens-Dieter, both said to be fast, using the same the same uniform RNG.
MS gcc Leva 307 384 Ahrens-Dieter 161 193 RNOR 55 65 (Ziggurat) REXP 77 40 (Ziggurat) The Monty Python method is not quite as fast as as the Ziggurat. Some may think that Alan Miller's somewhat vague reference to a source for the ziggurat article suggests disdain. The source is Journal of Statistical Software Vol 5, Issue 8, available on the Web. Potential articles for this journal seem as fully refereed and seriously considered as are those in more conventional (but glacial) journals, at least based on my experience, and I have published papers in over forty different math/stat/CS/IEEE journals, seven medical, two physics and one law journal as well several general purpose journals. George Marsaglia (I don't have a web page, so the above can be considered my way to play Ozymandius.) ================================================================= Instructions for joining and leaving this list, remarks about the problem of INAPPROPRIATE MESSAGES, and archives are available at http://jse.stat.ncsu.edu/ =================================================================