glibc/math
2012-11-28 13:40:54 +00:00
..
bits Don't use long double *_finite functions if no long double math 2012-04-28 22:21:53 +02:00
machine
atest-exp2.c
atest-exp.c
atest-sincos.c
basic-test.c
bug-nextafter.c math: support platforms with limited FP rounding or exception support 2012-05-17 08:50:41 -04:00
bug-nexttoward.c math: support platforms with limited FP rounding or exception support 2012-05-17 08:50:41 -04:00
bug-tgmath1.c
cabs.c
cabsf.c
cabsl.c
carg.c
cargf.c
cargl.c
cimag.c
cimagf.c
cimagl.c
complex.h
conj.c
conjf.c
conjl.c
creal.c
crealf.c
creall.c
divtc3.c
e_acoshl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_acosl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_asinl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_atan2l.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_atanhl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_coshl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_exp2l.c Fix exp2l inaccuracy (bug 13824). 2012-03-22 12:55:19 +00:00
e_exp10.c Fix exp10 spurious overflows (bug 13924). 2012-04-30 09:37:01 +00:00
e_exp10f.c Fix exp10 spurious overflows (bug 13924). 2012-04-30 09:37:01 +00:00
e_exp10l.c Fix exp10 spurious overflows (bug 13924). 2012-04-30 09:37:01 +00:00
e_expl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_fmodl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_gammal_r.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_hypotl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_j0l.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_j1l.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_jnl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_lgammal_r.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_log2l.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_log10l.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_logl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_powl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_rem_pio2l.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_scalb.c
e_scalbf.c
e_scalbl.c
e_sinhl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
e_sqrtl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
fclrexcpt.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
fedisblxcpt.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
feenablxcpt.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
fegetenv.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
fegetexcept.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
fegetround.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
feholdexcpt.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
fenv.h
fesetenv.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
fesetround.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
feupdateenv.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
fgetexcptflg.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
fpu_control.c
fraiseexcpt.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
fsetexcptflg.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
ftestexcept.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
gen-libm-test.pl Make libm-test.inc test comparison macros. 2012-10-09 23:34:12 +00:00
ieee-math.c
k_cosl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
k_rem_pio2l.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
k_sincosl.c
k_sinl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
k_tanl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
libm-test.inc Fix powl inaccuracy for x86_64 and x86 (bug 13881). 2012-11-28 13:40:54 +00:00
Makefile Comment on slow compilation of math/test-tgmath2.c 2012-10-18 16:03:49 -04:00
math.h Make math.h FP_* macros usable in #if (bug 3439). 2012-11-02 22:11:21 +00:00
multc3.c
README.libm-test
s_asinhl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
s_atanl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
s_cacos.c
s_cacosf.c
s_cacosh.c
s_cacoshf.c
s_cacoshl.c
s_cacosl.c
s_casin.c
s_casinf.c
s_casinh.c
s_casinhf.c
s_casinhl.c
s_casinl.c
s_catan.c
s_catanf.c
s_catanh.c
s_catanhf.c
s_catanhl.c
s_catanl.c
s_cbrtl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
s_ccos.c
s_ccosf.c
s_ccosh.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_ccoshf.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_ccoshl.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_ccosl.c
s_cexp.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_cexpf.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_cexpl.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_clog10.c Fix inaccuracy of clog, clog10 near |z| = 1 (bug 13629). 2012-09-25 19:43:49 +00:00
s_clog10f.c Fix inaccuracy of clog, clog10 near |z| = 1 (bug 13629). 2012-09-25 19:43:49 +00:00
s_clog10l.c Fix inaccuracy of clog, clog10 near |z| = 1 (bug 13629). 2012-09-25 19:43:49 +00:00
s_clog.c Fix inaccuracy of clog, clog10 near |z| = 1 (bug 13629). 2012-09-25 19:43:49 +00:00
s_clogf.c Fix inaccuracy of clog, clog10 near |z| = 1 (bug 13629). 2012-09-25 19:43:49 +00:00
s_clogl.c Fix inaccuracy of clog, clog10 near |z| = 1 (bug 13629). 2012-09-25 19:43:49 +00:00
s_cpow.c
s_cpowf.c
s_cpowl.c
s_cproj.c
s_cprojf.c
s_cprojl.c
s_csin.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_csinf.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_csinh.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_csinhf.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_csinhl.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_csinl.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_csqrt.c Fix csqrt underflow (bugs 14157, 14331). 2012-07-05 11:02:13 +00:00
s_csqrtf.c Fix csqrt underflow (bugs 14157, 14331). 2012-07-05 11:02:13 +00:00
s_csqrtl.c Fix csqrt underflow (bugs 14157, 14331). 2012-07-05 11:02:13 +00:00
s_ctan.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_ctanf.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_ctanh.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_ctanhf.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_ctanhl.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_ctanl.c Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
s_erfl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
s_expm1l.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
s_fdim.c
s_fdimf.c
s_fdiml.c
s_fma.c
s_fmaf.c
s_fmal.c
s_fmax.c
s_fmaxf.c
s_fmaxl.c
s_fmin.c
s_fminf.c
s_fminl.c
s_ldexp.c
s_ldexpf.c
s_ldexpl.c
s_log1pl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
s_nan.c
s_nanf.c
s_nanl.c
s_nextafter.c
s_nexttowardf.c Fix nexttoward bugs (bugs 2550, 2570). 2012-05-01 15:37:43 +00:00
s_nexttowardl.c
s_significand.c
s_significandf.c
s_significandl.c
s_tanhl.c [BZ #157] Remove include/stub-tag.h for good. 2012-11-04 19:59:40 +01:00
setfpucw.c
t_sincosl.c
test-double.c
test-fenv.c math: support platforms with limited FP rounding or exception support 2012-05-17 08:50:41 -04:00
test-float.c
test-fpucw.c
test-idouble.c
test-ifloat.c
test-ildoubl.c
test-ldouble.c
test-matherr.c
test-misc.c math: support platforms with limited FP rounding or exception support 2012-05-17 08:50:41 -04:00
test-powl.c
test-tgmath2.c
test-tgmath-int.c
test-tgmath-ret.c
test-tgmath.c
tgmath.h
tst-CMPLX2.c
tst-CMPLX.c
tst-definitions.c
Versions
w_acos.c
w_acosf.c
w_acosh.c
w_acoshf.c
w_acoshl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_acosl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_asin.c
w_asinf.c
w_asinl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_atan2.c
w_atan2f.c
w_atan2l.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_atanh.c
w_atanhf.c
w_atanhl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_cosh.c
w_coshf.c
w_coshl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_drem.c
w_dremf.c
w_dreml.c
w_exp2.c Fix missing exp2 overflow exception (bug 13871). 2012-03-21 12:17:26 +00:00
w_exp2f.c Fix missing exp2 overflow exception (bug 13871). 2012-03-21 12:17:26 +00:00
w_exp2l.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_exp10.c
w_exp10f.c
w_exp10l.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_expl.c
w_fmod.c
w_fmodf.c
w_fmodl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_hypot.c
w_hypotf.c
w_hypotl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_ilogb.c Add missing includes. 2012-07-22 22:25:14 +02:00
w_ilogbf.c Add missing includes. 2012-07-22 22:25:14 +02:00
w_ilogbl.c Add missing includes. 2012-07-22 22:25:14 +02:00
w_j0.c Disable Bessel function TLOSS errors in POSIX mode. 2012-03-16 20:08:02 +00:00
w_j0f.c Disable Bessel function TLOSS errors in POSIX mode. 2012-03-16 20:08:02 +00:00
w_j0l.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_j1.c Disable Bessel function TLOSS errors in POSIX mode. 2012-03-16 20:08:02 +00:00
w_j1f.c Disable Bessel function TLOSS errors in POSIX mode. 2012-03-16 20:08:02 +00:00
w_j1l.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_jn.c Disable Bessel function TLOSS errors in POSIX mode. 2012-03-16 20:08:02 +00:00
w_jnf.c Disable Bessel function TLOSS errors in POSIX mode. 2012-03-16 20:08:02 +00:00
w_jnl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_lgamma_r.c
w_lgamma.c
w_lgammaf_r.c
w_lgammaf.c
w_lgammal_r.c
w_lgammal.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_log2.c
w_log2f.c
w_log2l.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_log10.c
w_log10f.c
w_log10l.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_log.c
w_logf.c
w_logl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_pow.c
w_powf.c
w_powl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_remainder.c
w_remainderf.c
w_remainderl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_scalb.c
w_scalbf.c
w_scalbl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_sinh.c
w_sinhf.c
w_sinhl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_sqrt.c
w_sqrtf.c
w_sqrtl.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
w_tgamma.c
w_tgammaf.c
w_tgammal.c Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00

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, first remove "ULPs" file in the
current directory, then 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 generate the ULPs for all other formats, the tests will be appending
the data to the "ULPs" file.  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 ULPs -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".