correctly-rounded elementary transcendental function test programs

David Hough dgh
Wed Jan 10 09:36:56 PST 1990


It doesn't do any good to have correctly-rounded elementary transcendental
functions if you can't demonstrate the correctly-roundedness.
This means you need test programs first.

I have been through this cycle before.  I couldn't think of any test
programs for correctly-rounded base conversion that worked indirectly
(testing identities for instance, as in Cody's elefunt) that would
be very conclusive.  So I decided that the test program had to
do a correctly-rounded base conversion and compare that to what
the programs under test did.  It turned out to be simpler than
that - I could get along with just multiple-precision multiplication
and without multiple-precision division or any tables - since all
I really needed was a scaled difference in ulps.  That simplification
probably won't be available for transcendental functions.

So the heart of the test program has to be implementations of correctly-rounded
transcendental test functions that can produce results with error bounds
as small as needed, implying variable precision at run time.  You can have
some confidence in this kind of test program as long as its algorithms
are so inefficient that none of the functions under test would ever use
them, so that you can be sure of comparing two completely different algorithms.

In particular, Brent's MP (multiple precision, not multiple processor!)
algorithms could probably be adapted.  As far as
I know, they use compute to arbitrary precision using series expansions 
rather than tables and rational
approximations and so are unlikely to have the same errors as codes
intended to be as fast as possible.  I don't know how much effort would
be required to get hard error bounds on the results.  Interval arithmetic
may figure in, one way or another.

Liu's elementary function test programs work in finite precision and so
have errors that make them inapplicable for distinguishing correct
rounding from nearly correct.  I don't know if they can be adapted
to arbitrary precision.

As for the ultimate efficiency of correctly-rounded functions, I think
single precision will be easy and the one-argument functions can be
exhaustively tested.  But I don't know if I would want to pay the
price for correctly-rounded quadruple-precision pow(x,y) even if you
gave me the code for free.  That's why I think there will be
academic interest in aspects of this project.




More information about the Numeric-interest mailing list