ATN(B/A)+ATN(D/C)=ATN(((BC+AD)/AC)/((AC-BD)/AC)) ATN(B/A)-ATN(D/C)=ATN(((BC-AD)/AC)/((AC+BD)/AC))
FOR A=2 TO 100 FOR B=1 TO A IF GCD(A,B)=1 THEN FOR C=A+1 TO 100 FOR D=1 TO C IF GCD(C,D)=1 THEN LET XX=B*C+A*D LET YY=A*C-B*D LET P=ATN(B/A)+ATN(D/C) LET L$="ATN(" & STR$(B) & "/" & STR$(A) & ")+ATN(" & STR$(D) & "/" & STR$(C) & ")" IF XX=YY THEN PRINT "ATN(1)=";L$;P IF XX=-YY THEN PRINT "ATN(-1)=";L$;P IF XX>0 AND YY=0 THEN PRINT "ATN(0)=";L$;P IF XX<0 AND YY=0 THEN PRINT "ATN(-0)=";L$;P IF XX=0 AND YY>0 THEN PRINT "ATN(∞)=";L$;P IF XX=0 AND YY<0 THEN PRINT "ATN(-∞)=";L$;P LET XX=A*D-B*C LET YY=A*C+B*D LET P=-ATN(B/A)+ATN(D/C) LET L$="-ATN(" & STR$(B) & "/" & STR$(A) & ")+ATN(" & STR$(D) & "/" & STR$(C) & ")" IF XX=YY THEN PRINT "ATN(1)=";L$;P IF XX=-YY THEN PRINT "ATN(-1)=";L$;P IF XX>0 AND YY=0 THEN PRINT "ATN(0)=";L$;P IF XX<0 AND YY=0 THEN PRINT "ATN(-0)=";L$;P IF XX=0 AND YY>0 THEN PRINT "ATN(∞)=";L$;P IF XX=0 AND YY<0 THEN PRINT "ATN(-∞)=";L$;P LET XX=B*C-A*D LET YY=A*C+B*D LET P=ATN(B/A)-ATN(D/C) LET L$="ATN(" & STR$(B) & "/" & STR$(A) & ")-ATN(" & STR$(D) & "/" & STR$(C) & ")" IF XX=YY THEN PRINT "ATN(1)=";L$;P IF XX=-YY THEN PRINT "ATN(-1)=";L$;P IF XX>0 AND YY=0 THEN PRINT "ATN(0)=";L$;P IF XX<0 AND YY=0 THEN PRINT "ATN(-0)=";L$;P IF XX=0 AND YY>0 THEN PRINT "ATN(∞)=";L$;P IF XX=0 AND YY<0 THEN PRINT "ATN(-∞)=";L$;P END IF NEXT D NEXT C END IF NEXT B NEXT A END
EXTERNAL FUNCTION GCD(M,N) DO WHILE N<>0 LET T=MOD(M,N) LET M=N LET N=T LOOP LET GCD=M END FUNCTION
|