7-2
FLOATING-POINT UNIT
If a does not equal 0, the formula is numerically unstable when the roots are nearly coincident
or when their magnitudes are wildly different. The formula is also vulnerable to spurious
over/underflows when the coefficients a, b, and c are all very big or all very tiny. When single-
precision (4-byte) floating-point coefficients are given as data and the formula is evaluated in
the FPUs normal way, keeping all intermediate results in its stack, the FPU produces impec-
cable single-precision roots. This happens because, by default and with no effort on the
programmers part, the FPU evaluates all those sub-expressions with so much extra precision
and range as to overwhelm almost any threat to numerical integrity.
If double-precision data and results were at issue, a better formula would have to be used, and
once again the FPUs default evaluation of that formula would provide substantially enhanced
numerical integrity over mere double-precision evaluation.
On most machines, straightforward algorithms will not deliver consistently correct results (and
will not indicate when they are incorrect). To obtain correct results on traditional machines
under all conditions usually requires sophisticated numerical techniques that go beyond typical
programming practice. General application programmers using straightforward algorithms will
produce much more reliable programs using the IAs. This simple fact greatly reduces the soft-
ware investment required to develop safe, accurate computation-based products.
Beyond traditional numeric support for scientific applications, the IA processors have built-in
facilities for commercial computing. They can process decimal numbers of up to 18 digits
without round-off errors, performing exact arithmetic on integers as large as 2
64
(or 10
18
).
Exact arithmetic is vital in accounting applications where rounding errors may introduce mone-
tary losses that cannot be reconciled.
The Intel FPUs contain a number of optional numerical facilities that can be invoked by sophis-
ticated users. These advanced features include directed rounding, gradual underflow, and
programmed exception-handling facilities.
These automatic exception-handling facilities permit a high degree of flexibility in numeric
processing software, without burdening the programmer. While performing numeric calcula-
tions, the processor automatically detects exception conditions that can potentially damage a
calculation (for example, X ? 0 or when X < 0). By default, on-chip exception logic handles
these exceptions so that a reasonable result is produced and execution may proceed without
program interruption. Alternatively, the processor can invoke a software exception handler to
provide special results whenever various types of exceptions are detected.
7.2.REAL NUMBERS AND FLOATING-POINT FORMATS
This section describes how real numbers are represented in floating-point format in the IA FPU.
It also introduces terms such as normalized numbers, denormalized numbers, biased exponents,
signed zeros, and NaNs. Readers who are already familiar with floating-point processing tech-
niques and the IEEE standards may wish to skip this section.
b
b
2
4ac
±
2a
--------------------------------------
X