Re: floating point accuracy, was Compiler bugs

sos@zjod.net (Steve Siegfried)
18 Jan 2002 21:01:23 -0500

          From comp.compilers

Related articles
re: Compiler bugs chase@world.std.com (David Chase) (2002-01-03)
Re: Compiler bugs christian.bau@cbau.freeserve.co.uk (Christian Bau) (2002-01-05)
Re: Compiler bugs chase@world.std.com (David Chase) (2002-01-14)
Re: floating point accuracy, was Compiler bugs christian.bau@cbau.freeserve.co.uk (Christian Bau) (2002-01-17)
Re: floating point accuracy, was Compiler bugs sos@zjod.net (2002-01-18)
Re: floating point accuracy, was Compiler bugs chase@world.std.com (David Chase) (2002-01-18)
Re: floating point accuracy, was Compiler bugs christian.bau@cbau.freeserve.co.uk (Christian Bau) (2002-01-24)
| List of all articles for this month |

From: sos@zjod.net (Steve Siegfried)
Newsgroups: comp.compilers
Date: 18 Jan 2002 21:01:23 -0500
Organization: Ziggy's Auto Body and Tanning
References: 02-01-015 02-01-029 02-01-054 02-01-069
Keywords: arithmetic, errors
Posted-Date: 18 Jan 2002 21:01:22 EST
Originator: sos@zjod.net (Steve Siegfried)



(Christian Bau) wrote thusly:
> Or let my ask this question: The fdlibm functions for sine/cosine
> contain some huge tables. If one bit in these tables were incorrect,
> producing completely wrong results for x > 1e100 (but still in the range
> -1 to +1), would anyone notice?
>


The answer, sadly, is probably not.


In support of that, I'll point out that I once worked for a herein
unnamed (but at the time well-established and respected) "scientific"
computer vendor that released a version of their math library with the
sine and cosine routines reversed. Nobody, including a large
scientific customer base, noticed for quite some time.


Turns out, both sin(x) and cos(x) were tested over large ranges of x via the
"(((sin(x)**2)*(cos(x)**2)).eq.1)" identity... and both routines were quite
accurate, just completely wrong. No individual values of either sin(x) or
cos(x) were ever examined for correctness by the QA people.


Hey, Bob! The sine of 60 degrees is 0.5, right?'dily,


-S


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.