opnsense-src/lib/msun/src
Bruce Evans 4f8f819975 Fixed lots of 1 ULP errors caused by a broken approximation for pi/2.
We approximate pi with more than float precision using pi_hi+pi_lo in
the usual way (pi_hi is actually spelled pi in the source code), and
expect (float)0.5*pi_lo to give the low part of the corresponding
approximation for pi/2.  However, the high part for pi/2 (pi_o_2) is
rounded to nearest, which happens to round up, while the high part for
pi was rounded down.  Thus pi_o_2+(float)0.5*pi (in infinite precision)
was a very bad approximation for pi/2 -- the low term has the wrong
sign and increases the error drom less than half an ULP to a full ULP.

This fix rounds up instead of down for pi_hi.  Consistently rounding
down instead of up should work, and is the method used in e_acosf.c
and e_asinf.c.  The reason for the difference is that we sometimes
want to return precisely pi/2 in e_atan2f.c, so it is convenient to
have a correctly rounded (to nearest) value for pi/2 in a variable.
a_acosf.c and e_asinf.c also differ in directly approximating pi/2
instead pi; they multiply by 2.0 instead of dividing by 0.5 to convert
the approximation.

These complications are not directly visible in the double precision
versions because rounding to nearest happens to round down.
2004-06-02 17:09:05 +00:00
..
e_acos.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
e_acosf.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_acosh.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_acoshf.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_asin.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
e_asinf.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_atan2.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
e_atan2f.c Fixed lots of 1 ULP errors caused by a broken approximation for pi/2. 2004-06-02 17:09:05 +00:00
e_atanh.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_atanhf.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_cosh.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_coshf.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_exp.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
e_expf.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_fmod.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
e_fmodf.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_gamma.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_gamma_r.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_gammaf.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:03:12 +00:00
e_gammaf_r.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_hypot.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_hypotf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_j0.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_j0f.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_j1.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_j1f.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_jn.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_jnf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_lgamma.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_lgamma_r.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_lgammaf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_lgammaf_r.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_log.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
e_log10.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
e_log10f.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_logf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_pow.c Fixed the sign of the result in some overflow and underflow cases (ones 2004-06-01 19:28:38 +00:00
e_powf.c Merged from double precision case (e_pow.c 1.10: sign fixes). 2004-06-01 19:33:30 +00:00
e_rem_pio2.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:51:46 +00:00
e_rem_pio2f.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:51:46 +00:00
e_remainder.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
e_remainderf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_scalb.c Fix a problem where libm compiled under 5.X would depend on features 2003-10-27 01:28:07 +00:00
e_scalbf.c Fix a problem where libm compiled under 5.X would depend on features 2003-10-27 01:28:07 +00:00
e_sinh.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_sinhf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
e_sqrt.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
e_sqrtf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
k_cos.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
k_cosf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
k_rem_pio2.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:51:46 +00:00
k_rem_pio2f.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:51:46 +00:00
k_sin.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
k_sinf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
k_standard.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
k_tan.c Merge a bugfix from FDLIBM 5.3 to ensure that the error in tan() 2004-06-02 04:39:29 +00:00
k_tanf.c Port a bugfix from FDLIBM 5.3. The bug really only applies to tan() 2004-06-02 04:39:44 +00:00
math.h Add an implementation of copysignl(), a long double version of copysign(). 2004-05-07 18:56:31 +00:00
math_private.h Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_asinh.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_asinhf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_atan.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_atanf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_cbrt.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_cbrtf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_ceil.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_ceilf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_cimag.c Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are 2004-05-30 09:21:56 +00:00
s_cimagf.c Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are 2004-05-30 09:21:56 +00:00
s_cimagl.c Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are 2004-05-30 09:21:56 +00:00
s_conj.c Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are 2004-05-30 09:21:56 +00:00
s_conjf.c Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are 2004-05-30 09:21:56 +00:00
s_conjl.c Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are 2004-05-30 09:21:56 +00:00
s_copysign.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_copysignf.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_copysignl.c Add an implementation of copysignl(), a long double version of copysign(). 2004-05-07 18:56:31 +00:00
s_cos.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_cosf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_creal.c Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are 2004-05-30 09:21:56 +00:00
s_crealf.c Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are 2004-05-30 09:21:56 +00:00
s_creall.c Add implementations for cimag{,f,l}, creal{,f,l} and conj{,f,l}. They are 2004-05-30 09:21:56 +00:00
s_erf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_erff.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_expm1.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_expm1f.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_fabs.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_fabsf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_fabsl.c Better safe than clever. 2003-10-25 19:53:28 +00:00
s_finite.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_finitef.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:51:46 +00:00
s_floor.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_floorf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_frexp.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_frexpf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_ilogb.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_ilogbf.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:51:46 +00:00
s_isnan.c o Implement C99 classification macros isfinite(), isinf(), isnan(), 2003-02-12 20:03:41 +00:00
s_isnanf.c o Implement C99 classification macros isfinite(), isinf(), isnan(), 2003-02-12 20:03:41 +00:00
s_ldexp.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_ldexpf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_lib_version.c $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
s_log1p.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_log1pf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_logb.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_logbf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_matherr.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:51:46 +00:00
s_modf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_modff.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_nextafter.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_nextafterf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_rint.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_rintf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_scalbn.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_scalbnf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_signgam.c J.T. Conklin's latest version of the Sun math library. 1994-08-19 09:40:01 +00:00
s_significand.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_significandf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_sin.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_sinf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_tan.c Only provide one copy of the math functions. If we provide a MD function, 2003-07-23 04:53:47 +00:00
s_tanf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_tanh.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
s_tanhf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_acos.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_acosf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_acosh.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_acoshf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_asin.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_asinf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_atan2.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_atan2f.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_atanh.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_atanhf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_cabs.c Added skeleton <complex.h> (aligned with the POSIX.1-200x), mostly 2001-06-13 15:16:30 +00:00
w_cabsf.c Added skeleton <complex.h> (aligned with the POSIX.1-200x), mostly 2001-06-13 15:16:30 +00:00
w_cosh.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_coshf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_drem.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
w_dremf.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
w_exp.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_expf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_fmod.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_fmodf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_gamma.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_gamma_r.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_gammaf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_gammaf_r.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_hypot.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_hypotf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_j0.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_j0f.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_j1.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_j1f.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_jn.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_jnf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_lgamma.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_lgamma_r.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_lgammaf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_lgammaf_r.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_log.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_log10.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_log10f.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_logf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_pow.c Assume __STDC__, remove non-__STDC__ code. 2002-05-28 17:51:46 +00:00
w_powf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_remainder.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_remainderf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_scalb.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_scalbf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_sinh.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_sinhf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_sqrt.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_sqrtf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_y0.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_y0f.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_y1.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_y1f.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_yn.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00
w_ynf.c Fix formatting, this is hard to explain, so I'll show one example. 2002-05-28 18:15:04 +00:00