This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
GSL 1.6: patch for gauss.c -- CORRECTION + TIMING
The patch to randist/gauss.c that I sent out at
Date: Wed, 26 Jan 2005 17:29:26 -0500
has a fatal C++'ism creeping is. Please replace
y = abs(v) - t;
by
y = fabs(v) - t;
Sorry about that!
I did a timing test using the default basic RNG with gcc -O2
optimization on a Linux Pentium 866 MHz machine. The results are:
GSL polar method: 640 ns
Old ratio method: 630 ns
New ratio method: 380 ns
So Leva's bounds give a nice speed up by about 1.6 over the raw ratio
method and the polar method. Perhaps gsl_ran_gaussian_ratio_method
should be the default routine for normal deviates?
A PostScript on knuthran. With Knuth's latest recommendations, knuthran
passes all the "Die Hard" tests and so qualifies as a major league RNG
(?). (This is the raw RNG that I use.)
--
Charles Karney <ckarney@sarnoff.com>
Sarnoff Corporation, Princeton, NJ 08543-5300
URL: http://charles.karney.info
Tel: +1 609 734 2312
Fax: +1 609 734 2323