glibc/math
Ulrich Drepper bcf01e6d80 Optimize exp
Add __exp*_finite optimizations and rewrite some wrappers.
2011-10-15 20:22:59 -04:00
..
bits Optimize exp 2011-10-15 20:22:59 -04:00
machine
atest-exp2.c
atest-exp.c
atest-sincos.c
basic-test.c
bug-nextafter.c
bug-nexttoward.c
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 Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
e_acoshl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_acosl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_asinl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_atan2l.c Optimize libm 2011-10-12 11:27:51 -04:00
e_atanhl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_coshl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_exp2l.c Optimize libm 2011-10-12 11:27:51 -04:00
e_exp10.c Optimize libm 2011-10-12 11:27:51 -04:00
e_exp10f.c Optimize libm 2011-10-12 11:27:51 -04:00
e_exp10l.c Optimize libm 2011-10-12 11:27:51 -04:00
e_expl.c Optimize exp 2011-10-15 20:22:59 -04:00
e_fmodl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_gammal_r.c Optimize libm 2011-10-12 11:27:51 -04:00
e_hypotl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_j0l.c Optimize libm 2011-10-12 11:27:51 -04:00
e_j1l.c Optimize libm 2011-10-12 11:27:51 -04:00
e_jnl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_lgammal_r.c Optimize libm 2011-10-12 11:27:51 -04:00
e_log2l.c Optimize libm 2011-10-12 11:27:51 -04:00
e_log10l.c Optimize libm 2011-10-12 11:27:51 -04:00
e_logl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_powl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_rem_pio2l.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
e_scalb.c Optimize libm 2011-10-12 11:27:51 -04:00
e_scalbf.c Optimize libm 2011-10-12 11:27:51 -04:00
e_scalbl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_sinhl.c Optimize libm 2011-10-12 11:27:51 -04:00
e_sqrtl.c Optimize libm 2011-10-12 11:27:51 -04:00
fclrexcpt.c
fedisblxcpt.c
feenablxcpt.c
fegetenv.c Avoid PLT call to fegetenv on s390 2010-02-09 22:34:17 -08:00
fegetexcept.c
fegetround.c
feholdexcpt.c
fenv.h
fesetenv.c
fesetround.c
feupdateenv.c Correct implementation of fmaf. 2010-10-11 09:27:05 -04:00
fgetexcptflg.c
fpu_control.c
fraiseexcpt.c
fsetexcptflg.c
ftestexcept.c Correct implementation of fmaf. 2010-10-11 09:27:05 -04:00
gen-libm-test.pl
ieee-math.c
k_cosl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
k_rem_pio2l.c
k_sincosl.c
k_sinl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
k_tanl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
libm-test.inc Fix remainder (NaN, 0) 2011-10-07 15:14:06 -04:00
Makefile Optimize libm 2011-10-12 11:27:51 -04:00
math_private.h Optimize libm 2011-10-12 11:27:51 -04:00
math.h Optimize libm 2011-10-12 11:27:51 -04:00
multc3.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
README.libm-test
s_asinhl.c
s_atanl.c
s_cacos.c
s_cacosf.c
s_cacosh.c
s_cacoshf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_cacoshl.c
s_cacosl.c
s_casin.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_casinf.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_casinh.c
s_casinhf.c
s_casinhl.c
s_casinl.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_catan.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_catanf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_catanh.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_catanhf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_catanhl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_catanl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_cbrtl.c
s_ccos.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_ccosf.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_ccosh.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_ccoshf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_ccoshl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_ccosl.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_cexp.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_cexpf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_cexpl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_clog10.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_clog10f.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_clog10l.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_clog.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_clogf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_clogl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_cpow.c
s_cpowf.c
s_cpowl.c
s_cproj.c Fix whitespaces. 2010-04-08 16:09:15 -07:00
s_cprojf.c Fix cproj implmentation. 2010-04-08 15:32:51 -07:00
s_cprojl.c Fix cproj implmentation. 2010-04-08 15:32:51 -07:00
s_csin.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_csinf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_csinh.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_csinhf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_csinhl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_csinl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_csqrt.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_csqrtf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_csqrtl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_ctan.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_ctanf.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_ctanh.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_ctanhf.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_ctanhl.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_ctanl.c Optimize use of isnan, isinf, finite 2011-10-08 10:18:26 -04:00
s_erfl.c
s_expm1l.c
s_fdim.c Fix overflow handling in fdim. 2009-08-24 12:06:55 -07:00
s_fdimf.c Fix overflow handling in fdim. 2009-08-24 12:06:55 -07:00
s_fdiml.c Fix generic fdiml. 2009-08-25 15:48:06 -07:00
s_fma.c Add support for x86-64 fma instruction. 2009-07-29 15:26:06 -07:00
s_fmaf.c Add support for x86-64 fma instruction. 2009-07-29 15:26:06 -07:00
s_fmal.c
s_fmax.c
s_fmaxf.c
s_fmaxl.c
s_fmin.c
s_fminf.c
s_fminl.c
s_ldexp.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_ldexpf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_ldexpl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_log1pl.c
s_nan.c
s_nanf.c
s_nanl.c
s_nextafter.c
s_nexttowardf.c
s_nexttowardl.c
s_significand.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_significandf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_significandl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
s_tanhl.c
setfpucw.c
t_sincosl.c
test-double.c
test-fenv.c
test-float.c
test-fpucw.c
test-idouble.c
test-ifloat.c
test-ildoubl.c
test-ldouble.c
test-matherr.c
test-misc.c
test-powl.c Fix whitespace 2011-05-18 19:52:42 -04:00
test-tgmath2.c
test-tgmath-int.c
test-tgmath-ret.c
test-tgmath.c
tgmath.h 2008-10-24 Joseph Myers <joseph@codesourcery.com> 2008-11-01 02:28:57 +00:00
tst-definitions.c
Versions Optimize exp 2011-10-15 20:22:59 -04:00
w_acos.c Optimize libm 2011-10-12 11:27:51 -04:00
w_acosf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_acosh.c Optimize libm 2011-10-12 11:27:51 -04:00
w_acoshf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_acoshl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_acosl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_asin.c Optimize libm 2011-10-12 11:27:51 -04:00
w_asinf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_asinl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_atan2.c Optimize libm 2011-10-12 11:27:51 -04:00
w_atan2f.c Optimize libm 2011-10-12 11:27:51 -04:00
w_atan2l.c Optimize libm 2011-10-12 11:27:51 -04:00
w_atanh.c Optimize libm 2011-10-12 11:27:51 -04:00
w_atanhf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_atanhl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_cosh.c Optimize libm 2011-10-12 11:27:51 -04:00
w_coshf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_coshl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_drem.c
w_dremf.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
w_dreml.c
w_exp2.c Optimize libm 2011-10-12 11:27:51 -04:00
w_exp2f.c Optimize libm 2011-10-12 11:27:51 -04:00
w_exp2l.c Optimize libm 2011-10-12 11:27:51 -04:00
w_exp10.c Optimize libm 2011-10-12 11:27:51 -04:00
w_exp10f.c Optimize libm 2011-10-12 11:27:51 -04:00
w_exp10l.c Optimize libm 2011-10-12 11:27:51 -04:00
w_expl.c
w_fmod.c Optimize libm 2011-10-12 11:27:51 -04:00
w_fmodf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_fmodl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_hypot.c Optimize libm 2011-10-12 11:27:51 -04:00
w_hypotf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_hypotl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_j0.c Optimize libm 2011-10-12 11:27:51 -04:00
w_j0f.c Optimize libm 2011-10-12 11:27:51 -04:00
w_j0l.c Optimize libm 2011-10-12 11:27:51 -04:00
w_j1.c Optimize libm 2011-10-12 11:27:51 -04:00
w_j1f.c Optimize libm 2011-10-12 11:27:51 -04:00
w_j1l.c Optimize libm 2011-10-12 11:27:51 -04:00
w_jn.c Optimize libm 2011-10-12 11:27:51 -04:00
w_jnf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_jnl.c Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
w_lgamma_r.c Optimize libm 2011-10-12 11:27:51 -04:00
w_lgamma.c Optimize libm 2011-10-12 11:27:51 -04:00
w_lgammaf_r.c Optimize libm 2011-10-12 11:27:51 -04:00
w_lgammaf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_lgammal_r.c Optimize libm 2011-10-12 11:27:51 -04:00
w_lgammal.c Optimize libm 2011-10-12 11:27:51 -04:00
w_log2.c Optimize libm 2011-10-12 11:27:51 -04:00
w_log2f.c Optimize libm 2011-10-12 11:27:51 -04:00
w_log2l.c Optimize libm 2011-10-12 11:27:51 -04:00
w_log10.c Optimize libm 2011-10-12 11:27:51 -04:00
w_log10f.c Optimize libm 2011-10-12 11:27:51 -04:00
w_log10l.c Optimize libm 2011-10-12 11:27:51 -04:00
w_log.c Optimize libm 2011-10-12 11:27:51 -04:00
w_logf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_logl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_pow.c Optimize libm 2011-10-12 11:27:51 -04:00
w_powf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_powl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_remainder.c Optimize libm 2011-10-12 11:27:51 -04:00
w_remainderf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_remainderl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_scalb.c Optimize libm 2011-10-12 11:27:51 -04:00
w_scalbf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_scalbl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_sinh.c Optimize libm 2011-10-12 11:27:51 -04:00
w_sinhf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_sinhl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_sqrt.c Optimize libm 2011-10-12 11:27:51 -04:00
w_sqrtf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_sqrtl.c Optimize libm 2011-10-12 11:27:51 -04:00
w_tgamma.c Optimize libm 2011-10-12 11:27:51 -04:00
w_tgammaf.c Optimize libm 2011-10-12 11:27:51 -04:00
w_tgammal.c Optimize libm 2011-10-12 11:27:51 -04: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".