freebsd-skq/lib/msun/src
Bruce Evans 25efbfb212 Fixed some magic numbers.
The threshold for not being tiny was too small.  Use the usual 2**-12
threshold.  This change is not just an optimization, since the general
code that we fell into has accuracy problems even for tiny x.  Avoiding
it fixes 2*1366 args with errors of more than 1 ulp, with a maximum
error of 1.167 ulps.

The magic number 22 is log(DBL_EPSILON)/2 plus slop.  This is bogus
for float precision.  Use 9 (~log(FLT_EPSILON)/2 plus less slop than
for double precision).  The code for handling the interval
[2**-28, 9_was_22] has accuracy problems even for [9, 22], so this
change happens to fix errors of more than 1 ulp in about 2*17000
cases.  It leaves such errors in about 2*1074000 cases, with a max
error of 1.242 ulps.

The threshold for switching from returning exp(x)/2 to returning
exp(x/2)^2/2 was a little smaller than necessary.  As for coshf(),
This was not quite harmless since the exp(x/2)^2/2 case is inaccurate,
and fixing it avoids accuracy problems in 2*6 cases, leaving problems
in 2*19997 cases.

Fixed naming errors in pseudo-code in comments.
2005-11-13 00:41:46 +00:00
..
e_acos.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_acosf.c
e_acosh.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_acoshf.c
e_asin.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_asinf.c
e_atan2.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_atan2f.c
e_atanh.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_atanhf.c
e_cosh.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_coshf.c Fixed some magic numbers. 2005-11-13 00:08:23 +00:00
e_exp.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_expf.c Revert rev 1.8, which causes small (e.g. 2 ulp) errors for some 2005-02-24 06:32:13 +00:00
e_fmod.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_fmodf.c
e_gamma_r.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_gamma.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_gammaf_r.c
e_gammaf.c
e_hypot.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_hypotf.c
e_j0.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_j0f.c
e_j1.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_j1f.c
e_jn.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_jnf.c
e_lgamma_r.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_lgamma.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_lgammaf_r.c
e_lgammaf.c
e_log10.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_log10f.c
e_log.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_logf.c As for the float trig functions, use a minimax polynomial that is 2005-11-12 18:20:09 +00:00
e_pow.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_powf.c
e_rem_pio2.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_rem_pio2f.c Use a 53-bit approximation to pi/2 instead of a 33+53 bit one for the 2005-11-06 17:48:02 +00:00
e_remainder.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_remainderf.c
e_scalb.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_scalbf.c
e_sinh.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_sinhf.c Fixed some magic numbers. 2005-11-13 00:41:46 +00:00
e_sqrt.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
e_sqrtf.c
k_cos.c Use a better algorithm for reducing the error in __kernel_cos[f](). 2005-10-26 12:36:18 +00:00
k_cosf.c Improved comments for the minimax polynomial. 2005-11-12 19:54:45 +00:00
k_rem_pio2.c Reduce diffs against vendor source (Sun fdlibm 5.3). 2005-02-04 18:26:06 +00:00
k_rem_pio2f.c Fixed range reduction for large multiples of pi/2 on systems with 2005-10-11 07:56:05 +00:00
k_sin.c Updated the comment about the optimization for tiny x (the previous 2005-11-02 13:06:49 +00:00
k_sinf.c Tweaked the minimax polynomial and improved its comments. 2005-11-12 19:56:35 +00:00
k_tan.c Moved the optimization for tiny x from __kernel_tan[f](x) to tan[f](x) 2005-11-02 14:01:45 +00:00
k_tanf.c Imoproved comments for the minimax polynomial. 2005-11-12 20:06:04 +00:00
math_private.h Implement inline functions to give the complex result x+I*y from float 2005-10-29 17:14:11 +00:00
math.h Implement truncl() based on floorl(). 2005-04-16 21:12:47 +00:00
s_asinh.c
s_asinhf.c
s_atan.c
s_atanf.c
s_cbrt.c
s_cbrtf.c
s_ceil.c
s_ceilf.c
s_ceill.c Revert the last change, the conversion from long double to double can raise 2005-04-28 19:45:55 +00:00
s_cimag.c
s_cimagf.c
s_cimagl.c
s_conj.c
s_conjf.c
s_conjl.c
s_copysign.c
s_copysignf.c
s_copysignl.c
s_cos.c Moved the optimization for tiny x from __kernel_{cos,sin}[f](x) to 2005-10-24 14:08:36 +00:00
s_cosf.c Moved the optimization for tiny x from __kernel_{cos,sin}[f](x) to 2005-10-24 14:08:36 +00:00
s_creal.c
s_crealf.c
s_creall.c
s_erf.c
s_erff.c
s_exp2.c Implement exp2() and exp2f(). 2005-04-05 02:57:15 +00:00
s_exp2f.c Implement exp2() and exp2f(). 2005-04-05 02:57:15 +00:00
s_expm1.c
s_expm1f.c
s_fabs.c
s_fabsf.c
s_fabsl.c
s_fdim.c
s_finite.c
s_finitef.c
s_floor.c
s_floorf.c
s_floorl.c Revert the last change, the conversion from long double to double can raise 2005-04-28 19:45:55 +00:00
s_fma.c Fix the double rounding problem with subnormals, and 2005-03-18 02:27:59 +00:00
s_fmaf.c
s_fmal.c Fix the double rounding problem with subnormals, and 2005-03-18 02:27:59 +00:00
s_fmax.c
s_fmaxf.c
s_fmaxl.c
s_fmin.c
s_fminf.c
s_fminl.c
s_frexp.c Replace strong references with weak references. There's no 2005-03-07 21:27:37 +00:00
s_frexpf.c
s_frexpl.c Implement frexpl. 2005-03-07 04:54:51 +00:00
s_ilogb.c
s_ilogbf.c
s_ilogbl.c
s_isfinite.c
s_isnan.c
s_isnormal.c
s_llrint.c
s_llrintf.c
s_llround.c These files should include s_lround.c instead of s_lrint.c. 2005-04-08 00:52:27 +00:00
s_llroundf.c These files should include s_lround.c instead of s_lrint.c. 2005-04-08 00:52:27 +00:00
s_llroundl.c Add roundl(), lroundl(), and llroundl(). 2005-04-08 01:24:08 +00:00
s_log1p.c
s_log1pf.c
s_logb.c
s_logbf.c
s_lrint.c
s_lrintf.c
s_lround.c Fix a (coincidentally harmless) bug. 2005-04-08 00:52:16 +00:00
s_lroundf.c These files should include s_lround.c instead of s_lrint.c. 2005-04-08 00:52:27 +00:00
s_lroundl.c Add roundl(), lroundl(), and llroundl(). 2005-04-08 01:24:08 +00:00
s_modf.c
s_modff.c
s_nearbyint.c
s_nextafter.c Replace strong references with weak references. There's no 2005-03-07 21:27:37 +00:00
s_nextafterf.c - Try harder to trick gcc into not optimizing away statements 2005-03-07 04:55:58 +00:00
s_nextafterl.c Implement nexttoward and nextafterl; the latter is also known as 2005-03-07 04:56:46 +00:00
s_nexttoward.c Implement nexttoward and nextafterl; the latter is also known as 2005-03-07 04:56:46 +00:00
s_nexttowardf.c Implement nexttowardf. This is used on both platforms with 11-bit 2005-03-07 04:57:38 +00:00
s_remquo.c Implement and document remquo() and remquof(). 2005-03-25 04:40:44 +00:00
s_remquof.c Implement and document remquo() and remquof(). 2005-03-25 04:40:44 +00:00
s_rint.c Remove an obsolete sentence from a comment. 2005-03-07 20:28:26 +00:00
s_rintf.c
s_round.c
s_roundf.c
s_roundl.c Add roundl(), lroundl(), and llroundl(). 2005-04-08 01:24:08 +00:00
s_scalbln.c - Implement scalblnl. 2005-03-07 04:57:50 +00:00
s_scalbn.c Replace strong references with weak references. There's no 2005-03-07 21:27:37 +00:00
s_scalbnf.c Alias scalbnf as ldexpf. The two are identical in binary 2005-03-07 04:52:43 +00:00
s_scalbnl.c Add scalbnl, also known as as ldexpl. 2005-03-07 04:52:58 +00:00
s_signbit.c
s_signgam.c
s_significand.c
s_significandf.c
s_sin.c Moved the optimization for tiny x from __kernel_{cos,sin}[f](x) to 2005-10-24 14:08:36 +00:00
s_sinf.c Moved the optimization for tiny x from __kernel_{cos,sin}[f](x) to 2005-10-24 14:08:36 +00:00
s_tan.c Moved the optimization for tiny x from __kernel_tan[f](x) to tan[f](x) 2005-11-02 14:01:45 +00:00
s_tanf.c Moved the optimization for tiny x from __kernel_tan[f](x) to tan[f](x) 2005-11-02 14:01:45 +00:00
s_tanh.c
s_tanhf.c
s_trunc.c
s_truncf.c
s_truncl.c Revert the last change, the conversion from long double to double can raise 2005-04-28 19:45:55 +00:00
w_cabs.c
w_cabsf.c
w_drem.c
w_dremf.c