Re: WMS FORTRAN: what are SIND, COSD, etc?
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Wed, 07 Dec 2005 23:33:40 -0800
James Giles wrote:
Rich Townsend wrote: ...
I disagree; I would be very happy if SIN(ACOS(-1.)) returns zero. Why would that be an error?
I wouldn't be very happy with that at all. Suppose I explicitly input a representable number that's very close to the transcendental number pi. That number isn't pi, but it's close. The sine of that number is not zero. In fact, it's further from zero than the smallest representable floating-point value (by a very large margin). When I apply SIN to that number I expect an accurate calculation of the sine of the input value - I do *NOT* want the implementation to guess that I must really have meant pi! It's perfectly plausible that I didn't mean pi at all, but some value that was, in a way that's important to my problem, explicitly different from pi.
Some might want a value that is near 3.14 and has a sin() of zero. Especially those multiplying a value by pi/180 before sending it to sin().
Now, since the SIN function have no way of detecting where its argument came from, any result of a claculation that generates that same "nearly pi" value must return the same value for SIN as rthe explicitly input argument did. To do otherwise complicates numneric stability calculations intolerably. Do you really want to have to guess about what guesses the implementation made about your computation? Or would you rather have all operations be well-defined and operate consistently?
On the other hand, I would expect a proper implementation of SIND(ACOSD(-1.0)) to compare exactly equal to zero.
That would be nice.
-- glen
.
- Follow-Ups:
- References:
- WMS FORTRAN: what are SIND, COSD, etc?
- From: wob96
- Re: WMS FORTRAN: what are SIND, COSD, etc?
- From: John Doe
- Re: WMS FORTRAN: what are SIND, COSD, etc?
- From: robert . corbett
- Re: WMS FORTRAN: what are SIND, COSD, etc?
- From: John Doe
- Re: WMS FORTRAN: what are SIND, COSD, etc?
- From: Ron Shepard
- Re: WMS FORTRAN: what are SIND, COSD, etc?
- From: Rich Townsend
- Re: WMS FORTRAN: what are SIND, COSD, etc?
- From: James Giles
- WMS FORTRAN: what are SIND, COSD, etc?
- Prev by Date: Re: F95 I/O filesize problems
- Next by Date: Re: WMS FORTRAN: what are SIND, COSD, etc?
- Previous by thread: Re: WMS FORTRAN: what are SIND, COSD, etc?
- Next by thread: Re: WMS FORTRAN: what are SIND, COSD, etc?
- Index(es):
Relevant Pages
|