Technical Considerations
■If an invalid input is provided or if the result cannot be represented exactly, a
Careful Rounding
If the result of an IEEE arithmetic operation cannot be represented exactly in binary format, the number is rounded. IEEE arithmetic normally rounds results to the nearest value that can be represented in the chosen data format. The difference between the exact result and the represented result is the roundoff error.
The IEEE standard requires that users be able to choose to round in directions other than to the nearest value. For example, sometimes you might want to know that rounding has not invalidated a computation. One way to do that would be to force the rounding direction so that you can be sure your results are higher (or lower) than the exact answer.
Because it conforms to the IEEE standard, PowerPC Numerics gives you a means of doing that. Fully developed, this strategy is called interval arithmetic (Kahan 1980).The following example is a simple demonstration of the advantages of careful rounding.
Suppose your application performs operations that are mutually inverse; that is, operations y=f(x), x=g(y), such that g( f(x))=x. There are many such operations, such as
y=x2, x=Ãy y=375x, x=yÖ375
Suppose F(x) is the computed value of f(x), and G(y) is the computed value of g(y). Because many numbers cannot be represented exactly in binary, the computed values F(x) and will often differ from f(x) and g(y). Even so, if both functions are continuous and well behaved, and if you always round F(x) and
to the nearest value, you might expect your computer arithmetic to return x when it performs the cycle of inverse operations, G(F(x))=x.
It is difficult to predict when this relation will hold for computer numbers. Experience with other computers says it is too much to expect, but IEEE arithmetic very often returns the correct inverse value.
The reason for IEEE arithmeticÕs good behaviour with respect to inverse operations is that it rounds so carefully. Even with all operations in, say, single precision, it evaluates the expression 3x1/3 to 1.0 exactly; some computers that do not follow the standard do not evaluate this expression exactly.
Technical Considerations
33
iMalc Manual