Re: Accuracy of tan()?
From: John Morrison (john.morrison_at_tesco.net)
Date: 06/23/04
- Next message: Johan Karl Larsen: "solve nonlinear eqns"
- Previous message: David Sexton: "Re: Question about Simple Taylor Series"
- In reply to: Everett M. Greene: "Accuracy of tan()?"
- Next in thread: The Phantom: "Re: Accuracy of tan()?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Jun 2004 23:42:09 -0000
"Everett M. Greene" <mojaveg@iwvisp.com> wrote in message
news:20040623.7A1BB70.A513@mojaveg.iwvisp.com...
> 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.
In general, tan(Pi/2-z) = cot(z) = 1/tan(z).
Does this help?
John
johnDOTmorrisonATtescoDOT net
-- "Some people are so are so gullible that they think that the word 'gullible' means 'liable to be shat upon by members of the family <it>Laridae</it>'." - Anon. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.708 / Virus Database: 464 - Release Date: 18-Jun-04
- Next message: Johan Karl Larsen: "solve nonlinear eqns"
- Previous message: David Sexton: "Re: Question about Simple Taylor Series"
- In reply to: Everett M. Greene: "Accuracy of tan()?"
- Next in thread: The Phantom: "Re: Accuracy of tan()?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|