glibc/sysdeps/ieee754
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
..
dbl-64 Remove a comment claiming that sin/cos round correctly. 2020-02-07 17:15:37 +00:00
float128 Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
flt-32 Adjust thresholds in Bessel function implementations (bug 14469). 2020-02-14 14:16:25 +00:00
ldbl-64-128 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ldbl-96 Adjust thresholds in Bessel function implementations (bug 14469). 2020-02-14 14:16:25 +00:00
ldbl-128 Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
ldbl-128ibm Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
ldbl-128ibm-compat ldbl-128ibm-compat: set PRINTF_CHK flag in {,v}sprintf_chk 2020-02-10 16:51:03 -06:00
ldbl-opt Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
soft-fp Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ieee754.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
k_standard.c Use copysign functions not __copysign functions in glibc libm. 2018-09-27 20:04:48 +00:00
k_standardf.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
k_standardl.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libm-alias-finite.h Add libm_alias_finite for _finite symbols 2020-01-03 10:02:04 -03:00
Makefile
s_lib_version.c Simplify math-svid-compat code. 2017-08-28 15:19:52 +00:00
s_matherr.c Obsolete matherr, _LIB_VERSION, libieee.a. 2017-08-21 17:45:10 +00:00
s_signgam.c Remove unnecessary math_private.h includes. 2018-09-28 21:53:33 +00:00