IRIS 3000 floating-point

John D. McCalpin mccalpin at MASIG1.OCEAN.FSU.EDU
Sat Apr 23 04:08:39 AEST 1988


I found a set of floating-point tests by a Richard Karpinsky of UC/San Fran
on the netlib server at Argonne.  I ran them on my IRIS 3030 and got the 
following results:


 A  Paranoid  Program  to  Diagnose  Floating-point Arithmetic
          ... Single-Precision Version  ...

 Please send suggestions and interesting results to
         Richard Karpinski
         Computer Center U-76
         University of California
         San Francisco, CA 94143-0704
         USA

 In doing so, please include the following information:
         Precision:   Single;
         Version: 31 July 1986;
         Computer:   Silicon Graphics IRIS 3030
         Compiler: Silicon Valley Software f77 version 2.5
         Optimization level: default
         Other relevant compiler options: -fZ   (Weitek fpa)

 Running this program should reveal these characteristics:

 b = radix ( 1, 2, 4, 8, 10, 16, 100, 256, or ... ) .
 p = precision, the number of significant  b-digits carried.
 u2 = b/b^p = one ulp (unit in the last place) of 1.000xxx..
 u1 = 1/b^p = one ulp of numbers a little less than 1.0.
 g1, g2, g3 tell whether adequate guard digits are carried;
 1 = yes, 0 = no;  g1 for mult.,  g2 for div., g3 for subt.
 r1,r2,r3,r4  tell whether arithmetic is rounded or chopped;
 0=chopped, 1=correctly rounded, -1=some other rounding;
 r1 for mult., r2 for div., r3 for add/subt., r4 for sqrt.
 s=1 when a sticky bit is used correctly in rounding; else s=0.
 u0 = an underflow threshold.
 e0 and z0 tell whether underflow is abrupt, gradual or fuzzy
 v = an overflow threshold, roughly.
 v0  tells, roughly, whether  infinity  is represented.
 Comparisons are checked for consistency with subtraction
        and for contamination by pseudo-zeros.
 Sqrt is tested. so is  y^x  for (mostly) integers  x .
 Extra-precise subexpressions are revealed but not yet tested.
 Decimal-binary conversion is not yet tested for accuracy.

 The program attempts to discriminate among:
     >FLAWs, like lack of a sticky bit, 
     >SERIOUS DEFECTs, like lack of a guard digit, and
     >FAILUREs, like  2+2 = 5 .
 Failures may confound subsequent diagnoses.

 The diagnostic capabilities of this program go beyond an
 earlier program called  "Machar", which can be found at the
 end of the book "Software Manual for the Elementary Functions"
 (1980) by W. J. Cody and W. Waite. Although both programs
 try to discover the radix (b), precision (p) and         
 range (over/underflow thresholds) of the arithmetic, this
 program tries to cope with a wider variety of pathologies
 and to say how well the arithmetic is implemented.
 The program is based upon a conventional radix
 representation for floating-point numbers,
 but also allows for logarithmic encoding (b = 1)
 as used by certain early wang machines.

 Program is now RUNNING tests on small integers:
 -1, 0, 1/2 , 1, 2, 3, 4, 5, 9, 27, 32 & 240 are O.K.

 Searching for radix and precision...
 Radix =   2.
 Closest relative separation found is   5.96046400E-08
 Recalculating radix and precision 
 confirms closest relative separation .
 Radix confirmed.
 The number of significant digits of radix   2. is  24.00
 Test for extra-precise subexpressions:
 Subexpressions do not appear to be calculated
  with extra precision.

 Subtraction appears to be normalized as it should.
 Checking for guard digits in multiply divide and subtract.
 These operations appear to have guard digits as they should.

 Checking for rounding in multiply, divide and add/subtract:
 Multiplication appears to be correctly rounded.
 Division is neither chopped nor correctly rounded.
 Add/subtract appears to be correctly rounded.
 Sticky bit used incorrectly or not at all.
 FLAW: lack(s) of guard digits or failure(s) to correctly round or chop
 (noted above) count as one flaw in the final tally below.

 Does multiplication commute? Testing if  x*y = y*x  for  20 random pairs:
 No failure found in   20 randomly chosen pairs.

 Running tests of square root...
 Testing if  sqrt(x*x)  =  x  for    20 integers  x.
 Found no discrepancies.
 Sqrt has passed a test for monotonicity.
 Testing whether  sqrt  is rounded or chopped:
 Square root is neither chopped nor correctly rounded.
 Observed errors run from    -.6050455E+00  to     .5000000E+00 ulps.

 Testing powers  z^i  for small integers  z  and  i :
 Start with 0.**0 .
 No discrepancies found.

 Seeking underflow threshold and min positive number:
 Smallest strictly positive number found is  minpos  =  1.17549400E-38
 Since comparison denies   MINPOS  = 0,
  evaluating  ( MINPOS  +  MINPOS ) /  MINPOS   should be safe;
 what the machine gets for  ( MINPOS  +  MINPOS ) /  MINPOS   is
             .2000000E+01
 This is O.K. provided over/underflow has not just been signaled.
 DEFECT:  what prints as   MINPOS  =   .11754940E-37 compares different from
            MINPOS /1 =    .00000000E+00

 FLAW:  x =   .32326090E-37 is unequal to  z =   .23509890E-37 ,
 yet  x-z  yields    .0000000E+00
 Should this not signal underflow, this is a SERIOUS
 DEFECT that causes confusion when innocent statements like
 if (x.eq.z) then ... else ... ( f(x)-f(z) )/(x-z) ...
 encounter division by zero although actually  x/z = 1 +    .37500000E+00
 The  underflow threshold is    .23509890E-37 , below which
 calculation may suffer larger relative error than merely roundoff.

 since underflow occurs below the threshold  =
          (  2.00000000E+00)^( -1.25000000E+02) ,
 only underflow should afflict the expression
          (  2.00000000E+00)^( -2.50000000E+02) ;
 actually calculating it yields   
   -.64000400E+02
 SERIOUS
 DEFECT: this is not between 0 and  underflow threshold=   .23509890E-37
 Testing  x^((x+1)/(x-1)) vs. exp(2) =    .73890560E+01  as  x-> 1.
 Accuracy seems adequate.
 Testing powers  z^q  at four nearly extreme values:
 No discrepancies found.

 Searching for overflow threshold:
 Can " z = -y " overflow?  trying it on  y = ----------------
 Seems O.K.
 Overflow threshold is  v =   3.40282400E+38
 Overflow saturates at  sat = ++++++++++++++++
 No overflow should be signaled for  v*1 = 
                                             3.40282400E+38
                            nor for  v/1 = 
                                             3.40282400E+38
 Any overflow signal separating this  *  from one above is a DEFECT.
 DEFECT:  comparison alleges that what prints as  z = ++++++++++++++++
                 is too far from  sqrt(z)^2 =    .34028230E+39.

 FLAW: unbalanced range;  UFLTHR * V  =   .80000E+01 IS TOO FAR FROM 1.
 FAILURE:  x/x differs from 1 when x =    .34028E+39
           instead,  x/x - 1/2 - 1/2 =   -.10000E+01

 What messages and/or values does division by zero produce?
 About to compute 1/0...
 Trying to compute  1/0  produces   0.0000000E+00
 About to compute 0/0...
 Trying to compute  0/0  produces   0.0000000E+00

 The number of  FAILUREs  encountered =          1
 The number of  SERIOUS DEFECTs  discovered =    1
 The number of  DEFECTs  discovered =            2
 The number of  FLAWs  discovered =              3
 The arithmetic diagnosed has unacceptable Serious Defects.
 Potentially fatal FAILURE may have spoiled this program's subsequent diagnoses.
 End of Test.



More information about the Comp.sys.sgi mailing list