glibc/math
Joseph Myers 5b0626b9c5 Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356).
This patch fixes bug 16356, bad results from x86 / x86_64 expl /
exp10l in directed rounding modes, the most serious of the bugs shown
up by my patch expanding libm test coverage.  When I fixed bug 16293,
I thought it was only necessary to set round-to-nearest when using
frndint in expm1 functions, because in other cases the cancellation
error from having the resulting fractional part close to 1 or -1 would
not be significant.  However, in expl and exp10l, the way the final
fractional part gets computed (something more complicated than a
simple subtraction, because more precision is needed than you'd get
that way) can result in a value outside the range [-1, 1] when the
argument to frndint was very close to an integer and was rounded the
"wrong" way because of the rounding mode - and the f2xm1 instruction
has undefined results if its argument is outside [-1, 1], so resulting
in the large errors seen.  So this patch removes the USE_AS_EXPM1L
conditionals on the round-to-nearest settings, so all of expl, expm1l
and exp10l now get round-to-nearest used for frndint (meaning the
final fractional part can at most be slightly above 0.5 in
magnitude).  Associated tests of exp and exp10 are added and testing
of exp10 in directed rounding modes enabled.

Tested x86_64 and x86 and ulps updated accordingly.

	* sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL): Also set
	round-to-nearest for [!USE_AS_EXPM1L].
	* sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL): Likewise.
	* math/auto-libm-test-in: Do not expect cosh tests to fail.  Add
	more tests of exp and exp10.  Expect some exp10 tests to miss
	exceptions or fail in directed rounding modes.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (exp10_tonearest_test_data): New array.
	(exp10_test_tonearest): New function.
	(exp10_towardzero_test_data): New array.
	(exp10_test_towardzero): New function.
	(exp10_downward_test_data): New array.
	(exp10_test_downward): New function.
	(exp10_upward_test_data): New array.
	(exp10_test_upward): New function.
	(main): Call the new functions.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
