
| PROGRAMMING NUMERIC APPLICATIONS |
| Table |
FPTAN | Partial tangent |
FPATAN | Partial arctangent |
F2XM1 | |
FYL2X | Y ·log.X |
FYL2XP1 | Y .log.(X + 1) |
The ratio result of FPTAN and the ratio argument of FPATAN are designed to optimize the calcula- tiori of the other trigonometric functions, including SIN, COS, ARCSIN, and ARCCOS. These can be derived from TAN and ARCTAN via standard trigonometric identities.
FPATAN
0.:5 ST(1) < ST(O) < 00
FPATAN (partial arctangent) computes the function 8 = ARCTAN (YIX). X is taken from the top stack element and Y from ST(l). Y and X must observe the inequality 0 .:5 Y < X < 00. The instruction pops the stack and returns 8 to the (new) stack top, overwriting the Yoperand.
F2XM1
o .:5 ST(O) .:5 0.5
F2XMl (2 to the X minus 1) calculates the function Y = 2X
This instruction is designed to produce a very accurate result even when X is close to O. To obtain Y=2x, add 1 to the result delivered by F2XM1.
The following formulas show how values other than 2 may be raised to a power of X:
lOx = 2xoLOG210 eX = 2x•LOG2• yX = 2xoLOG2Y
As shown in the next section, the 80287 has
FYL2X
0< ST(O) < 00 - 00 < ST(1) < 00
,
FYL2X (Y log base 2 of X) calculates the function Z = Y.LOG2X. X is taken from the stack top and Y from ST(l). The operands must be in the ranges 0 < X < 00 and - 00 < Y < + 00. The instruction pops the stack and returns Z at the (new) stack top, replacing the Yoperand.
This function optimizes the calculations of log to any base other than two, because a multiplication is always required: ,