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