| Routines

14387: THE 'ARCSIN' FUNCTION (offset 34)

The address of this routine is found in the table of addresses. It is called via the calculator literal 34 by the routine at acs. It is also called indirectly via fp_calc_2. This subroutine handles the function ASN X and returns a real number from -π/2 to π/2 inclusive which is equal to the value in radians of the angle whose sine is X. Thereby if Y=ASN X then X=SIN Y. This subroutine uses the trigonometric identity TAN (Y/2)=SIN Y/(1+COS Y) to obtain TAN (Y/2) and hence (using ATN) Y/2 and finally Y.
asn | 14387 | RST 40 | X
| 14388 | DEFB 49 | duplicate: X, X
| 14389 | DEFB 49 | duplicate: X, X, X
| 14390 | DEFB 4 | multiply: X, X*X
| 14391 | DEFB 161 | stk_one: X, X*X, 1
| 14392 | DEFB 3 | subtract: X, X*X-1
| 14393 | DEFB 27 | negate: X, 1-X*X
| 14394 | DEFB 40 | sqr: X, SQR (1-X*X)
| 14395 | DEFB 161 | stk_one: X, SQR (1-X*X), 1
| 14396 | DEFB 15 | addition: X, 1+SQR (1-X*X)
| 14397 | DEFB 5 | division: X/(1+SQR (1-X*X))=TAN (Y/2)
| 14398 | DEFB 36 | atn: Y/2
| 14399 | DEFB 49 | duplicate: Y/2, Y/2
| 14400 | DEFB 15 | addition: Y=ASN X
| 14401 | DEFB 56 | end_calc
| 14402 | RET | Finished: 'last value'=ASN X.