Subject: Re: CCL:Comp. Chem. and the Pentium FDIV bug

From: "Peter Shenkin" <[email-masked]>
Date: Wed, 30 Nov 1994 10:33:01 -0500

On Nov 29,  4:41pm, Graham Hurst wrote:

> When we run this test on a Pentium 90 with the bug (verified by finding
> 4195835 - (4195835/3145727*3145727) = 256 with the Windows calculator)
> and on a 486 without the bug, we do find differences ... For one the
> difference is one in the 12th significant digit and for the other three
> the differences are in the 13th siginificant digit.
>
> For comparison, we find larger differences (but still relatively
> insignificant) comparing results from 486, SGI, DEC Alpha or IBM...
...
> Based on the above, I'd suggest not panicking about the Pentium FDIV bug.
> The magnitude of the error as manifested in molecular modelling
> calculations seems almost immeasurable...

Graham,

I believe that your analysis is based on a misinterpretation
of the nature of the bug.  The nature of the bug is that for a
very few specific floating point values, division is very, very
wrong.  The probability of this happening is of the order of parts
per 10^12.

The odds of your having even encountered the bug while running your
test suite is only about 1/1000, even if each of your tests performed
~10^6 floating-point calculations.  If you did encounter it, it
might or might not have affected your results significantly, depending
on where it was encountered.  If it was encountered during an update
of coordinates in an otherwise converged MD run, for example,
presumably it would be averaged out of visibility.

But if the bug had been encountered during, say, a scale-factor
division just prior to output, the effect would have been
disasterous.

Thus the Pentium FDIV bug is one of those cases of "low probability,
but high potential for disaster if encountered."

In a certain sense, you're correct when you say:

> The magnitude of the error as manifested in molecular modelling
> calculations seems almost immeasurable...

But this is in part because you're unlikely to encounter it.  The FP
differences you see between 486 and 586 are unlikely to have anything
whatsoever to do with this bug;  you probably never encountered it.

The Pentium FP bug differs in a fundamental way from the look-up-table
bugs to which you compare it.  The look-up table bugs are, at worst,
close to the threshold of floating-point precision.  The Pentium
bug, when encountered, gives a result which, in contrast, is nearly
as wrong as it could possibly be.

	-P.

-- 
*********** World music:  What bluegrass is to a Bulgarian. **********
*Peter S. Shenkin, Box 768 Havemeyer Hall, Chemistry, Columbia Univ.,*
* New York, NY  10027;     [email-masked];     (212) 854-5143  *
************************ Make love, THEN war. ************************

---

From: [email-masked] (Graham Hurst)
Date: Wed, 30 Nov 94 14:44:24 -0500

> wrong.  The probability of this happening is of the order of parts

I'll agree about the rarity, though one in eight billion pairs of
floating point numbers is the probability I've seen, but I haven't seen
anything about the divisions per se being "very, very wrong".  Of course
small errors can be magnified with later operations, but with a "wrong"
(extremely low probability) pair of numbers where the bug is
manifested, the result of the division is only slightly wrong.

I haven't seen a definitive "worst case" yet, but the worst I've seen so
far is for 4195835 / 3145727, where the relative error is 8.1E-5.
The statistical analyses I've seen posted have typical relative
errors around 4E-9.

What *division* example have you seen that is "very, very wrong"?
I like to know if I've missed it! ;-)

> presumably it would be averaged out of visibility.

Our test suite ran many *billion* floating point operations and off
the top of my head I'd guess 1 % were divisions.  I agree that we might
not have tickled the bug, but the odds were much better than 1/1000.
(I didn't know about the immproved transcendentals and assumed that
we had indeed tickled the bug when we saw any differences.)

> division just prior to output, the effect would have been

Not if the maximum relative error is ~1e-4, and the usual error is
orders of magnitude smaller.

> but high potential for disaster if encountered."

I disagree - it's extremely low probability and low potential for
disaster if encountered.

I've deleted the rest of your points since it all follows from the
your premise that the bug causes "very, very wrong" divisions.

I'm not trying to defend the bug or Intel.  Indeed it is fun to see them
squirm after the "Intel Inside" marketing blitz (which among other
things implied imprecision in competitors floating point chips),
but I think a little less hysteria and more perspective is called for.

I'd be happy to take further discussions offline to save bandwidth...

Cheers,

Graham
------------
Graham Hurst ([email-masked])
Hypercube Inc, 7-419 Phillip St, Waterloo, Ont, Canada N2L 3X2 (519)725-4040
Info requests to: [email-masked]    Support questions to: [email-masked]
Email group: Send "subscribe hyperchem" to [email-masked]