1
DOUBLE PRECISION FUNCTION stvaln(p)
3
C**********************************************************************
5
C DOUBLE PRECISION FUNCTION STVALN(P)
6
C STarting VALue for Neton-Raphon
7
C calculation of Normal distribution Inverse
13
C Returns X such that CUMNOR(X) = P, i.e., the integral from -
14
C infinity to X of (1/SQRT(2*PI)) EXP(-U*U/2) dU is P
20
C P --> The probability whose normal deviate is sought.
21
C P is DOUBLE PRECISION
27
C The rational function on page 95 of Kennedy and Gentle,
28
C Statistical Computing, Marcel Dekker, NY , 1980.
30
C**********************************************************************
32
C .. Scalar Arguments ..
36
DOUBLE PRECISION sign,y,z
39
DOUBLE PRECISION xden(5),xnum(5)
41
C .. External Functions ..
42
DOUBLE PRECISION devlpl
45
C .. Intrinsic Functions ..
46
INTRINSIC dble,log,sqrt
48
C .. Data statements ..
49
DATA xnum/-0.322232431088D0,-1.000000000000D0,-0.342242088547D0,
50
+ -0.204231210245D-1,-0.453642210148D-4/
51
DATA xden/0.993484626060D-1,0.588581570495D0,0.531103462366D0,
52
+ 0.103537752850D0,0.38560700634D-2/
54
C .. Executable Statements ..
55
IF (.NOT. (p.LE.0.5D0)) GO TO 10
62
20 y = sqrt(-2.0D0*log(z))
63
stvaln = y + devlpl(xnum,5,y)/devlpl(xden,5,y)