7 #define a0 2.50662823884e0
8 #define a1 -18.61500062529e0
9 #define a2 41.39119773534e0
10 #define a3 -25.44106049637e0
11 #define b1 -8.47351093090e0
12 #define b2 23.08336743743e0
13 #define b3 -21.06224101826e0
14 #define b4 3.13082909833e0
16 #define c0 -2.78718931138e0
17 #define c1 -2.29796479134e0
18 #define c2 4.85014127135e0
19 #define c3 2.32121276858e0
20 #define d1 3.54388924762e0
21 #define d2 1.63706781897e0
25 c Algorithm as 111 Applied statistics (1977), vol 26 no 1 page 121
26 c Produces normal deviate corresponding to lower tail area of p
27 c the hash sums are the sums of the moduli of the coefficients
28 c they nave no inherent meanings but are incuded for use in
29 c checking transcriptions. Functions abs,alog and sqrt are used.
32 derived from AS111 fortran version
35 double ppnd(p
, ifault
)
43 if( fabs(q
) <= split
) {
45 ppn
= q
* (((a3
* r
+ a2
) * r
+ a1
) * r
+ a0
)
46 / ((((b4
* r
+ b3
) * r
+ b2
) * r
+ b1
) * r
+ one
);
50 if(q
> zero
) r
= one
- p
;
56 ppn
= (((c3
*r
+c2
)*r
+ c1
) * r
+ c0
) / ((d2
* r
+ d1
) * r
+ one
);
57 if( q
< zero
) ppn
= -ppn
;