aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/ldbl-128
AgeCommit message (Collapse)Author
2014-03-11Fix nextafter overflow in non-default rounding modes (bug 16677).Joseph Myers
ISO C requires the result of nextafter to be independent of the rounding mode, even when underflow or overflow occurs. This patch fixes the bug in various nextafter implementations that, having done an overflowing computation to force an overflow exception (correct), they then return the result of that computation rather than an infinity computed some other way (incorrect, when the overflowing result of arithmetic with that sign and rounding mode is finite but the correct result is infinite) - generally by falling through to existing code to return a value that in fact is correct for this case (but was computed by an integer increment and so without generating the exceptions required). Having fixed the bug, the previously deferred conversion of nextafter testing in libm-test.inc to ALL_RM_TEST is also included. Tested x86_64 and x86; also spot-checked results of nextafter tests for powerpc32 and mips64 to test the ldbl-128ibm and ldbl-128 changes. (The m68k change is untested.) [BZ #16677] * math/s_nextafter.c (__nextafter): Do not return value from overflowing computation. * sysdeps/i386/fpu/s_nextafterl.c (__nextafterl): Likewise. * sysdeps/ieee754/flt-32/s_nextafterf.c (__nextafterf): Likewise. * sysdeps/ieee754/ldbl-128/s_nextafterl.c (__nextafterl): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Likewise. * sysdeps/m68k/m680x0/fpu/s_nextafterl.c (__nextafterl): Likewise. * math/libm-test.inc (nextafter_test): Use ALL_RM_TEST.
2014-02-11BZ #16447: Fix ldbl-128 expl implementation.Andreas Krebbel
Extend the range of numbers handled via unsafe mode. Add expl testcase and regenerate ULPs for s390.
2014-02-10Use glibc_likely instead __builtin_expect.Ondřej Bílka
2014-01-15[BZ #16427] Fix ldbl-128 exp overflows.Andreas Krebbel
Invoke the non-IEEE handling only for numbers special also in the IEEE case. This aligns the exp handling with the other ldbl variants.
2014-01-06Fix ldbl-128 / ldbl-128ibm lgammal spurious underflow (bug 16400).Joseph Myers
This patch fixes bug 16400, spurious underflow exceptions for ldbl-128 / ldbl-128ibm lgammal with small positive arguments, by just using -__logl (x) as the result in the problem cases (similar to the previous fix for problems with small negative arguments). Tested powerpc32, and also tested on mips64 that this does not require ulps regeneration for the ldbl-128 case. * sysdeps/ieee754/ldbl-128/e_lgammal_r.c (__ieee754_lgammal_r): Return -__logl (x) for small positive arguments without evaluating a polynomial.
2014-01-01Update copyright notices with scripts/update-copyrightsAllan McRae
2013-12-22Fix ldbl-128 lgammal for small negative arguments (bug 16337).Joseph Myers
This patch fixes bug 16337, ldbl-128 lgammal spurious overflows for small negative arguments (the arguments in question are already in the testsuite). The implementation uses the reflection formula to compute lgamma of negative x from lgamma of -x, effectively resulting in a calculation -log(x^2) + log(-x); cancellation isn't problematic in this case (bugs for problematic cancellation in lgamma are 2542, 2543, 2558), but the x^2 calculation can underflow (in which case there is spurious logic to return an overflowing value - lgamma can only ever correctly overflow for large positive arguments, though tgamma can overflow for small arguments of either sign as well as large positive arguments). The fix is simply to calculate the result directly with logl when the argument is a small enough negative number. Tested mips64. * sysdeps/ieee754/ldbl-128/e_lgammal_r.c (__ieee754_lgammal_r): Calculate results for small negative arguments directly rather than using reflection formula with special underflow handling.
2013-12-18Fix ldbl-128 logl for subnormals (bug 16338).Joseph Myers
This patch fixes bug 16338, ldbl-128 logl not handling subnormals (with consequent inaccuracy for lgammal as well). The fix is simply to use __frexpl when determining the exponent, as done already in log2l and log10l. Given the lack of testing of small arguments to any of the log* functions, appropriate tests are added for all of them. Tested x86_64 and x86 and ulps updated accordingly, and spot tests also run for mips64 to confirm the ldbl-128 fix. Note that while this fixes lgammal inaccuracy for small positive arguments, I suspect that there will still be problems with spurious underflows in that case. * sysdeps/ieee754/ldbl-128/e_logl.c (__ieee754_logl): Use __frexpl to determine exponent and adjust argument to have exponent of -1. * math/auto-libm-test-in: Add more tests of log, log10, log1p and log2. * math/auto-libm-test-out: Regenerated. * sysdeps/x86_64/fpu/libm-test-ulps: Update.
2013-12-17Fix hypot handling of subnormals (bug 16316, bug 16330).Joseph Myers
2013-12-04Fix Bessel function error handling (bug 6807, bug 15901).Joseph Myers
2013-12-03Fix erfc errno setting on underflow (bug 6786).Joseph Myers
2013-10-04PowerPC floating point little-endian [1 of 15]Alan Modra
http://sourceware.org/ml/libc-alpha/2013-08/msg00081.html This is the first of a series of patches to ban ieee854_long_double and the ieee854_long_double macros when using IBM long double. union ieee854_long_double just isn't correct for IBM long double, especially when little-endian, and pretending it is OK has allowed a number of bugs to remain undetected in sysdeps/ieee754/ldbl-128ibm/. This changes the few places in generic code that use it. * stdio-common/printf_size.c (__printf_size): Don't use union ieee854_long_double in fpnum union. * stdio-common/printf_fphex.c (__printf_fphex): Likewise. Use signbit macro to retrieve sign from long double. * stdio-common/printf_fp.c (___printf_fp): Use signbit macro to retrieve sign from long double. * sysdeps/ieee754/ldbl-128ibm/printf_fphex.c: Adjust for fpnum change. * sysdeps/ieee754/ldbl-128/printf_fphex.c: Likewise. * sysdeps/ieee754/ldbl-96/printf_fphex.c: Likewise. * sysdeps/x86_64/fpu/printf_fphex.c: Likewise. * math/test-misc.c (main): Don't use union ieee854_long_double. ports/ * sysdeps/ia64/fpu/printf_fphex.c: Adjust for fpnum change.
2013-08-30Fix typos.Ondřej Bílka
2013-08-29[BZ #15522] strtod ("nan(N)") returning a sNaN in some casesThomas Schwinge
2013-06-06Fix leading whitespaces.Ondrej Bilka
2013-06-05Remove trailing whitespace.Joseph Myers
2013-05-19Fix nearbyint scheduling of arithmetic past fesetenv (bug 15490).Joseph Myers
2013-05-09Fix ldbl-128 cos range reduction near pi/2 (bug 15429).Joseph Myers
2013-05-08Improve tgamma accuracy (bugs 2546, 2560, 5159, 15426).Joseph Myers
2013-04-02New <math.h> macro named issignaling to check for a signaling NaN (sNaN).Thomas Schwinge
It is based on draft TS 18661 and currently enabled as a GNU extension.
2013-03-21Fix Bessel function spurious overflows for ldbl-128 / ldbl-128ibm (bug 15285).Joseph Myers
2013-03-16Fix spurious underflow exceptions for Bessel functions for ldbl-128 / ↵Joseph Myers
ldbl-128ibm (bug 14155).
2013-01-02Update copyright notices with scripts/update-copyrights.Joseph Myers
2013-01-01Add script to update copyright notices and reformat some to facilitate its use.Joseph Myers
2012-11-20Fix set-but-not-used warnings in ldbl-128 nearbyintl, rintl.Joseph Myers
2012-11-19Fix spurious underflows in ldbl-128 atan implementation.David S. Miller
With help from Joseph Myers. * sysdeps/ieee754/ldbl-128/s_atanl.c (__atanl): Handle tiny and very large arguments properly. * math/libm-test.inc (atan_test): New tests. (atan2_test): New tests. * sysdeps/sparc/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Update.
2012-11-18Correct tinyness handling in long-double and float y0/y1.David S. Miller
With help from Joseph Myers. * sysdeps/ieee754/flt-32/e_j0f.c (__ieee754_y0f): Adjust tinyness cutoff to 2**-13. * sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_y1f): Adjust tinyness cutoff to 2**-25. * sysdeps/ieee754/ldbl-128/e_j0l.c (U0): New constant. ( __ieee754_y0l): Avoid arithmetic underflow when 'x' is very small. * sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_y1l): Likewise. * math/libm-test.inc (y0_test): New tests. (y1_test): New tests. * sysdeps/i386/fpu/libm-test-ulps: Update. * sysdeps/x86_64/fpu/libm-test-ulps: Update. * sysdeps/sparc/fpu/libm-test-ulps: Update.
2012-11-16Fix BZ #14811 for ldbl-128 too.David S. Miller
[BZ #14811] * sysdeps/ieee754/ldbl-128/e_powl.c (__ieee754_powl): Saturate nonzero exponents with absolute value below 0x1p-128 to +/- 0x1p-128.
2012-11-16Don't generate underflow for very small values in log1pl.David S. Miller
* sysdeps/ieee754/ldbl-128/s_log1pl.c (__log1pl): If xm1 is smaller than LDBL_EPSILON/2.0L, just return xm1.
2012-11-06Fix fma underflows with small x * y (bug 14793).Joseph Myers
2012-11-04Fix fma overflow results outside round-to-nearest mode (bug 14797).Joseph Myers
2012-11-03Make fma use of Dekker and Knuth algorithms use round-to-nearest (bug 14796).Joseph Myers
2012-11-01Fix fma (a, b, c) for small a * b (bugs 14784, 14785).Joseph Myers
2012-10-31Fix fma underflow exceptions in after-rounding edge cases.Joseph Myers
2012-10-30Fix fma missing underflows and bad results for some subnormal results (bugs ↵Joseph Myers
14152, 14783).
2012-10-01Fix sign of inexact zero return from fma (bug 14645).Joseph Myers
2012-09-29Fix sign of exact zero return from fma (bug 14638).Joseph Myers
2012-09-27Remove sysdeps/ieee754/ldbl-128/bits/huge_vall.h and let buildsSteve Ellcey
use bits/huge_vall.h instead. There is no longer any need for the special huge_vall.h file.
2012-09-25Fix inaccuracy of clog, clog10 near |z| = 1 (bug 13629).Joseph Myers
2012-07-25Set up errno properly for yn.Marek Polacek
2012-06-01Ensure additions are not scheduled after fetestexcept in fmaf and fmal.Joseph Myers
2012-05-26Optimize handling of denormals in logb/logbf/logblAndreas Schwab
2012-05-10Fix for logb/logbf/logbl (bugs 13954/13955/13956)Adhemerval Zanella
POSIX 2008 states that if the input for 'logb[f|l]' is a subnormal number it should be treated as if it were normalized. This means the implementation should calculate the log2 of the mantissa and add it to the subnormal exponent (-126 for float and -1022 for double and IBM long double). This patch takes care of that.
2012-05-06Fix exp10 inaccuracy and exceptions (bugs 13884, 13914).Joseph Myers
2012-05-01Fix nexttoward bugs (bugs 2550, 2570).Joseph Myers
2012-04-18Finish ilogb changesAndreas Jaeger
[BZ# 6794] * sysdeps/ieee754/ldbl-96/s_ilogbl.c: Moved to ... * sysdeps/ieee754/ldbl-96/e_ilogbl.c: ... here. Rename __ilogbl to __ieee754_ilogbl and remove weak_alias. * sysdeps/ieee754/ldbl-128/s_ilogbl.c: Moved to ... * sysdeps/ieee754/ldbl-128/e_ilogbl.c: ... here. Rename __ilogbl to __ieee754_ilogbl and remove weak_alias. * sysdeps/ieee754/ldbl-64-128/s_ilogbl.c: Moved to ... * sysdeps/ieee754/ldbl-64-128/e_ilogbl.c: ... here. * sysdeps/sparc/sparc64/soft-fp/s_ilogbl.c: Moved to ... * sysdeps/sparc/sparc64/soft-fp/e_ilogbl.c: ... here. Rename __ilogbl to __ieee754_ilogbl and remove weak_alias.
2012-03-28Avoid overflows from long double functions using __kernel_standard.Joseph Myers
2012-03-22Fix low-part sign handling in sin/cos for ldbl-128 and ldbl-128ibm.Joseph Myers
2012-03-13Fix generic ldbl-128 expm1l just like x86-64 and i386 variants were.David S. Miller
* sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Use expl for large parameters.
2012-03-09Use <> for math.h and math_private.h everywhere.Richard Henderson
Entire tree edited via find | grep | sed.