GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
xinormal.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <math.h>
3 
4 
5 double Cdhc_xinormal(double pee)
6 {
7  double f0, pind, pw, px;
8  static double p[5] = { -0.322232431088, -1., -0.342242088547,
9  -0.0204231210245, -4.53642210148e-5
10  };
11  static double q[5] = { 0.099348462606, 0.588581570495, 0.531103462366,
12  0.10353775285, 0.0038560700634
13  };
14 
15  pind = pee;
16 
17  if (pee < 1e-10)
18  return (double)-10.0;
19  else if (pee >= 1.0)
20  return (double)10.0;
21  else if (pee == 0.5)
22  return (double)0.5;
23  /* else */
24 
25  if (pee > .5)
26  pee--;
27 
28  pw = sqrt(log(1 / (pee * pee)));
29  f0 = (((pw * q[4] + q[3]) * pw + q[2]) * pw + q[1]) * pw + q[0];
30  px = pw + ((((pw * p[4] + p[3]) * pw + p[2])
31  * pw + p[1]) * pw + p[0]) / f0;
32 
33  if (pind < .5)
34  px = -px;
35 
36  return px;
37 }
double Cdhc_xinormal(double pee)
Definition: xinormal.c:5