You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Andreas Jaeger 0a591acd0e 2000-04-30 Bruno Haible <haible@clisp.cons.org> 26 years ago
..
bits Update. 26 years ago
machine Update. 27 years ago
.cvsignore Tue May 14 14:07:10 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> 30 years ago
Makefile 2000-04-30 Bruno Haible <haible@clisp.cons.org> 26 years ago
README.libm-test Update. 27 years ago
Versions Update. 26 years ago
atest-exp.c Update. 28 years ago
atest-exp2.c Update. 28 years ago
atest-sincos.c Update. 28 years ago
basic-test.c Update. 27 years ago
cabs.c Update. 28 years ago
cabsf.c Update. 28 years ago
cabsl.c Update. 28 years ago
carg.c Update. 29 years ago
cargf.c Update. 29 years ago
cargl.c Update. 29 years ago
cimag.c Update. 28 years ago
cimagf.c Update. 28 years ago
cimagl.c Update. 28 years ago
complex.h Update. 27 years ago
conj.c Update. 28 years ago
conjf.c Update. 28 years ago
conjl.c Update. 28 years ago
creal.c Update. 28 years ago
crealf.c Update. 28 years ago
creall.c Update. 28 years ago
fenv.h Update. 27 years ago
gen-libm-test.pl Update. 27 years ago
ieee-math.c * hurd/hurdinit.c (map0): Remove [!PIC] conditional. 30 years ago
libm-test.inc Update. 27 years ago
math.h Update. 27 years ago
math_private.h Update. 27 years ago
test-double.c Update. 27 years ago
test-fenv.c Update. 26 years ago
test-float.c Update. 27 years ago
test-idouble.c Update. 27 years ago
test-ifloat.c Update. 27 years ago
test-ildoubl.c Update. 27 years ago
test-ldouble.c Update. 27 years ago
test-matherr.c Update. 29 years ago
test-misc.c Update. 27 years ago
tgmath.h Update. 27 years ago
w_acos.c Update. 27 years ago
w_acosf.c Update. 27 years ago
w_acosh.c Update. 27 years ago
w_acoshf.c Update. 27 years ago
w_acoshl.c Update. 27 years ago
w_acosl.c Update. 27 years ago
w_asin.c Update. 27 years ago
w_asinf.c Update. 27 years ago
w_asinl.c Update. 27 years ago
w_atan2.c Update. 27 years ago
w_atan2f.c Update. 27 years ago
w_atan2l.c Update. 27 years ago
w_atanh.c Update. 27 years ago
w_atanhf.c Update. 27 years ago
w_atanhl.c Update. 27 years ago
w_cosh.c Update. 27 years ago
w_coshf.c Update. 27 years ago
w_coshl.c Update. 27 years ago
w_drem.c Update. 27 years ago
w_dremf.c Update. 27 years ago
w_dreml.c Update. 27 years ago
w_exp2.c Update. 27 years ago
w_exp2f.c Update. 27 years ago
w_exp2l.c Update. 27 years ago
w_exp10.c Update. 27 years ago
w_exp10f.c Update. 27 years ago
w_exp10l.c Update. 27 years ago
w_fmod.c Update. 27 years ago
w_fmodf.c Update. 27 years ago
w_fmodl.c Update. 27 years ago
w_hypot.c Update. 27 years ago
w_hypotf.c Update. 27 years ago
w_hypotl.c Update. 27 years ago
w_j0.c Update. 27 years ago
w_j0f.c Update. 27 years ago
w_j0l.c Update. 27 years ago
w_j1.c Update. 27 years ago
w_j1f.c Update. 27 years ago
w_j1l.c Update. 27 years ago
w_jn.c Update. 27 years ago
w_jnf.c Update. 27 years ago
w_jnl.c Update. 27 years ago
w_lgamma.c Update. 27 years ago
w_lgamma_r.c Update. 27 years ago
w_lgammaf.c Update. 27 years ago
w_lgammaf_r.c Update. 27 years ago
w_lgammal.c Update. 27 years ago
w_lgammal_r.c Update. 27 years ago
w_log.c Update. 27 years ago
w_log10.c Update. 27 years ago
w_log10f.c Update. 27 years ago
w_log10l.c Update. 27 years ago
w_logf.c Update. 27 years ago
w_logl.c Update. 27 years ago
w_pow.c Update. 27 years ago
w_powf.c Update. 27 years ago
w_powl.c Update. 27 years ago
w_remainder.c Update. 27 years ago
w_remainderf.c Update. 27 years ago
w_remainderl.c Update. 27 years ago
w_scalb.c Update. 27 years ago
w_scalbf.c Update. 27 years ago
w_scalbl.c Update. 27 years ago
w_sinh.c Update. 27 years ago
w_sinhf.c Update. 27 years ago
w_sinhl.c Update. 27 years ago
w_sqrtl.c Update. 27 years ago
w_tgamma.c Update. 27 years ago
w_tgammaf.c Update. 27 years ago
w_tgammal.c Update. 27 years ago

