[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] Gaussian Ziggurat changes

From: Brian Gough
Subject: Re: [Help-gsl] Gaussian Ziggurat changes
Date: Thu, 13 Apr 2006 18:47:29 +0100

Richard Gould writes:
 > I'm using GSL for an application where it's fairly important to be
 > able to produce consistent sets of random numbers on subsequent
 > runs. I've been using Jochen Voss's add-on to generate gaussian
 > distributed numbers with the Ziggurat algorithm. I'm currently in
 > the process of upgrading to gsl-1.8, in which I'm happy to see the
 > Ziggurat routine has now been incorporated. However I notice that
 > the included version has been altered slightly so that it produces
 > a different stream of numbers from the add-in version when run with
 > the same RNG algorithm and the same starting seed.
 > Furthermore, it seems to me that the version in gsl-1.8 will be
 > slower than the add-in version for RNG algorithms that can return a
 > max value of 2^32-1, like the mt19937 algorithm which I'm using,
 > since it will make two calls to the RNG rather than a single call
 > in the add-in.


I didn't handle 2^32 as a special case as I preferred at the time to
have one code path for all generators.  It's about 50% slower on
mt19937, for the non 32-bit generators it doesn't make much

For applications where gaussians are the bottleneck I'd probably
recommend a specialised routine in the application itself.

Brian Gough
(GSL Maintainer)

Network Theory Ltd,
Commercial support for GSL ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]