Function rgsl::randist::gaussian::gaussian [] [src]

pub fn gaussian(r: &Rng, sigma: f64) -> f64

This function returns a Gaussian random variate, with mean zero and standard deviation sigma. The probability distribution for Gaussian random variates is,

p(x) dx = {1 \over \sqrt{2 \pi \sigma2}} \exp (-x2 / 2\sigma2) dx for x in the range -\infty to +\infty. Use the transformation z = \mu + x on the numbers returned by gsl_ran_gaussian to obtain a Gaussian distribution with mean \mu. This function uses the Box-Muller algorithm which requires two calls to the random number generator r.