2013-12-21 13:07:16 +00:00
..
bits New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
machine
atest-exp2.c De-stringify constants in math/atest-exp2.c. 2013-05-16 06:34:01 -07:00
atest-exp.c Fix some testsuite build warning fixes in libm 2013-02-19 21:20:44 +05:30
atest-sincos.c Fix some testsuite build warning fixes in libm 2013-02-19 21:20:44 +05:30
auto-libm-test-in Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356). 2013-12-21 13:07:16 +00:00
auto-libm-test-out Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356). 2013-12-21 13:07:16 +00:00
basic-test.c math: Additional type conversion tests 2013-08-29 12:21:07 +02:00
bug-nextafter.c Make more libm tests condition exceptions tests with math-tests.h. 2013-06-12 12:41:25 +00:00
bug-nexttoward.c Make more libm tests condition exceptions tests with math-tests.h. 2013-06-12 12:41:25 +00:00
bug-tgmath1.c
cabs.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
cabsf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
cabsl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
carg.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
cargf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
cargl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
cimag.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
cimagf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
cimagl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
complex.h Don't disable CMPLXL macro for __NO_LONG_DOUBLE_MATH (bug 15488). 2013-05-18 12:12:38 +00:00
conj.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
conjf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
conjl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
creal.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
crealf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
creall.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
divtc3.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_acoshl.c
e_acosl.c
e_asinl.c
e_atan2l.c
e_atanhl.c
e_coshl.c
e_exp2l.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_exp10.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_exp10f.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_exp10l.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_expl.c
e_fmodl.c
e_gammal_r.c
e_hypotl.c
e_j0l.c
e_j1l.c
e_jnl.c
e_lgammal_r.c
e_log2l.c
e_log10l.c
e_logl.c
e_powl.c
e_rem_pio2l.c
e_scalb.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_scalbf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_scalbl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
e_sinhl.c
e_sqrtl.c
fclrexcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fedisblxcpt.c Avoid spurious failures from <fenv.h> fallback functions (bug 15654). 2013-06-20 19:10:44 +00:00
feenablxcpt.c Avoid spurious failures from <fenv.h> fallback functions (bug 15654). 2013-06-20 19:10:44 +00:00
fegetenv.c Avoid spurious failures from <fenv.h> fallback functions (bug 15654). 2013-06-20 19:10:44 +00:00
fegetexcept.c Avoid spurious failures from <fenv.h> fallback functions (bug 15654). 2013-06-20 19:10:44 +00:00
fegetround.c Fix dbl-64 e_sqrt.c for non-default rounding modes (bug 16271). 2013-11-28 16:50:38 +00:00
feholdexcpt.c Avoid spurious failures from <fenv.h> fallback functions (bug 15654). 2013-06-20 19:10:44 +00:00
fenv.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fesetenv.c Avoid spurious failures from <fenv.h> fallback functions (bug 15654). 2013-06-20 19:10:44 +00:00
fesetround.c Avoid spurious failures from <fenv.h> fallback functions (bug 15654). 2013-06-20 19:10:44 +00:00
feupdateenv.c Avoid spurious failures from <fenv.h> fallback functions (bug 15654). 2013-06-20 19:10:44 +00:00
fgetexcptflg.c Avoid spurious failures from <fenv.h> fallback functions (bug 15654). 2013-06-20 19:10:44 +00:00
fpu_control.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fraiseexcpt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
fsetexcptflg.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
ftestexcept.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
gen-auto-libm-tests.c Move tests of cpow from libm-test.inc to auto-libm-test-in. 2013-12-20 12:35:10 +00:00
gen-libm-test.pl Disable libm-test test name beautification for M_* constants. 2013-12-19 14:59:22 +00:00
ieee-math.c
k_casinh.c Fix casinh inaccuracy for imaginary part < 1.0, real part small (bug 10357). 2013-03-30 13:31:53 +00:00
k_casinhf.c Fix casinh inaccuracy for imaginary part < 1.0, real part small (bug 10357). 2013-03-30 13:31:53 +00:00
k_casinhl.c Fix casinh inaccuracy for imaginary part < 1.0, real part small (bug 10357). 2013-03-30 13:31:53 +00:00
k_cosl.c
k_rem_pio2l.c
k_sincosl.c
k_sinl.c
k_tanl.c
libm-test.inc Fix x86 / x86_64 expl / expl10l wild results in directed rounding modes (bug 16356). 2013-12-21 13:07:16 +00:00
Makefile Start generating libm tests automatically with MPFR. 2013-11-29 16:27:55 +00:00
math.h New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
multc3.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
README.libm-test Handle sincos with generic libm-test logic. 2013-05-19 14:45:41 +00:00
s_asinhl.c
s_atanl.c
s_cacos.c Fix cacos real-part inaccuracy for result real part near 0 (bug 15023). 2013-01-17 20:25:51 +00:00
s_cacosf.c Fix cacos real-part inaccuracy for result real part near 0 (bug 15023). 2013-01-17 20:25:51 +00:00
s_cacosh.c Fix cacosh inaccuracy and spurious exceptions (bug 15327). 2013-04-02 22:54:00 +00:00
s_cacoshf.c Fix cacosh inaccuracy and spurious exceptions (bug 15327). 2013-04-02 22:54:00 +00:00
s_cacoshl.c Fix cacosh inaccuracy and spurious exceptions (bug 15327). 2013-04-02 22:54:00 +00:00
s_cacosl.c Fix cacos real-part inaccuracy for result real part near 0 (bug 15023). 2013-01-17 20:25:51 +00:00
s_casin.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_casinf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_casinh.c Fix cacos real-part inaccuracy for result real part near 0 (bug 15023). 2013-01-17 20:25:51 +00:00
s_casinhf.c Fix cacos real-part inaccuracy for result real part near 0 (bug 15023). 2013-01-17 20:25:51 +00:00
s_casinhl.c Fix cacos real-part inaccuracy for result real part near 0 (bug 15023). 2013-01-17 20:25:51 +00:00
s_casinl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_catan.c Fix catan, catanh spurious underflows (bug 15423). 2013-05-01 10:07:00 +00:00
s_catanf.c Fix catan, catanh spurious underflows (bug 15423). 2013-05-01 10:07:00 +00:00
s_catanh.c Fix catan, catanh spurious underflows (bug 15423). 2013-05-01 10:07:00 +00:00
s_catanhf.c Fix catan, catanh spurious underflows (bug 15423). 2013-05-01 10:07:00 +00:00
s_catanhl.c Fix catan, catanh spurious underflows (bug 15423). 2013-05-01 10:07:00 +00:00
s_catanl.c Fix catan, catanh spurious underflows (bug 15423). 2013-05-01 10:07:00 +00:00
s_cbrtl.c
s_ccos.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_ccosf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_ccosh.c Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
s_ccoshf.c Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
s_ccoshl.c Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
s_ccosl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_cexp.c Fix cexp (NaN + i0) (bug 15532). 2013-08-23 19:45:38 +00:00
s_cexpf.c Fix cexp (NaN + i0) (bug 15532). 2013-08-23 19:45:38 +00:00
s_cexpl.c Fix cexp (NaN + i0) (bug 15532). 2013-08-23 19:45:38 +00:00
s_clog10.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_clog10f.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_clog10l.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_clog.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_clogf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_clogl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_cpow.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_cpowf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_cpowl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_cproj.c Fix cproj handling of (finite, NaN) arguments (bug 15531). 2013-08-20 19:41:15 +00:00
s_cprojf.c Fix cproj handling of (finite, NaN) arguments (bug 15531). 2013-08-20 19:41:15 +00:00
s_cprojl.c Fix cproj handling of (finite, NaN) arguments (bug 15531). 2013-08-20 19:41:15 +00:00
s_csin.c Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
s_csinf.c Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
s_csinh.c Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
s_csinhf.c Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
s_csinhl.c Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
s_csinl.c Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
s_csqrt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_csqrtf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_csqrtl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_ctan.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_ctanf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_ctanh.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_ctanhf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_ctanhl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_ctanl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_erfl.c
s_expm1l.c
s_fdim.c Fix fdim handling of infinities (bug 15797). 2013-08-21 19:56:48 +00:00
s_fdimf.c Fix fdim handling of infinities (bug 15797). 2013-08-21 19:56:48 +00:00
s_fdiml.c Fix fdim handling of infinities (bug 15797). 2013-08-21 19:56:48 +00:00
s_fma.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmaf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmal.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmax.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmaxf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmaxl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fmin.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fminf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_fminl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_ldexp.c
s_ldexpf.c
s_ldexpl.c
s_log1pl.c
s_nan.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_nanf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_nanl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
s_nextafter.c
s_nexttowardf.c
s_nexttowardl.c
s_significand.c
s_significandf.c
s_significandl.c
s_tanhl.c
setfpucw.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
t_sincosl.c
test-double.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-fenv-tls.c Make powerpc-nofpu floating-point state thread-local (bug 15483). 2013-11-19 13:39:56 +00:00
test-fenv.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-float.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-fpucw-ieee-static.c Fix static-binary lazy FPU context allocation 2013-09-09 22:36:57 +01:00
test-fpucw-ieee.c test-fpucw-ieee: Don't use _FPU_IEEE if not defined 2013-11-18 18:19:02 -05:00
test-fpucw-static.c Fix static-binary lazy FPU context allocation 2013-09-09 22:36:57 +01:00
test-fpucw.c Fix static-binary lazy FPU context allocation 2013-09-09 22:36:57 +01:00
test-idouble.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-ifloat.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-ildoubl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-ldouble.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-matherr.c
test-misc.c PowerPC floating point little-endian [1 of 15] 2013-10-04 10:31:41 +09:30
test-powl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-snan.c New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
test-tgmath2.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-tgmath-int.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-tgmath-ret.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
test-tgmath.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tgmath.h Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
tst-CMPLX2.c Don't disable CMPLXL macro for __NO_LONG_DOUBLE_MATH (bug 15488). 2013-05-18 12:12:38 +00:00
tst-CMPLX.c Don't disable CMPLXL macro for __NO_LONG_DOUBLE_MATH (bug 15488). 2013-05-18 12:12:38 +00:00
tst-definitions.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Versions New <math.h> macro named issignaling to check for a signaling NaN (sNaN). 2013-04-02 13:51:02 +02:00
w_acos.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_acosf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_acosh.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_acoshf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_acoshl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_acosl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_asin.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_asinf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_asinl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_atan2.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_atan2f.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_atan2l.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_atanh.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_atanhf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_atanhl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_cosh.c
w_coshf.c
w_coshl.c
w_drem.c
w_dremf.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
w_dreml.c
w_exp2.c Fix exp2 errno setting on underflow (bug 16283). 2013-12-03 20:50:51 +00:00
w_exp2f.c Fix exp2 errno setting on underflow (bug 16283). 2013-12-03 20:50:51 +00:00
w_exp2l.c Fix exp2 errno setting on underflow (bug 16283). 2013-12-03 20:50:51 +00:00
w_exp10.c Fix exp10 errno setting on underflow (bug 6787). 2013-11-29 16:32:49 +00:00
w_exp10f.c Fix exp10 errno setting on underflow (bug 6787). 2013-11-29 16:32:49 +00:00
w_exp10l.c Fix exp10 errno setting on underflow (bug 6787). 2013-11-29 16:32:49 +00:00
w_expl.c
w_fmod.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_fmodf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_fmodl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_hypot.c
w_hypotf.c
w_hypotl.c
w_ilogb.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_ilogbf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_ilogbl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_j0.c Fix Bessel function error handling (bug 6807, bug 15901). 2013-12-04 14:39:37 +00:00
w_j0f.c Fix Bessel function error handling (bug 6807, bug 15901). 2013-12-04 14:39:37 +00:00
w_j0l.c Fix Bessel function error handling (bug 6807, bug 15901). 2013-12-04 14:39:37 +00:00
w_j1.c Fix Bessel function error handling (bug 6807, bug 15901). 2013-12-04 14:39:37 +00:00
w_j1f.c Fix Bessel function error handling (bug 6807, bug 15901). 2013-12-04 14:39:37 +00:00
w_j1l.c Fix Bessel function error handling (bug 6807, bug 15901). 2013-12-04 14:39:37 +00:00
w_jn.c Fix Bessel function error handling (bug 6807, bug 15901). 2013-12-04 14:39:37 +00:00
w_jnf.c Fix Bessel function error handling (bug 6807, bug 15901). 2013-12-04 14:39:37 +00:00
w_jnl.c
w_lgamma_r.c
w_lgamma.c
w_lgammaf_r.c
w_lgammaf.c
w_lgammal_r.c
w_lgammal.c
w_log2.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_log2f.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_log2l.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_log10.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_log10f.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_log10l.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_log.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_logf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_logl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_pow.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_powf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_powl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_remainder.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_remainderf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_remainderl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_scalb.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_scalbf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_scalbl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_sinh.c
w_sinhf.c
w_sinhl.c
w_sqrt.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_sqrtf.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_sqrtl.c Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
w_tgamma.c Fix tgamma errno setting on underflow (bug 6810). 2013-12-05 14:01:41 +00:00
w_tgammaf.c Fix tgamma errno setting on underflow (bug 6810). 2013-12-05 14:01:41 +00:00
w_tgammal.c Fix tgamma errno setting on underflow (bug 6810). 2013-12-05 14:01:41 +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"?
====================================

To automatically generate a new "libm-test-ulps" run "make regen-ulps".
This generates the file "math/NewUlps" in the build directory.  The file
contains the sorted results of all the tests.  You can use the "NewUlps"
file as the machine's updated "libm-test-ulps" file.  Copy "NewUlps" to
"libm-test-ulps" in the appropriate machine sysdep directory.  Verify
the changes, post your patch, and check it in after review.

To manually generate a new "libm-test-ulps" file, first remove "ULPs"
file in the current directory, then you can execute for example:
    ./testrun.sh math/test-double -u --ignore-max-ulp=yes
This generates a file "ULPs" with all double ULPs in it, ignoring any
previously calculated ULPs, and running with the newly built dynamic
loader and math library (assumes you didn't install your build).  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
Copy "NewUlps" to "libm-test-ulps" in the appropriate machine sysdep
directory.

Note that 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.

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).

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)