10 PRINT "F-DISTRIBUTION"
20 PRINT
30 PRINT "(TO END PROGRAM ENTER AN F-VALUE OF 0)"
40 PRINT "F-VALUE";
50 INPUT F
60 IF F=0 THEN 340
70 PRINT "DEGREES OF FREEDOM IN NUMERATOR";
80 INPUT D1
90 PRINT "DEGREES OF FREEDOM IN DENOMINATOR";
100 INPUT D2
110 X=1
119 REM - COMPUTE USING INVERSE FOR SMALL F-VALUES
120 IF F<1 THEN 170
130 S=D1
140 T=D2
150 Z=F
160 GOTO 200
170 S=D2
180 T=D1
190 Z=1/F
200 J=2/9/S
210 K=2/9/T
219 REM - COMPUTE USING APPROXIMATION FORMULAS
220 Y=ABS((1-K)*Z[(1/3)-1+J)/SQR(K*Z[(2/3)+J)
230 IF T<4 THEN 270
240 X=.5/(1+Y*(.196854+Y*(.115194+Y*(.000344+Y*.019527))))[4
250 X=INT(X*10000+.5)/10000
260 GOTO 290
270 Y=Y*(1+.08*Y[4/T[3)
280 GOTO 240
289 REM - ADJUST IF INVERSE WAS COMPUTED
290 IF F>=1 THEN 310
300 X=1-X
310 PRINT "PERCENTILE =";1-X
320 PRINT
330 GOTO 40
340 END
