more on Trigonometric Argument Reduction

David G. Hough on validgh dgh
Sun Feb 24 06:06:34 PST 1991


Bob Knighten observes:

> My experience with mathematical calculations has been that when arguments are
> large enough that unusually careful argument reduction is needed to get values
> of trignometric functions that are "almost right", the precision of the
> argument has INVARIABLY been such that the "almost right" value represented a
> precision not in keeping with the precision of the argument.  
> 
> There have certainly been plenty of implementations of the trignometric
> functions and the other elementary functions for complex arguments where
> a poor implementation of argument reduction has produced a significant loss of
> accuracy, but this has very little to do with the situation with large
> arguments.  After all what is the "correct" value for
> sin(3.141592653589793238462463E+25)?

The correct value for sin(3.141592653589793238462463E+25) is the one that 
preserves as many important properties as you can afford, 
because you don't know which
ones the program is depending on.  For instance, if x and y are exactly
representable and close enough, you'd like to be able to depend on the Taylor
series working as you expect, and on the trigonometric identities.  
This will be the case for trigonometric functions
if you adopt any consistent trigonometric argument reduction scheme, but not
if you adopt one with a hole or wall in it at a particular point because of
an algorithmic limitation; if x and y happen to lie on opposite sides of
the hole or wall, their computed trigonometric functions won't have any
relationship to each other.  This is much more significant than whether
sin(3.141592653589793238462463E+25) is reduced with "infinite" pi or
with pi.66 or pi.53.

For more modest arguments, like sin(314159265898) or even 314159266
you might like to rely on getting more than a few significant figures correct.
That will require some care in argument reduction; it's not that much more
difficult to get larger arguments correctly reduced.

The best discussion of the value of preserving relationships
was in an appendix for an HP calculator manual,
the 15-C as I recall.



More information about the Numeric-interest mailing list