Argument reduction

The example "Sin(huge)" on page 228 illustrated argument reduction using the Remainder function (defined by the IEEE standards) and a rounded value of . Once is rounded, the Remainder is exact, but the result is effectively phase shifted.

An alternative, supported in some systems but not by the CommonPoint application system, is to provide correctly rounded argument reduction modulo . Given a floating-point value x, the idea is to compute n and r such that .

Here, k is a small value like 2 or 3. As with the Remainder function, n is huge when x is. The implementation trick is to precompute to thousands of bits of accuracy, so that the computation can be carried far enough (without error) to compute n and sufficiently many bits of to recover r with just one rounding error.

Using this technique, trigonometric functions have their correct period and large arguments aren't phase shifted. However, there is a performance penalty, especially for large arguments, compared to reduction with IEEE Remainder.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker