glibc/math
Joseph Myers da2f4f2dd5 Make scalbn set errno (bug 6803).
As noted in bug 6803, scalbn fails to set errno on overflow and
underflow.  This patch fixes this by making scalbn an alias of ldexp,
which has exactly the same semantics (for floating-point types with
radix 2) and already has wrappers that deal with setting errno,
instead of an alias of the internal __scalbn (which ldexp calls).

Notes:

* Where compat symbols were defined for scalbn functions, I didn't
  change what they point to (to keep the patch minimal), so such
  compat symbols continue to go directly to the non-errno-setting
  functions.

* Mike, I didn't do anything with the IA64 versions of these
  functions, where I think both the ldexp and scalbn functions already
  deal with setting errno.  As a cleanup (not needed to fix this bug)
  however you might want to make those functions into aliases for
  IA64; there is no need for them to be separate function
  implementations at all.

* This concludes the fix for bug 6803 since the scalb and scalbln
  cases of that bug were fixed some time ago.

Tested for x86_64, x86, mips64 and powerpc.

	[BZ #6803]
	* math/s_ldexp.c (scalbn): Define as weak alias of __ldexp.
	[NO_LONG_DOUBLE] (scalbnl): Define as weak alias of __ldexp.
	* math/s_ldexpf.c (scalbnf): Define as weak alias of __ldexpf.
	* math/s_ldexpl.c (scalbnl): Define as weak alias of __ldexpl.
	* sysdeps/i386/fpu/s_scalbn.S (scalbn): Remove alias.
	* sysdeps/i386/fpu/s_scalbnf.S (scalbnf): Likewise.
	* sysdeps/i386/fpu/s_scalbnl.S (scalbnl): Likewise.
	* sysdeps/ieee754/dbl-64/s_scalbn.c (scalbn): Likewise.
	[NO_LONG_DOUBLE] (scalbnl): Likewise.
	* sysdeps/ieee754/dbl-64/wordsize-64/s_scalbn.c (scalbn):
	Likewise.
	[NO_LONG_DOUBLE] (scalbnl): Likewise.
	* sysdeps/ieee754/flt-32/s_scalbnf.c (scalbnf): Likewise.
	* sysdeps/ieee754/ldbl-128/s_scalbnl.c (scalbnl): Likewise.
	* sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c (scalbnl): Remove
	long_double_symbol calls.
	* sysdeps/ieee754/ldbl-64-128/s_scalbnl.c (scalbnl): Likewise.
	* sysdeps/ieee754/ldbl-opt/s_ldexpl.c (__ldexpl_2): Define as
	strong alias of __ldexpl.
	(scalbnl): Define using long_double_symbol.
	* sysdeps/m68k/m680x0/fpu/s_scalbn.c (__CONCATX(scalbn,suffix)):
	Remove alias.
	* sysdeps/sparc/sparc64/soft-fp/s_scalbnl.c (scalbnl): Likewise.
	* sysdeps/x86_64/fpu/s_scalbnl.S (scalbnl): Likewise.
	* math/libm-test.inc (scalbn_test_data): Add errno expectations.
	(scalbln_test_data): Add more errno expectations.
2015-09-16 21:11:00 +00:00
..
bits Fix math.h, tgmath.h XSI POSIX namespace (gamma, isnan, scalb) (bug 18967). 2015-09-15 22:12:40 +00:00
machine
atest-exp2.c Adjust timeouts for some tests, to accommodate slow processors, 2015-02-22 01:05:02 -08:00
atest-exp.c Adjust timeouts for some tests, to accommodate slow processors, 2015-02-22 01:05:02 -08:00
atest-sincos.c Adjust timeouts for some tests, to accommodate slow processors, 2015-02-22 01:05:02 -08:00
auto-libm-test-in Fix ctan, ctanh missing underflows (bug 18595). 2015-09-15 17:46:08 +00:00
auto-libm-test-out Fix ctan, ctanh missing underflows (bug 18595). 2015-09-15 17:46:08 +00:00
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
e_acoshl.c
e_acosl.c
e_asinl.c
e_atan2l.c
e_atanhl.c
e_coshl.c
e_exp2l.c Fix exp2 missing underflows (bug 16521). 2015-09-14 22:00:12 +00:00
e_exp10.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
e_exp10f.c
e_exp10l.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01: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 This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
e_scalbf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
e_scalbl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
e_sinhl.c
e_sqrtl.c
fclrexcpt.c
fedisblxcpt.c
feenablxcpt.c
fegetenv.c
fegetexcept.c
fegetround.c
feholdexcpt.c
fenv.h Mark fegetround pure (bug 16296). 2015-09-15 20:36:50 +00:00
fesetenv.c
fesetround.c
feupdateenv.c
fgetexcptflg.c
fpu_control.c
fraiseexcpt.c
fsetexcptflg.c
ftestexcept.c
gen-auto-libm-tests.c
gen-libm-have-vector-test.sh Improve tgamma accuracy (bug 18613). 2015-06-29 23:29:35 +00:00
gen-libm-test.pl
ieee-math.c
k_casinh.c Use __copysign rather than copysign. 2015-04-22 12:07:56 +00:00
k_casinhf.c
k_casinhl.c
k_cosl.c
k_rem_pio2l.c
k_sincosl.c
k_sinl.c
k_tanl.c
libm-test.inc Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
Makefile Fix lgamma (negative) inaccuracy (bug 2542, bug 2543, bug 2558). 2015-09-10 22:27:58 +00:00
math.h Fix math.h, tgmath.h XSI POSIX namespace (gamma, isnan, scalb) (bug 18967). 2015-09-15 22:12:40 +00:00
multc3.c
README.libm-test
s_asinhl.c
s_atanl.c
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
s_ccos.c
s_ccosf.c
s_ccosh.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_ccoshf.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_ccoshl.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_ccosl.c
s_cexp.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_cexpf.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_cexpl.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_clog10.c
s_clog10f.c
s_clog10l.c
s_clog.c
s_clogf.c
s_clogl.c
s_cpow.c
s_cpowf.c
s_cpowl.c
s_cproj.c Add missing math_private includes. 2015-05-20 12:48:48 +00:00
s_cprojf.c Add missing math_private includes. 2015-05-20 12:48:48 +00:00
s_cprojl.c Add missing math_private includes. 2015-05-20 12:48:48 +00:00
s_csin.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_csinf.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_csinh.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_csinhf.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_csinhl.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_csinl.c Fix cexp, ccos, ccosh, csin, csinh spurious underflows (bug 18594). 2015-06-24 21:04:51 +00:00
s_csqrt.c Fix csqrt missing underflows (bug 18370). 2015-08-19 22:42:01 +00:00
s_csqrtf.c Fix csqrt missing underflows (bug 18370). 2015-08-19 22:42:01 +00:00
s_csqrtl.c Fix csqrt missing underflows (bug 18370). 2015-08-19 22:42:01 +00:00
s_ctan.c Fix ctan, ctanh missing underflows (bug 18595). 2015-09-15 17:46:08 +00:00
s_ctanf.c Fix ctan, ctanh missing underflows (bug 18595). 2015-09-15 17:46:08 +00:00
s_ctanh.c Fix ctan, ctanh missing underflows (bug 18595). 2015-09-15 17:46:08 +00:00
s_ctanhf.c Fix ctan, ctanh missing underflows (bug 18595). 2015-09-15 17:46:08 +00:00
s_ctanhl.c Fix ctan, ctanh missing underflows (bug 18595). 2015-09-15 17:46:08 +00:00
s_ctanl.c Fix ctan, ctanh missing underflows (bug 18595). 2015-09-15 17:46:08 +00:00
s_erfl.c
s_expm1l.c
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 Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
s_ldexpf.c Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
s_ldexpl.c Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
s_log1pl.c Set errno for log1p on pole/domain error. 2015-04-13 21:19:27 +02:00
s_nan.c
s_nanf.c
s_nanl.c
s_nextafter.c
s_nexttowardf.c
s_nexttowardl.c
s_significand.c
s_significandf.c
s_significandl.c
s_tanhl.c
setfpucw.c
t_sincosl.c
test-double-vlen2.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-double-vlen4.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-double-vlen8.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-double.c Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-double.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-fenv-preserve.c
test-fenv-return.c
test-fenv-tls.c
test-fenv.c
test-fenvinline.c math/test-fenvinline: avoid compiler warning 2015-07-10 16:11:40 -04:00
test-float-vlen4.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-float-vlen8.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-float-vlen16.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-float.c Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-float.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-fpucw-ieee-static.c
test-fpucw-ieee.c
test-fpucw-static.c
test-fpucw.c Modify several tests to use test-skeleton.c 2015-07-15 15:10:23 +05:30
test-idouble.c Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-ifloat.c Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-ildoubl.c Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-ldouble.c Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-ldouble.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-math-inline.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-math-no-inline.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-math-scalar.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-math-vector.h Refactor libm tests. 2015-06-24 23:27:18 +00:00
test-matherr.c
test-misc.c
test-powl.c
test-snan.c
test-tgmath2.c Modify several tests to use test-skeleton.c 2015-07-15 15:10:23 +05:30
test-tgmath-int.c
test-tgmath-ret.c
test-tgmath.c Modify several tests to use test-skeleton.c 2015-07-15 15:10:23 +05:30
tgmath.h Fix math.h, tgmath.h XSI POSIX namespace (gamma, isnan, scalb) (bug 18967). 2015-09-15 22:12:40 +00:00
tst-CMPLX2.c
tst-CMPLX.c
tst-definitions.c
Versions Fix sysdeps/i386/fpu/s_scalbn.S build 2015-08-07 09:53:56 +02:00
w_acos.c
w_acosf.c
w_acosh.c
w_acoshf.c
w_acoshl.c
w_acosl.c
w_asin.c
w_asinf.c
w_asinl.c
w_atan2.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_atan2f.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_atan2l.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_atanh.c
w_atanhf.c
w_atanhl.c
w_cosh.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_coshf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_coshl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_drem.c
w_dremf.c
w_dreml.c
w_exp2.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_exp2f.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_exp2l.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_exp10.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_exp10f.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_exp10l.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_expl.c
w_fmod.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_fmodf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_fmodl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_hypot.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_hypotf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_hypotl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_ilogb.c
w_ilogbf.c
w_ilogbl.c
w_j0.c
w_j0f.c
w_j0l.c
w_j1.c
w_j1f.c
w_j1l.c
w_jn.c
w_jnf.c
w_jnl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_lgamma_r.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_lgamma.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_lgammaf_r.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_lgammaf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_lgammal_r.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_lgammal.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_log1p.c Set errno for log1p on pole/domain error. 2015-04-13 21:19:27 +02:00
w_log1pf.c Set errno for log1p on pole/domain error. 2015-04-13 21:19:27 +02:00
w_log1pl.c Set errno for log1p on pole/domain error. 2015-04-13 21:19:27 +02:00
w_log2.c
w_log2f.c
w_log2l.c
w_log10.c
w_log10f.c
w_log10l.c
w_log.c
w_logf.c
w_logl.c
w_pow.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_powf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_powl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_remainder.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_remainderf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_remainderl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_scalb.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_scalbf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_scalbl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_scalbln.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_scalblnf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_scalblnl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_sinh.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_sinhf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_sinhl.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_sqrt.c
w_sqrtf.c
w_sqrtl.c
w_tgamma.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_tgammaf.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01:00
w_tgammal.c This patch renames all uses of __isinf*, __isnan*, __finite* and __signbit* to use standard C99 macros. This has no effect on generated code. 2015-06-03 15:41:36 +01: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 independent of the target
platform and the specific real floating type and format and contains
placeholder test "templates" for math functions defined in libm.
The file, along with a generated file named "auto-libm-test-out",
is preprocessed by the Perl script "gen-libm-test.pl" to expand
the templates and produce a set of test cases for each math function
that are specific to the target platform but still independent of
the real floating type.  The results of the processing are
"libm-test.c" and a file "libm-test-ulps.h" with platform specific
deltas by which the actual math function results may deviate from
the expected results and still be considered correct.

The test drivers "test-double.c", "test-float.c", and "test-ldouble.c"
test the normal double, float and long double implementation of libm.
The test drivers with an 'i' in their name ("test-idouble.c",
"test-ifloat.c", and "test-ildoubl.c") test the corresponding inline
functions (where available - otherwise they also test the real
functions in libm).  Each driver selects the desired real floating
type to exercise the math functions to test with (float, double, or
long double) by defining a small set of macros just before including
the generic "libm-test.c" file.  Each driver also either defines or
undefines the __NO_MATH_INLINES macro just before including
"libm-test.c" to select either the real or inline functions,
respectively.  Each driver is compiled into a single executable test
program with the corresponding name.

As mentioned above, the "gen-libm-test.pl" script looks for a file
named "libm-test-ulps" in the platform specific sysdep directory (or
its fpu or nofpu subdirectory) and for each variant (real floating
type and rounding mode) of every tested function reads from it the
maximum difference expressed as Units of Least Precision (ULP) the
actual result of the function may deviate from the expected result
before it's considered incorrect.

The "auto-libm-test-out" file contains sets of test cases to exercise,
the conditions under which to exercise each, and the expected results.
The file is generated by the "gen-auto-libm-tests" program from the
"auto-libm-test-in" file.  See the comments in gen-auto-libm-tests.c
for details about the content and format of the -in and -out files.

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 maximal errors of single functions, like:

Function "yn":
idouble: 6

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)

How to read the test output
===========================

Running each test on its own at the default level of verbosity will
print on stdout a line describing the implementation of math functions
exercised by the test (float, double, or long double), along with
whether the inline set has been selected, regardless of whether or
not any inline functions actually exist.  This is then followed by
the details of test failures (if any).  The output concludes by
a summary listing the number of test cases exercised and the number
of test failures uncovered.

For each test failure (and for each test case at higher levels of
verbosity), the output contains the name of the function under test
and its arguments or conditions that triggered the failure.  Note
that the name of the function in the output need not correspond
exactly to the name of the math function actually invoked. For example,
the output will refer to the "acos" function even if the actual function
under test is acosf (for the float version) or acosl (for the long
double version).  Also note that the function arguments may be shown
in either the decimal or the  hexadecimal floating point format which
may or may not correspond to the format used in the auto-libm-test-in
file. Besides the name of the function, for each test failure the
output contains the actual and expected results and the difference
between the two, printed in both the decimal and hexadecimal
floating point format, and the ULP and maximum ULP for the test
case.