User's Manual

FPTAN
FPATAN
F2XM1
FYL2X
FYL2XP1
PROGRAMMING NUMERIC APPLICATIONS
Table 2-9. Transcendental Instructions
Partial tangent
Partial arctangent
2X-1
Y
·log.X
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 (Y IX). 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 = 2
X
-1.
X
is
taken from the stack top and
must be in the range
0
.:5
X
.:5
0.5. The result Y replaces X at the stack top.
This instruction
is
designed to produce a very accurate result even when X
is
close to
O.
To obtain
Y=2
x
, 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
= 2
x
LOG2
yX
= 2xoLOG2Y
As
shown in the next section, the 80287 has built-in instructions for loading the constants LOG
2
1O
and
LOG
2
e, and the FYL2X instruction may be used to calculate X·LOG
2
Y.
FYL2X
0<
ST(O) <
00-00
< ST(1) <
00
,
FYL2X (Y log base 2 of X) calculates the function Z = Y.LOG
2
X.
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: ,
2-13