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