about summary refs log tree commit diff
path: root/sysdeps/ieee754/flt-32/e_powf.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix powf inaccuracy (bug 18956).Joseph Myers2015-09-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | The flt-32 version of powf can be inaccurate because of bugs in the extra-precision calculation of (x-1)/(x+1) or (x-1.5)/(x+1.5) as part of calculating log(x) with extra precision: a constant used (as part of adding 1 or 1.5 through integer arithmetic) is incorrect, and then the code fails to mask a computed high part before using it in arithmetic that relies on s_h*t_h being exactly representable. This patch fixes these bugs. Tested for x86_64 and x86. x86_64 ulps for powf removed and regenerated to reflect reduced ulps from the increased accuracy for existing tests. [BZ #18956] * sysdeps/ieee754/flt-32/e_powf.c (__ieee754_powf): Add 0x00400000 not 0x0040000 for high bit of mantissa. Mask with 0xfffff000 when extracting high part. * math/auto-libm-test-in: Add another test of pow. * math/auto-libm-test-out: Regenerated. * sysdeps/x86_64/fpu/libm-test-ulps: Update.
* Fix pow missing underflows (bug 18825).Joseph Myers2015-09-251-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to various other bugs in this area, pow functions can fail to raise the underflow exception when the result is tiny and inexact but one or more low bits of the intermediate result that is scaled down (or, in the i386 case, converted from a wider evaluation format) are zero. This patch forces the exception in a similar way to previous fixes, thereby concluding the fixes for known bugs with missing underflow exceptions currently filed in Bugzilla. Tested for x86_64, x86, mips64 and powerpc. [BZ #18825] * sysdeps/i386/fpu/i386-math-asm.h (FLT_NARROW_EVAL_UFLOW_NONNAN): New macro. (DBL_NARROW_EVAL_UFLOW_NONNAN): Likewise. (LDBL_CHECK_FORCE_UFLOW_NONNAN): Likewise. * sysdeps/i386/fpu/e_pow.S: Use DEFINE_DBL_MIN. (__ieee754_pow): Use DBL_NARROW_EVAL_UFLOW_NONNAN instead of DBL_NARROW_EVAL, reloading the PIC register as needed. * sysdeps/i386/fpu/e_powf.S: Use DEFINE_FLT_MIN. (__ieee754_powf): Use FLT_NARROW_EVAL_UFLOW_NONNAN instead of FLT_NARROW_EVAL. Use separate return path for case when first argument is NaN. * sysdeps/i386/fpu/e_powl.S: Include <i386-math-asm.h>. Use DEFINE_LDBL_MIN. (__ieee754_powl): Use LDBL_CHECK_FORCE_UFLOW_NONNAN, reloading the PIC register. * sysdeps/ieee754/dbl-64/e_pow.c (__ieee754_pow): Use math_check_force_underflow_nonneg. * sysdeps/ieee754/flt-32/e_powf.c (__ieee754_powf): Force underflow for subnormal result. * sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Likewise. * sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Use math_check_force_underflow_nonneg. * sysdeps/x86/fpu/powl_helper.c (__powl_helper): Use math_check_force_underflow. * sysdeps/x86_64/fpu/x86_64-math-asm.h (LDBL_CHECK_FORCE_UFLOW_NONNAN): New macro. * sysdeps/x86_64/fpu/e_powl.S: Include <x86_64-math-asm.h>. Use DEFINE_LDBL_MIN. (__ieee754_powl): Use LDBL_CHECK_FORCE_UFLOW_NONNAN. * math/auto-libm-test-in: Add more tests of pow. * math/auto-libm-test-out: Regenerated.
* Fix powf (close to -1, large) (bug 18647).Joseph Myers2015-08-051-1/+1
| | | | | | | | | | | | | | | | The flt-32 implementation of powf wrongly uses x-1 instead of |x|-1 when computing log (x) for the case where |x| is close to 1 and y is large. This patch fixes the logic accordingly. Relevant tests existed for x close to 1, and corresponding tests are added for x close to -1, as well as for some new variant cases. Tested for x86_64 and x86. [BZ #18647] * sysdeps/ieee754/flt-32/e_powf.c (__ieee754_powf): For large y and |x| close to 1, use absolute value of x when computing log. * math/auto-libm-test-in: Add more tests of pow. * math/auto-libm-test-out: Regenerated.
* Fix spurious underflows from pow with results close to 1 (bug 14811).Joseph Myers2012-11-071-0/+4
|
* Use <> for math.h and math_private.h everywhere.Richard Henderson2012-03-091-2/+2
| | | | Entire tree edited via find | grep | sed.
* Optimize libmUlrich Drepper2011-10-121-28/+18
| | | | | libm is now somewhat integrated with gcc's -ffinite-math-only option and lots of the wrapper functions have been optimized.
* Update.Ulrich Drepper2001-02-191-0/+4
| | | | | * sysdeps/ieee754/flt-32/e_powf.c: Handle x == +-1 correctly. * sysdeps/ieee754/dbl-64/e_pow.c: Likewise.
* Update.Ulrich Drepper1999-07-141-0/+253