Jerzy Karczmarczuk wrote:
> but one should always try to perform all
> the needed reductions before the floating precision gets out of
> control. There are nice recurrences which simplify the computations
> with trigonometric functions. But between 0 and Pi/4 it should be
> well done.
No one should not.  One might get non-monoticity or something similar
at the edges.  The library designer should have already arranged for
range-reduction to be done in such a way that this doesn't happen.  If your
program asks for sin(10^100) I would incline to the view that this is a bug,
period.  (And it is acceptable for sin to return NaN.)  Any decent library
should give sin(x) up to about the precision (in terms of digits behind the
decimal point) given by x.  So if you ask for sin(10^9) in IEEE double precision
you should get about 5-7 digits of precision.  If you want more, then you need
high precision in the argument as well.

Reply via email to