1 " "USING :ON ERROR GOTO 400:DEGREE :PAUSE " ADVANCED MATH FUNCTIONS":PAUSE "  Copr. 1982 Tandy Corp."
3 "CLR"WAIT :CLEAR :LOCK :GOTO 9
4 BEEP 3:PRINT "ILLEGAL OPERATION":GOTO 9
5 BEEP 1,99,75:PRINT A
9 PAUSE "Select function"
11 INPUT "RAD DEG GRAD CLR END ";D$:GOTO 30
12 INPUT "SIN COS TAN COT SEC CSC ";D$:GOTO 30
13 INPUT "ASIN ACOS ATAN ";D$:GOTO 30
14 INPUT "ACOT ASEC ACSC ";D$:GOTO 30
15 INPUT "SINH COSH TANH ";D$:GOTO 30
16 INPUT "COTH SECH CSCH ";D$:GOTO 30
17 INPUT "ASINH ACOSH ATANH ";D$:GOTO 30
18 INPUT "ACOTH ASECH ACSCH ";D$:GOTO 30
19 INPUT "LOG  X^Y ";D$:GOTO 30
20 GOTO 9
30 IF D$="DEG"OR D$="RAD"OR D$="GRAD"OR D$="END"OR D$="CLR"THEN D$
32 INPUT "Argument? ";B:GOTO D$
33 PAUSE "Kept ";A:B=A:GOTO D$
35 "RAD"RADIAN :GOTO 9
36 "DEG"DEGREE :GOTO 9
37 "GRAD"GRAD :GOTO 9
40 "SIN"A=SIN B:GOTO 5
42 "COS"A=COS B:GOTO 5
44 "TAN"IF COS B=0THEN 4
45 A=TAN B:GOTO 5
46 "COT"IF SIN B=0THEN 4
47 A=1/TAN (B+((COS B=0))*(1E-9)):GOTO 5
48 "SEC"IF COS B=0THEN 4
49 A=1/COS B:GOTO 5
50 "CSC"IF SIN B=0THEN 4
51 A=1/SIN B:GOTO 5
52 "ASIN"IF ABS B>1THEN 4
53 A=ASN B:GOTO 5
54 "ACOS"IF ABS B>1THEN 4
55 A=ACS B:GOTO 5
56 "ATAN"A=ATN B:GOTO 5
58 "ACOT"A=-ATN B+PI /2:GOTO 5
60 "ASEC"IF ABS B<1THEN 4
61 A=ATN (SQR (B*B-1))+((SGN B)-1)*PI /2:GOTO 5
62 "ACSC"IF ABS B<1THEN 4
63 A=ATN (1/SQR (B*B-1))+((SGN B)-1)*PI /2:GOTO 5
64 "SINH"A=(EXP B-EXP -B)/2:GOTO 5
66 "COSH"A=(EXP B+EXP -B)/2:GOTO 5
68 "TANH"A=-EXP -B/(EXP B+EXP -B)*2+1:GOTO 5
70 "COTH"IF B=0THEN 4
71 A=EXP -B/(EXP B-EXP -B)*2+1:GOTO 5
72 "SECH":A=2/(EXP B+EXP -B):GOTO 5
74 "CSCH"IF B=0THEN 4
75 A=2/(EXP B-EXP -B):GOTO 5
76 "ASINH":A=LN (B+SQR (B*B+1)):GOTO 5
78 "ACOSH"IF B<1THEN 4
79 A=LN (B+SQR (B*B-1)):GOTO 5
80 "ATANH"IF ABS B>=1THEN 4
81 A=LN ((1+B)/(1-B))/2:GOTO 5
82 "ACOTH"IF ABS B<=1THEN 4
83 A=LN ((B+1)/(B-1))/2:GOTO 5
84 "ASECH"IF B<=0OR B>1THEN 4
85 A=LN ((SQR (-B*B+1)+1)/B):GOTO 5
86 "ACSCH"IF B=0THEN 4
87 A=LN (((SGN B)*SQR (B*B+1)+1)/B):GOTO 5
100 "LOG"INPUT "Base? ";A
110 IF A<=0OR B<=0THEN 4
120 A=LN B/LN A:GOTO 5
200 "X^Y"INPUT "Exponent? ";A
210 IF A<1AND B<0AND A<>INT ATHEN 4
220 R=1:S=1:IF B<0LET S=-1:IF A/2<>INT (A/2)LET R=-1
230 A=R*((S*B)^A):GOTO 5
400 WAIT :BEEP 3:PRINT "*** ERROR ***":GOTO 9
500 "+"A=A+B:GOTO 5
510 "-"A=A-B:GOTO 5
520 "*"A=A*B:GOTO 5
530 "/"A=A/B:GOTO 5
999 "END"UNLOCK :END
