Go to the source code of this file.
◆ rnorm_double()
void rnorm_double |
( |
double |
r1, |
|
|
double |
r2, |
|
|
double & |
x1, |
|
|
double & |
x2 |
|
) |
| |
Definition at line 36 of file rnorm.cpp.
36 {
37 double r =
sqrt(-2.0 * log(r1));
38 double fi = 2.0 * M_PI * r2;
41}
DoubleAc cos(const DoubleAc &f)
DoubleAc sqrt(const DoubleAc &f)
DoubleAc sin(const DoubleAc &f)
◆ rnorm_float()
void rnorm_float |
( |
float |
r1, |
|
|
float |
r2, |
|
|
float & |
x1, |
|
|
float & |
x2 |
|
) |
| |
Definition at line 43 of file rnorm.cpp.
43 {
44 float r =
sqrt(-2.0 * log(r1));
45 float fi = 2.0 * M_PI * r2;
48}
◆ rnorm_improved()
double rnorm_improved |
( |
void |
| ) |
|
Definition at line 15 of file rnorm.cpp.
15 {
19 } else {
20 double x1, x2, w, y1, y2;
21 do {
24 w = x1 * x1 + x2 * x2;
25 } while (w > 1.0);
26
27 w =
sqrt(-2.0 * log(w) / w);
28 y1 = x1 * w;
29 y2 = x2 * w;
32 return y1;
33 }
34}
Referenced by pois().
◆ gaus_state