glibc/sysdeps/ieee754/dbl-64
Wilco Dijkstra 19a8b9a300 [PATCH 1/7] sin/cos slow paths: avoid slow paths for small inputs
This series of patches removes the slow patchs from sin, cos and sincos.
Besides greatly simplifying the implementation, the new version is also much
faster for inputs up to PI (41% faster) and for large inputs needing range
reduction (27% faster).

ULP is ~0.55 with no errors found after testing 1.6 billion inputs across most
of the range with mpsin and mpcos.  The number of incorrectly rounded results
(ie. ULP >0.5) is at most ~2750 per million inputs between 0.125 and 0.5,
the average is ~850 per million between 0 and PI.

Tested on AArch64 and x86_64 with no regressions.

The first patch removes the slow paths for the cases where the input is small
and doesn't require range reduction.  Update ULP tables for sin, cos and sincos
on AArch64 and x86_64.

	* sysdeps/aarch64/libm-test-ulps: Update ULP for sin, cos, sincos.
	* sysdeps/ieee754/dbl-64/s_sin.c (__sin): Remove slow paths for small
	inputs.
	(__cos): Likewise.
	* sysdeps/x86_64/fpu/libm-test-ulps: Update ULP for sin, cos, sincos.
2018-04-03 16:52:16 +01:00
..
wordsize-64 Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
asincos.tbl Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
atnat2.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
atnat.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
branred.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
branred.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
dbl2mpn.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
dla.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
doasin.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
doasin.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
dosincos.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
dosincos.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_acos.c
e_acosh.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_asin.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_atan2.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_atanh.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_cosh.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
e_exp2.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_exp10.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_exp.c Remove mplog and mpexp 2018-02-15 12:41:05 +00:00
e_fmod.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
e_gamma_r.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_hypot.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_ilogb.c
e_j0.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_j1.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_jn.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
e_lgamma_r.c Use fabs(f/l) rather than __fabs 2017-09-29 18:54:24 +01:00
e_log2.c Use fabs(f/l) rather than __fabs 2017-09-29 18:54:24 +01:00
e_log10.c Use fabs(f/l) rather than __fabs 2017-09-29 18:54:24 +01:00
e_log.c Remove slow paths from log 2018-02-07 12:24:43 +00:00
e_pow.c Remove slow paths from pow 2018-02-12 10:47:09 +00:00
e_rem_pio2.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
e_remainder.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
e_sinh.c Consistently use uintN_t not u_intN_t in libm. 2017-08-03 19:55:04 +00:00
e_sqrt.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gamma_product.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gamma_productf.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
k_cos.c
k_rem_pio2.c Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
k_sin.c
k_tan.c
lgamma_neg.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
lgamma_product.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
Makefile Fix CFLAGS override in sysdeps/ieee754/dbl-64 2017-08-24 15:56:11 +01:00
MathLib.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mpa-arch.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mpa.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mpa.h Remove mplog and mpexp 2018-02-15 12:41:05 +00:00
mpatan2.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mpatan.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mpatan.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mpn2dbl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mpsqrt.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mpsqrt.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mptan.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
mydefs.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
powtwo.tbl Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
root.tbl Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_asinh.c Rename all __ieee754_sqrt(f/l) calls to sqrt(f/l) 2018-03-15 19:21:36 +00:00
s_atan.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_cbrt.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_ceil.c Use libm_alias_double for more dbl-64 functions. 2017-10-03 17:47:35 +00:00
s_copysign.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
s_cos.c
s_erf.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
s_expm1.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
s_f32xaddf64.c Add narrowing add functions. 2018-02-10 02:08:43 +00:00
s_f32xsubf64.c Add narrowing subtract functions. 2018-03-20 00:34:52 +00:00
s_fabs.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
s_fadd.c Add narrowing add functions. 2018-02-10 02:08:43 +00:00
s_finite.c Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
s_floor.c Use libm_alias_double for more dbl-64 functions. 2017-10-03 17:47:35 +00:00
s_fma.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fmaf.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fpclassify.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_frexp.c Use libm_alias_double for dbl-64 frexp. 2017-10-03 20:56:46 +00:00
s_fromfp_main.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_fromfp.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
s_fromfpx.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
s_fsub.c Add narrowing subtract functions. 2018-03-20 00:34:52 +00:00
s_getpayload.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_isinf.c Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
s_isnan.c Move LDBL_CLASSIFY_COMPAT to its own header. 2018-02-01 21:01:00 +00:00
s_issignaling.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_llrint.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_llround.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_log1p.c Fix -Os log1p, log1pf build (bug 21314). 2018-02-01 20:40:48 +00:00
s_logb.c Use libm_alias_double for dbl-64 logb. 2017-10-03 23:44:41 +00:00
s_lrint.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_lround.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_modf.c Use libm_alias_double for dbl-64 modf. 2017-10-03 23:46:23 +00:00
s_nearbyint.c Use libm_alias_double for more dbl-64 functions. 2017-10-03 17:47:35 +00:00
s_nexttoward.c
s_nextup.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_remquo.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_rint.c Use libm_alias_double for more dbl-64 functions. 2017-10-03 17:47:35 +00:00
s_round.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_roundeven.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_scalbln.c
s_scalbn.c Make scalbn set errno (bug 6803). 2015-09-16 21:11:00 +00:00
s_setpayload_main.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_setpayload.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
s_setpayloadsig.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
s_signbit.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_sin.c [PATCH 1/7] sin/cos slow paths: avoid slow paths for small inputs 2018-04-03 16:52:16 +01:00
s_sincos.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_tan.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_tanh.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
s_totalorder.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_totalordermag.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_trunc.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
s_ufromfp.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
s_ufromfpx.c Use libm_alias_double for some dbl-64 functions. 2017-09-29 23:54:33 +00:00
sincos32.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sincos32.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
sincostab.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
t_exp2.h
t_exp.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
uasncs.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
uatan.tbl Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
uexp.h Remove slow paths from exp 2018-02-12 11:33:33 +00:00
uexp.tbl Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
ulog.h Remove slow paths from log 2018-02-07 12:24:43 +00:00
ulog.tbl Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
upow.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
upow.tbl Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
urem.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
usncs.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
utan.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
utan.tbl Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
x2y2m1.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
x2y2m1f.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00