Author tim.peters
Recipients christian.heimes, gvanrossum, nascheme, noam, rhettinger, tim.peters
Date 2007-12-11.18:24:30
SpamBayes Score 4.14652e-05
Marked as misclassified No
Message-id <1f7befae0712111024h2dc1ff4o7e704adfebfcfcda@mail.gmail.com>
In-reply-to <1197386480.04.0.438061160697.issue1580@psf.upfronthosting.co.za>
Content
[Guido]
> ...  We can just say that Python
> won't work correctly unless your float input routine is rounding
> correctly; a unittest should detect whether this is the case.

Sorry, but that's intractable.  Correct rounding is a property that
needs to be proved, not tested.  Processors aren't fast enough to test
all (roughly) 2**64 possible doubles in reasonable time, and there's
only one way to get all of them right (correct rounding).  There are
many ways to get at least one of them wrong, and short of proof only
exhaustive testing can determine whether at least one is wrong.  There
is no "smoking gun" specific test case, either -- different flawed
routines will fail on different inputs.

> I expect that more recent C runtimes for Windows are correct.

Based on what?  Unless MS says so somewhere, it's very hard to know.

Vern Paxson and David Hough developed a test program in the early
90's, based on an excruciatingly difficult algorithm I invented for
finding "hard cases", and the code they wrote still appears to be
available from the places Vern mentions in this brief msg:

http://www.netlib.org/fp/testbase

That code doesn't guarantee to find a failing correct-rounding case if
one exists, but did find failures reasonably efficiently on many
platforms tested at the time.
History
Date User Action Args
2007-12-11 18:24:31tim.peterssetspambayes_score: 4.14652e-05 -> 4.14652e-05
recipients: + tim.peters, gvanrossum, nascheme, rhettinger, christian.heimes, noam
2007-12-11 18:24:31tim.peterslinkissue1580 messages
2007-12-11 18:24:30tim.peterscreate