README.libm-test

README for libm-test math test suite
====================================

The libm-test math test suite tests a number of function points of
math functions in the GNU C library. The following sections contain a
brief overview. Please note that the test drivers and the Perl script
"gen-libm-test.pl" have some options. A full list of options is
available with --help (for the test drivers) and -h for
"gen-libm-test.pl".


What is tested?
===============
The tests just evaluate the functions at specified points and compare
the results with precomputed values and the requirements of the ISO
C99 standard.

Besides testing the special values mandated by IEEE 754 (infinities,
NaNs and minus zero), some more or less random values are tested.

Files that are part of libm-test
================================

The main file is "libm-test.inc". It is platform and floating point
format independent. The file must be preprocessed by the Perl script
"gen-libm-test.pl". The results are "libm-test.c" and a file
"libm-test-ulps.h" with platform specific deltas.

The test drivers test-double.c, test-float.c, test-ldouble.c test the
normal double, float and long double implementation of libm. The test
drivers with an i in it (test-idouble.c, test-ifloat.c,
test-ildoubl.c) test the corresponding inline functions (where
available - otherwise they also test the real functions in libm).

"gen-libm-test.pl" needs a platform specific files with ULPs (Units of
Last Precision). The file is called "libm-test-ulps" and lives in
platform specific sysdep directory.

How can I generate "libm-test-ulps"?
====================================

The test drivers have an option "-u" to output an unsorted list of all
epsilons that the functions have. The output can be read in directly
but it's better to pretty print it first. "gen-libm-test.pl" has an option
to generate a pretty-printed and sorted new ULPs file from the output
of the test drivers.

To generate a new "libm-test-ulps" file, you can execute for example:
test-double -u --ignore-max-ulp=yes
This generates a file "ULPs" with all double ULPs in it, ignoring any
previous calculated ULPs.
Now move this away, e.g. "mv ULPs allULPs" and generate the ULPs
for all other formats and concat all ULP files together (e.g. "cat
ULPs >> allULPs"). As final step run "gen-libm-test.pl" with the file
as input and ask to generate a pretty printed output in the file "NewUlps":
gen-libm-test.pl -u allULPs -n

Now you can rename "NewUlps" to "libm-test-ulps" and move it into
sysdeps.

Contents of libm-test-ulps
==========================
Since libm-test-ulps can be generated automatically, just a few
notes. The file contains lines for single tests, like:
Test "cos (pi/2) == 0":
float: 1

and lines for maximal errors of single functions, like:
Function "yn":
idouble: 6.0000

The keywords are float, ifloat, double, idouble, ldouble and ildouble
(the prefix i stands for inline). You can also specify known
failures, e.g.:

Test "cos (pi/2) == 0":
float: 1
float: fail

Adding tests to libm-test.inc
=============================

The tests are evaluated by a set of special test macros. The macros
start with "TEST_" followed by a specification the input values, an
underscore and a specification of the output values. As an example,
the test macro for a function with input of type FLOAT (FLOAT is
either float, double, long double) and output of type FLOAT is
"TEST_f_f". The macro's parameter are the name of the function, the
input parameter, output parameter and optionally one exception
parameter.

The accepted parameter types are:
- "f" for FLOAT
- "b" for boolean - just tests if the output parameter evaluates to 0
or 1 (only for output).
- "c" for complex. This parameter needs two values, first the real,
then the imaginary part.
- "i" for int.
- "l" for long int.
- "L" for long long int.
- "F" for the address of a FLOAT (only as input parameter)
- "I" for the address of an int (only as input parameter)

Some functions need special handling. For example gamma sets the
global variable signgam and frexp takes an argument to &int. This
special treatment is coded in "gen-libm-test.pl" and used while
parsing "libm-test.inc".