Pentium chips have f.p.u. error -- rounding error on division

Mike Cherry cherry at stout.Stanford.EDU
Fri Nov 25 09:05:39 EST 1994


The following message on the Risks Forum might be of interest to those
concerned withthe Pentium bug (issue).

Mike

> RISKS-LIST: RISKS-FORUM Digest  Tuesday 22 November 1994  Volume 16 : Issue 57
> 
>          FORUM ON RISKS TO THE PUBLIC IN COMPUTERS AND RELATED SYSTEMS
>    ACM Committee on Computers and Public Policy, Peter G. Neumann, moderator
> 
> ***** See last item for information on RISKS (comp.risks), disclaimers *****
> 
> ...
> 
> Date: Mon, 21 Nov 1994 15:20:58 -0800 (PST)
> From: broadley at turing.ucdavis.edu (Bill Broadley)
> Subject: Pentium FDIV bug
> 
> As this below tiny program from Thomas Koenig demonstrates the pentium
> sometimes only returns single precision when dividing floating point doubles.
> 
> #include <stdio.h>
> int main()
> { double x,y,z;
>     x = 4195835.0; y = 3145727.0;
>     z = x - (x / y) * y;
>     printf("%f\n",z);
>     return 0;
> }
> 
> It will return 256 if you have the fdiv bug, and zero if you don't.
> 
> I've written 3 similar programs:
>         1 like the above, but more resistent to compiler optimization
>         1 that searches randomly for the bug (no special seeds)
>         1 that searches linearly for the bug.
> 
> I'll leave it to the reader to interpret the risks of a cpu that
> silently returns 1/2 the precision that you expect.
> 
> BTW in my test it happens about about 1 in 10^9 divisions or about
> once every 21 minutes with a sequential search.  I.e. if your running
> flat out divisions and multiplies (to check the divs).
> 
> It can be MUCH higher, up to once a second, with biased random numbers.
> 
> I'll make havebug.c rndsearchbug.c and linsearchbug.c available
> for anonymous ftp at math.ucdavis.edu
> 
> For further references read comp.sys.intel under the fdiv bug thread.
> 
> Bill Broadley, UCD Math Sys-Admin Broadley at math.ucdavis.edu
> http://ucdmath.ucdavis.edu/~broadley



More information about the Gen-link mailing list