Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!uunet!mcsun!hp4nl!cwi.nl!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.arch Subject: Re: errors and error bounds in floating-point arithmetic Message-ID: <3613@charon.cwi.nl> Date: 31 May 91 00:27:55 GMT References: <391@validgh.com> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 39 A minor quible: In article <391@validgh.com> dgh@validgh.com (David G. Hough on validgh) writes: ... > "Accuracy benchmark" programs which attempt to measure the quality of computer > arithmetic by comparing computed results to the known correct answers are > common but not very interesting because they don't correspond to the much > more typical situation in which the correct answer is not known. > Not many people routinely spend most of their time solving problems whose > answers they already know. > Although you mention later down versions of Kahan's paranoia (in that it fails to recognize and analyze extended precision intermediate results), I would like to mention that the program still has many virtues. Similar for the Floating Point Validation suit from NAG. As long as architects do not understand the basics of floating point arithmetic we will have such anomalies as: 1. If a equals b it is not necessarily true that b equals a. 2. For some value v close to 1.0, 1.0/v = 0.0 (luckily the instruction where that comes from is not used on that machine). paranoia and FPV are able to detect such basic design flaws. Of course you should be aware that such programs can give you false alarms. And also of course, those programs are dependent on both hardware and compiler. I have some experience. Compiler writers are also in general completely unaware of the properties of floating point arithmetic. In Ada each floating point type has some attributes associated with it that tell you the properties of the arithmetic (e.g. what is tha machine radix, does overflow trap and so on). I have written a program that verifies those attributes (it will be published in a forthcoming issue of Ada Letters). Some time ago I observed that: 1. For every attribute there was a compiler that got it wrong. 2. For every compiler there was a wrong attribute. True at that time. Luckily things are improving. You can draw your own conclusion. -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl