glibc/sysdeps/ieee754/flt-32
Joseph Myers ad180676b8 Adjust thresholds in Bessel function implementations (bug 14469).
A recent discussion in bug 14469 notes that a threshold in float
Bessel function implementations, used to determine when to use a
simpler implementation approach, results in substantially inaccurate
results.

As I discussed in
<https://sourceware.org/ml/libc-alpha/2013-03/msg00345.html>, a
heuristic argument suggests 2^(S+P) as the right order of magnitude
for a suitable threshold, where S is the number of significand bits in
the floating-point type and P is the number of significant bits in the
representation of the floating-point type, and the float and ldbl-96
implementations use thresholds that are too small.  Some threshold
does need using, there or elsewhere in the implementation, to avoid
spurious underflow and overflow for large arguments.

This patch sets the thresholds in the affected implementations to more
heuristically justifiable values.  Results will still be inaccurate
close to zeroes of the functions (thus this patch does *not* fix any
of the bugs for Bessel function inaccuracy); fixing that would require
a different implementation approach, likely along the lines described
in <http://www.cl.cam.ac.uk/~jrh13/papers/bessel.ps.gz>.

So the justification for a change such as this would be statistical
rather than based on particular tests that had excessive errors and no
longer do so (no doubt such tests could be found, but would probably
be too fragile to add to the testsuite, as liable to give large errors
again from very small implementation changes or even from compiler
changes).  See
<https://sourceware.org/ml/libc-alpha/2020-02/msg00638.html> for such
statistics of the resulting improvements for float functions.

Tested (glibc testsuite) for x86_64.
2020-02-14 14:16:25 +00:00
..
e_acosf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_acoshf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_asinf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_atan2f.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_atanhf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_coshf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_exp2f_data.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
e_exp2f.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_expf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_fmodf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_gammaf_r.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_hypotf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_ilogbf.c
e_j0f.c Adjust thresholds in Bessel function implementations (bug 14469). 2020-02-14 14:16:25 +00:00
e_j1f.c Adjust thresholds in Bessel function implementations (bug 14469). 2020-02-14 14:16:25 +00:00
e_jnf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_lgammaf_r.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_log2f_data.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
e_log2f.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_log10f.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_logf_data.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
e_logf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_powf_log2_data.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
e_powf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_remainderf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_sinhf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
e_sqrtf.c Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
k_tanf.c Move math_check_force_underflow macros to separate math-underflow.h. 2018-05-10 00:53:04 +00:00
lgamma_negf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
lgamma_productf.c
math_config.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math_errf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
mpn2flt.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_asinhf.c Use copysign functions not __copysign functions in glibc libm. 2018-09-27 20:04:48 +00:00
s_atanf.c Move math_check_force_underflow macros to separate math-underflow.h. 2018-05-10 00:53:04 +00:00
s_cbrtf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_ceilf.c Adjust s_ceilf.c and s_ceill.c regarding code style. 2019-12-11 15:12:21 +01:00
s_copysignf.c Use GCC builtins for copysign functions if desired. 2019-12-11 15:12:19 +01:00
s_cosf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_erff.c Move math_check_force_underflow macros to separate math-underflow.h. 2018-05-10 00:53:04 +00:00
s_expm1f.c Do not include math-barriers.h in math_private.h. 2018-05-11 15:11:38 +00:00
s_fabsf.c
s_finitef.c
s_floorf.c Adjust s_floorf.c and s_floorl.c regarding code style. 2019-12-11 15:12:20 +01:00
s_fpclassifyf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_frexpf.c
s_fromfpf_main.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_fromfpf.c
s_fromfpxf.c
s_getpayloadf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_isinff.c
s_isnanf.c
s_issignalingf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_llrintf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_llroundf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_log1pf.c Do not include math-barriers.h in math_private.h. 2018-05-11 15:11:38 +00:00
s_logbf.c
s_lrintf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_lroundf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_modff.c
s_nearbyintf.c Adjust s_nearbyintf.c and s_nearbyintl.c regarding code style. 2019-12-11 15:12:19 +01:00
s_nextafterf.c Do not include math-barriers.h in math_private.h. 2018-05-11 15:11:38 +00:00
s_nextupf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_remquof.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_rintf.c Adjust s_rintf.c and s_rintl.c regarding code style. 2019-12-11 15:12:20 +01:00
s_roundevenf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_roundf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_scalblnf.c
s_scalbnf.c Use copysign functions not __copysign functions in glibc libm. 2018-09-27 20:04:48 +00:00
s_setpayloadf_main.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_setpayloadf.c
s_setpayloadsigf.c
s_signbitf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_sincosf_data.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_sincosf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_sincosf.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_sinf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_tanf.c Speedup tanf range reduction 2018-08-23 12:38:16 +01:00
s_tanhf.c Move math_check_force_underflow macros to separate math-underflow.h. 2018-05-10 00:53:04 +00:00
s_totalorderf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_totalordermagf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_truncf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
s_ufromfpf.c
s_ufromfpxf.c
sincosf_poly.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
w_exp2f.c
w_expf.c
w_log2f.c Do not wrap logf, log2f and powf 2017-10-02 14:39:38 +01:00
w_logf.c Do not wrap logf, log2f and powf 2017-10-02 14:39:38 +01:00
w_powf.c Do not wrap logf, log2f and powf 2017-10-02 14:39:38 +01:00