Accuracy of tan()?

From: Everett M. Greene (mojaveg_at_iwvisp.com)
Date: 06/23/04


Date: Wed, 23 Jun 2004 11:25:23 PST

We have a situation where we have a tan() function
implemented in single-precision floating point
arithmetic and a test case is tan(-1.570796). We
are getting results of

- 3060018.
- 3185560.75
- 3185560.708
- 3560236.5
- 5340352.5
-37320540.2

depending on the implementation.

How does one define the accuracy of the tangent function
near the odd multiples of pi/2 and which of the above is
the "better" result?

As far as I'm concerned, any big number is good enough
in the vicinity of odd multiples of pi/2 since one
has an ill-formed problem if using tan() in these regions.



Relevant Pages

  • Re: Accuracy of tan()?
    ... >implemented in single-precision floating point ... >near the odd multiples of pi/2 and which of the above is ... Does 1.570796 round to that number? ...
    (comp.lang.fortran)
  • Re: Accuracy of tan()?
    ... >implemented in single-precision floating point ... >near the odd multiples of pi/2 and which of the above is ... Does 1.570796 round to that number? ...
    (sci.math.num-analysis)
  • Re: Accuracy of tan()?
    ... > implemented in single-precision floating point ... > near the odd multiples of pi/2 and which of the above is ... > has an ill-formed problem if using tan() in these regions. ...
    (sci.math.num-analysis)
  • Re: Accuracy of tan()?
    ... > near the odd multiples of pi/2 and which of the above is ... > has an ill-formed problem if using tan() in these regions. ... "In a world in which the price of calculation continues to decrease ...
    (comp.lang.fortran)
  • Re: Accuracy of tan()?
    ... > near the odd multiples of pi/2 and which of the above is ... > has an ill-formed problem if using tan() in these regions. ... "In a world in which the price of calculation continues to decrease ...
    (sci.math.num-analysis)