Intel 80286, 80287 manual Fpatan, F2XM1, FYL2XP1

Models: 80287 80286

1 515
Download 515 pages 45.04 Kb
Page 405
Image 405

 

PROGRAMMING NUMERIC APPLICATIONS

 

Table 2-9. Transcendental Instructions

FPTAN

Partial tangent

FPATAN

Partial arctangent

F2XM1

2X-1

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 -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=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 built-in instructions for loading the constants LOG2 1O and LOG2e, and the FYL2X instruction may be used to calculate X·LOG2Y.

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: ,

2-13

Page 405
Image 405
Intel 80286, 80287 manual Fpatan, F2XM1, FYL2XP1