/
randomgaussian.1
45 lines (45 loc) · 1.44 KB
/
randomgaussian.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.\" Automatically generated by Pandoc 2.11.3.2
.\"
.TH "randomgaussian" "1" "2020-12-16" "Fortran 95" "SHTOOLS 4.8"
.hy
.SH RandomGaussian
.PP
Return a pseudo-Gaussian deviate of zero mean and unit variance.
.SH Usage
.PP
\f[C]rg\f[R] = RandomGaussian (\f[C]seed\f[R])
.SH Parameters
.TP
\f[B]\f[CB]rg\f[B]\f[R] : output, real(dp)
The radom Gaussian deviate.
.TP
\f[B]\f[CB]seed\f[B]\f[R] : input/output, integer(int32)
Input a negative integer to (re-)initialize the random number generator.
Afterwards, this argument should not be modified.
.SH Description
.PP
\f[C]RandomGaussian\f[R] will return a Gaussian random deviate with unit
variance and zero mean.
The underlying random number generator uses the algorithm of Park and
Miller combined with a Marsaglia shift sequence, which is claimed to
have a periodicity of about 3.1 10\[ha]18.
The random number generator is intialized by calling with a negative
value of \f[C]seed\f[R], and afterwards, this variable should not be
modified.
To obtain a Gaussian deviate with a standard deviation of
\f[C]sigma\f[R], it is only necessary to multiply the unit variance
deviate by \f[C]sigma\f[R].
.PP
This is a slightly modified version of the algorithm that was published
in NUMERICAL RECIPES as GASDEV.
.SH References
.PP
Press, W.H., S.A.
Teukolsky, W.T.
Vetterling, and B.P.
Flannery, Numerical Recipes in FORTRAN: The Art of Scientific Computing,
2nd ed., Cambridge Univ.
Press, Cambridge, UK, 1992.
.SH See also
.PP
randomn