On Tue, 2010-06-22 at 13:04 +0200, Sumit Adhikari wrote:

> P gauss_rand = sigma*y*sqrt(-2.0*log(rad)/rad) ;
>       return (gauss_rand);

The code looks correct. If you want a quick, simple test generate a few
hundred pairs of variates and produce a scatter plot.

The code is, however, not particularly efficient. The gsl_ran_gaussian
code should run faster and the gsl_ran_gaussian_ziggurat code faster
still. Even a simple Box–Müller generator should be quicker because you
can get two Gaussian variates from two random numbers.

-- 
JDL


_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to