-8A- 



C HDST0010 



SOBPOOTINE HDSTI (Q,F,X) HDST0020 



C f1DST0030 



C »•*»•*»*••*****•*»•»*♦*»********»***************»♦********♦**»*»***♦♦♦♦ a DS TO OHO 



C nDSTOOSO 



C THIS SOBPROGBRM IS COMPOSED OF TWO SOBROOTINES ADAPTED FROH THE (1DST0060 



C INTERNATIONAL HATHEWATICAL AND STATISTICAL LIBRARIES , INC. (IBSL) nDST0070 



C HDSTI - INVERSE STODENT'S T DISTRIBOTION HDST0080 



C BDNRIS - INVERSE NORHAL PROBABILITY DISTRIBOTION FUNCTION HDSr0090 



C BOTH SUBROUTINES HAVE BEEN EDITED REHOVING CAPABILITIES NOT NEEDED nDSTOlOO 



C IN THIS APPLICATION. THE PEHAINING CODE IS REPRODUCED HERE IN nDSTOIIO 



C ACCORDANCE WITH THE IMSL POLICY ON RESEARCH WORK AS STATED 3N nDST0120 



C PAGE INTRO-22 OF THE JULY, 1977 LIBRARY HANOAL. HDST0130 



C HDSTOmO 



Qm*m*********************************** **************************** *****fiQST:0 150 



C SDSTOieO 



C EXACT INTEGRAL FOP 2 D.F. HDST0170 



IF (ABS(F-2.0) .GT. .000001) GO TO 10 HDST0180 



X = SQET(2.0/(Q*(2.0-Q) )-2.0) (1DST0190 



GO TO 50 nDST0200 



10 HPI = 1.570796 MDST0210 



C EXACT INTEGRAL FOE 1 D.F. nDST0220 



IF (ABS(F-I.O) .GT. .000001) GO TO 20 HDST0230 



A = Q*HPI HDST02U0 



X = COS(A)/SIN(A) nDST0250 



GO TO 50 HDST0260 



C EXPANSION FOR N GREATER THAN 2 BDST0270 



20 A = 1.0/(F-0.5) nDST0280 



B = «b.O/(A*A) MDST0290 



C = ( (20700. ♦A/B-98.) 'A-ie.) *A + 96. 36 BDST0300 



D = ((9«.5/(B+C)-3.0) /B+1.0) •SQRT(A*HPI) ♦F MDST0310 



XX = D*Q nDST0320 



Y = XX«*(2.0/F) (1DST0330 

 IF (Y .GT. A*. 05) GO TO «0 BDST03H0 



Y = { (1.0/( ((F+6.0)/(r*Y)-0.0«9*D-0.822)* (F+2.0)»3.0) ♦ BDST0350 

 1 0.5/(F+i».0) ) »Y-1.0) »(F+1.0)/(F + 2.0) -H.O/Y MDST0360 



30 X = SQRT(F*Y) HDST0 370 



GO TO 50 BDST0380 



C ASYHPTOTIC INVERSE EXPANSION ABOUT BDSr0390 



C HOBHAL BDSTOaOO 



<»0 X = .5 * Q BDSTOHIO 



CALL BDNRIS(X,XX) HDST0U2O 



Y = XX * XX BDST0U30 

 IF (F .LT. 5.) C = C+0.3*{F-«.5) ♦(XX+0.6) HDSTOUHO 

 C= ({{.05*D*XX-5.0)»XX-7.0) *XX-2.0J*XX+B+C BDST0U50 

 f = (((((0.«»Y + 6. 3) *Y*36.) *Y + 9i«.5) /C-Y-3.0) /B + 1.0) •XX HDST0«60 



Y = A»Y*Y HDST0l»70 

 D = Y BDST0U80 



Y = .05*Y*Y+Y BDST0H90 

 IF (Y .GT. .002) Y = EXP{D) - 1.0 BDSTOSOO 

 GO TO 30 BDST0510 



50 RETURN BDST0520 



END MDST0530 



