2
* Copyright (c) 1982 Donald H. House <x@unknown.com>
3
* Copyright (c) 1989 Robert Allen <x@unknown.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27
* This function takes as parameters real valued mean and
28
* standard-deviation, and an integer valued seed. It returns a
29
* real number which may be interpreted as a sample of a normally
30
* distributed (Gaussian) random variable with the specified mean
31
* and standard deviation. After the first call to gauss, the seed
32
* parameter is ignored.
34
* The computational technique used is to pass a uniformly
35
* distributed random number through the inverse of the Normal
36
* Distribution function.
38
static double gaussian(double, double, int);