Pentium FDIV bug: Difference between revisions
| (page creation) | Newer revision (05:26, 28 September 2026) 52.38.225.52 (New page from the article seed) |
| Line 1: | Line 1: | ||
| + | {{Infobox | ||
| + | | title = Pentium FDIV bug | ||
| + | | found by = Thomas R. Nicely, Lynchburg College | ||
| + | | noticed = June 1994 | ||
| + | | isolated = 19 October 1994 | ||
| + | | reported to Intel = 24 October 1994 | ||
| + | | public email = 30 October 1994 | ||
| + | | example = 4195835 divided by 3145727 | ||
| + | | check = the same division, rearranged, returns 256 instead of 0 | ||
| + | }} | ||
| + | The '''Pentium FDIV bug''' is an error in the floating-point division of early Intel Pentium processors. Thomas R. Nicely, a mathematician at Lynchburg College, was enumerating primes and adding up the reciprocals of twin primes when the totals from a Pentium disagreed with the totals from a 486 by more than rounding could explain. He traced it, by binary search, to one pair of twin primes. The processor was returning a wrong reciprocal. He contacted Intel on 24 October 1994 and described the bug in an email on 30 October.<ref name="nicely">Thomas R. Nicely, "Pentium FDIV flaw FAQ", 19 August 2011, including the test values and his account of the discovery.</ref> | ||
| + | |||
| + | He had first seen the bad totals in June. It took until 19 October to be satisfied that the compiler, the chipset and his own code were not the cause. | ||
| + | |||
| + | == The division == | ||
| + | A short test, which Nicely attributes to Tim Coe, is the division of 4,195,835 by 3,145,727. A correct processor returns 1.3338204491362410025. A flawed Pentium returns 1.3337390689020375894. The first digits agree. The fifth significant digit does not.<ref name="nicely" /> | ||
| + | |||
| + | Rearranged, the same sum is harder to miss. Compute 4195835 minus 3145727 times the quotient of those two numbers. The result should be 0. On a flawed Pentium it is 256. Nicely's note says the check can be done in a spreadsheet, in BASIC, or in the calculator that shipped with Windows. | ||
| + | |||
| + | == What he was doing == | ||
| + | The project was not a test of the chip. It was a count of primes, twin primes, triplets and quadruplets, run across a set of ordinary computers and combined at the end. The first Pentium joined that set in March 1994. The wrong answers appeared in the sum of reciprocals, which is a quantity that converges, slowly, and which has to be right to many places before the error shows. Lock the floating-point unit out and the error disappeared, at about a tenth of the speed.<ref name="nicely" /> | ||
| + | |||
| + | The processor failed a piece of arithmetic that a mathematician was only doing in order to add up a series. The failure could then be demonstrated on the calculator. | ||
| + | |||
| + | == See also == | ||
| + | * [[Computer bug]] | ||
| + | * [[Ariane 5 Flight 501]] | ||
| + | |||
| + | == References == | ||
| + | {{reflist}} | ||
| + | |||
| + | [[Category:True but improbable]] | ||
| + | |||