7-40
FLOATING-POINT UNIT
These values encoded in standard IEEE double-real format are as follows:
high
?
= 400921FB 54400000
low
?
= 3DE0B461 1A600000
(Note that in the IEEE double-real format, the exponents are biased (by 1023) and the fractions
are normalized.)
Similar versions of
?
can also be written in extended-real format.
When using this two-part
?
value in an algorithm, parallel computations should be performed
on each part, with the results kept separate. When all the computations are complete, the two
results can be added together to form the final result.
The complications of maintaining a consistent value of
?
for argument reduction can be avoided,
either by applying the trigonometric functions only to arguments within the range of the
automatic reduction mechanism, or by performing all argument reductions (down to a magni-
tude less than
?
/4) explicitly in software.
7.5.9.Logarithmic, Exponential, and Scale
The following instructions provide two different logarithmic functions, an exponential function,
and a scale function.
FYL2X
Compute log:
(y
?
log
2
x)
FYL2XP1
Compute log epsilon:(y
?
log
2
(x + 1))
F2XM1
Compute exponential:(2
x
1)
FSCALE
Scale
The FYL2X and FYL2XP1 instructions perform two different base 2 logarithmic operations.
The FYL2X instruction computes the log of (y
?
log2(x)). This operation permits the calculation
of the log of any base using the following equation:
log
b
x = (1/log
2
b)
?
log
2
x
The FYL2XP1 instruction computes the log epsilon of (y
?
log2(x + 1)). This operation provides
optimum accuracy for values of x that may be very close to 0.
The F2XM1 instruction computes the exponential (2x
?
1). This instruction only operates on
source values in the range
?
1.0 to +1.0.
The FSCALE instruction multiplies the source operand by a power of 2.
7.5.10.Transcendental Instruction Accuracy
The algorithms that the Pentium
®
and Pentium
®
Pro processors use for the transcendental
instructions (FSIN, FCOS, FSINCOS, FPTAN, FPATAN, F2XM1, FYL2X, and FYL2XP1)
allow a higher level of accuracy than was possible in earlier IA math coprocessors and FPUs.
The accuracy of these instructions is measured in terms of units in the last place (ulp). For a