FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++ Blog: Another pragmatic hardware test
C++
void main(void)

Calls, Returns and In-Between.

by Kevin Carlson
SELECTIVE IGNORANCE

Finding the Signal in the Noise

by Andrew Koenig
June 01, 2007

Another pragmatic hardware test

Around the same time as my last posting, I knew two people named Stan Brown and Norm Schryer, who came up with a very clever way of thinking about floating-point arithmetic.

Although the IEEE standard was already out there, only a few computers implemented it. Other manufacturers, such as IBM, Cray, and Digital, had their own floating-point formats and specifications.

Brown and Schryer were interested in doing scientific computation, which demanded floating-point hardware with known precision characteristics. Moreover, they were interested in having this computation work on a wide variety of machines, even if they had different floating-point architectures. So the question naturally arose: How can one test floating-point hardware in a way that does not depend on its specific architecture?

They came up with a very clever idea: Build a universal model of floating-point arithmetic, and then determine how closely a particular machine followed the model. That is, the model was designed in a way that made it possible to say "This machine follows the model up to a precision of 24 bits within a particular exponent range."

I have to say that when I first heard about this idea, I was skptical. Surely the people who built these computers had already tested the hardware! However, my skepticism vanished when they ran their test program on every computer they could get their hands on, and found that all but two of them had serious errors in their floating-point implementations.

How serious? One of the ones I remember was a machine on which 2^256 (i.e. 2 to the 256th power--a very large number) added to 2^-256 (a very tiny number) would yield zero. Most others were less serious. Typically the last few bits of a result were incorrectly rounded, and were sometimes garbage.

Still, it was sobering to think of the kinds of applications that were being run on machines that did not do fundamental arithmetic operations properly.

Posted by Andrew Koenig at 02:51 PM  Permalink




 
INFO-LINK