"ucbtest" mul/div available for external testing

David G. Hough at validgh dgh
Thu Dec 1 22:21:55 PST 1994


This is the readme:







This version of ucbtest is provided under non-disclosure, for testing
purposes, to individual members of numeric-interestavalidgh.com.  Please
indicate your willingness to respect the non-disclosure when requesting
ucbtest from dghavalidgh.com, and do not distribute it further or report
results except to numeric-interestavalidgh.com or dghavalidgh.com.  After
external testing has turned up any small avoidable problems, it will be posted
on comp.arch.arithmetic with this copyright notice:
/*
 * ====================================================
 * Copyright (C) 1988-94 by Sun Microsystems, Inc. All rights reserved.
 *
 * Developed at SunPro, a Sun Microsystems, Inc. business.
 * Permission to use, copy, modify, and distribute this
 * software is freely granted, provided that this notice
 * is preserved.
 * ====================================================
 */

     UCBTEST is a suite of programs for testing certain difficult test cases
of IEEE 754 floating-point arithmetic.  The difficult test cases are obtained
from number-theoretic algorithms developed by Turing Award winner Prof. W.
Kahan, Department of Electrical Engineeering and Computer Science, University
of California, Berkeley, as part of ongoing research into test methods for
computer arithmetic.  After Prof. Kahan presented a Floating-Point Indoctrina-
tion lecture series at Sun Microsystems in 1988, some lecture attendees and
former graduate students of Prof. Kahan wrote these test programs.

     Two sample sh scripts, sun.sh for SPARC and x86.sh for PC's, are provided
that compile and run all the programs, for all three floating-point types
float, double, and long double, first with 1000 test points, then with 10,000,
etc., until a failure occurs or the user, patience exhausted, terminates the
script with ^C.  The test programs are designed to terminate with non-zero
exit status in case they find an error.  Approximately 20 minutes are required
on a 60MHz Pentium for the x86.sh script to locate an instance of the infamous
FDIV bug, although it can be seen in less than a minute by compiling
ucbdivtest with -DNTESTS=1000000 -DFLOAT etc.

     ucbmultest and ucbdivtest have been designed to run on SPARCstations run-
ning SunOS 4 or SunOS 5, and on x86 PC's running on SunOS 5.   ucbdivtest may
be ported to other RISC/Unix systems with little difficulty.   Systems with
extended precision, non-Unix systems, and ucbmultest require more effort to
provide the equivalents of the Sun functions ieee flags, nextafter, scalbn,
etc.

     Some compile-time flags used in the porting process to Sun include:

-DNTESTS        number of test cases to try
-DDEBUG         turn out debugging output
-DFLOAT         test C float type
-DDOUBLE        test C double type
-DLONGDOUBLE    test C long double type
-DPROTOTYPED    ANSI-C compiler, so use function prototypes - important
                for float and long double
-DSUN IEEE      ieee flags, ieee retrospective available
-DSUN MATH      sunmath.h and libsunmath.a are available
-DSUN RINTF     rintf function is available


     Often these programs appear to fail due to misapplication rather than
incorrect hardware or libraries.  Common causes include:

precision
     On extended-precision systems such as x86 and 68k, the extended-precision
     precision control must be set to the precision of the type of floating-
     point variable being tested.  On Sun systems,
     ieee flags("set","precision",...) is useful.

prototypes
     Traditional C and ANSI-C differ in their treatment of float function
     arguments and function results.   It may be necessary to declare addi-
     tional function prototypes to avoid problems.

optimizers
     Optimizing compilers that allocate variables to extended-precision regis-
     ters and fail to round them to storage precision even in response to
     source-code assignments may cause problems.   Certain variables have been
     declared "volatile" in hope of avoiding those problems.

     Minor work yet to be done:

*    Consolidation of the failure printing functions from ucb???test.c to
     ucbtest.c.

*    General cleanup and reconciliation of comments with source code.

     Please report bugs and portability enhancements for other systems to
David Hough, dghavalidgh.com.  Organizations interested in funding major
further work in the computer arithmetic testing and verification should con-
tact Prof. Kahan.  For instance, the present programs test neither exception
handling nor IEEE rounding modes other than the default to nearest.  In this
regard, the Pentium bug may cost Intel more money than the entire cumulative
budget of the UCB EECS department since its founding.




More information about the Numeric-interest mailing list