From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, LOTS_OF_MONEY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d901a50a5adfec3c X-Google-Attributes: gid103376,public X-Google-Thread: 1094ba,9f0bf354542633fd X-Google-Attributes: gid1094ba,public From: Mark A Biggar Subject: Re: Fortran or Ada? Date: 1998/10/06 Message-ID: <361A98CB.444AD094@lmco.com>#1/1 X-Deja-AN: 398426472 Content-Transfer-Encoding: 7bit References: <3617AA49.340A5899@icon.fi> <6v9s4t$egn$1@ys.ifremer.fr> <3618dc33.0@news.passport.ca> <6vbhhc$5kj$1@nnrp1.dejanews.com> <6vdfq4$p1$1@nnrp1.dejanews.com> <6vdnqe$3nu@bgtnsc02.worldnet.att.net> Content-Type: text/plain; charset=us-ascii Organization: Lockheed Martin Western Development Labs Mime-Version: 1.0 Newsgroups: comp.lang.fortran,comp.lang.ada Date: 1998-10-06T00:00:00+00:00 List-Id: James Giles wrote: > dewarr@my-dejanews.com wrote in message <6vdfq4$p1$1@nnrp1.dejanews.com>... > >In article , > > "Ian St. John" wrote: > >> Testing by itself can never guarantee correct code. The testing is just to > >> determine syntax errors, oversights, etc. > >That's a bit strong, there are definitely cases where testing can be > >exhaustive, e.g. in checking out a sqrt routine for IEEE short form > >arithmetic. Indeed it is almost practical to do exhaustive testing on > >long format division (which would have saved Intel many millions of > >dollars :-) > There are 2^128 different possible divide operations (each operand > having 2^64 different possible values) - and that's assuming that you > don't have to test each pair of operands for each possible value of > the exponent and sign (in which case there are nearly 2^160 different > operand pairs - each operand having 2^80 different values). Now, > assuming that a Pentium class machine can test 100 million operations > per second (an overestimate to say the least), it would take over 10^30 > seconds to test all 2^128 divides. This still assumes you have an > independent source of the correct answer for each divide to test > against! Running, say, 1000 machines in parallel, each testing different > divides, would reduce the time needed to "just" 10^27 seconds. A > year has on the order of 3*10^7 seconds. You don't actuall actually have to test all 2^128 cases to be "exhaustive". First off you can factor the handling of exponents from that of mantissa's. In addition, the pentium algorithm is a base 4 division method, it works two bits at a time and uses some ROM table look-ups for partial results. The errors were in those tables, not the algorithm. A set of test cases that ran through all possible exponents combinations, and a sufficient set of mantissa's such that every table entry was use at least once would have found the pentium bug. Someone later said that such a test set could have been run in less than 10 minutes. -- Mark Biggar mark.a.biggar@lmco.com