about summary refs log tree commit diff
path: root/sysdeps/ieee754
Commit message (Collapse)AuthorAgeFilesLines
* Fix for [BZ #15680] IBM long double inaccuracyAlan Modra2013-10-045-106/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://sourceware.org/ml/libc-alpha/2013-06/msg00919.html I discovered a number of places where denormals and other corner cases were being handled wrongly. - printf_fphex.c: Testing for the low double exponent being zero is unnecessary. If the difference in exponents is less than 53 then the high double exponent must be nearing the low end of its range, and the low double exponent hit rock bottom. - ldbl2mpn.c: A denormal (ie. exponent of zero) value is treated as if the exponent was one, so shift mantissa left by one. Code handling normalisation of the low double mantissa lacked a test for shift count greater than bits in type being shifted, and lacked anything to handle the case where the difference in exponents is less than 53 as in printf_fphex.c. - math_ldbl.h (ldbl_extract_mantissa): Same as above, but worse, with code testing for exponent > 1 for some reason, probably a typo for >= 1. - math_ldbl.h (ldbl_insert_mantissa): Round the high double as per mpn2ldbl.c (hi is odd or explicit mantissas non-zero) so that the number we return won't change when applying ldbl_canonicalize(). Add missing overflow checks and normalisation of high mantissa. Correct misleading comment: "The hidden bit of the lo mantissa is zero" is not always true as can be seen from the code rounding the hi mantissa. Also by inspection, lzcount can never be less than zero so remove that test. Lastly, masking bitfields to their widths can be left to the compiler. - mpn2ldbl.c: The overflow checks here on rounding of high double were just plain wrong. Incrementing the exponent must be accompanied by a shift right of the mantissa to keep the value unchanged. Above notes for ldbl_insert_mantissa are also relevant. [BZ #15680] * sysdeps/ieee754/ldbl-128ibm/e_rem_pio2l.c: Comment fix. * sysdeps/ieee754/ldbl-128ibm/printf_fphex.c (PRINT_FPHEX_LONG_DOUBLE): Tidy code by moving -53 into ediff calculation. Remove unnecessary test for denormal exponent. * sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c (__mpn_extract_long_double): Correct handling of denormals. Avoid undefined shift behaviour. Correct normalisation of low mantissa when low double is denormal. * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_extract_mantissa): Likewise. Comment. Use uint64_t* for hi64. (ldbl_insert_mantissa): Make both hi64 and lo64 parms uint64_t. Correct normalisation of low mantissa. Test for overflow of high mantissa and normalise. (ldbl_nearbyint): Use more readable constant for two52. * sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c (__mpn_construct_long_double): Fix test for overflow of high mantissa and correct normalisation. Avoid undefined shift.
* IBM long double mechanical changes to support little-endianAlan Modra2013-10-0410-184/+145
| | | | | | | | | | | | | | | | | | | | | | | http://sourceware.org/ml/libc-alpha/2013-07/msg00001.html This patch starts the process of supporting powerpc64 little-endian long double in glibc. IBM long double is an array of two ieee doubles, so making union ibm_extended_long_double reflect this fact is the correct way to access fields of the doubles. * sysdeps/ieee754/ldbl-128ibm/ieee754.h (union ibm_extended_long_double): Define as an array of ieee754_double. (IBM_EXTENDED_LONG_DOUBLE_BIAS): Delete. * sysdeps/ieee754/ldbl-128ibm/printf_fphex.c: Update all references to ibm_extended_long_double and IBM_EXTENDED_LONG_DOUBLE_BIAS. * sysdeps/ieee754/ldbl-128ibm/e_exp10l.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/e_expl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h: Likewise. * sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/strtold_l.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/x2y2m1l.c: Likewise.
* Consolidate common code into macrosSiddhesh Poyarekar2013-09-191-74/+62
| | | | | Consolidated common Taylor series polynomials into macros in s_sin.c to make it a bit cleaner.
* Consolidate sin/cos table lookup codeSiddhesh Poyarekar2013-09-191-114/+35
|
* Consolidate sin/cos computation for large inputsSiddhesh Poyarekar2013-09-191-47/+36
|
* Remove redundant goto linesSiddhesh Poyarekar2013-09-191-40/+3
|
* Format sincos32.cSiddhesh Poyarekar2013-09-181-236/+254
|
* Remove DO_NOT_USE_THIS conditionals.Ondřej Bílka2013-09-105-97/+0
|
* Remove --disable-versioning.Joseph Myers2013-09-041-1/+1
|
* Fix lgammaf spurious underflow (bug 15427).Joseph Myers2013-09-031-2/+2
|
* Fix spurious jnf underflows (bug 14155).Joseph Myers2013-09-021-2/+2
|
* Fix typos.Ondřej Bílka2013-08-303-3/+3
|
* [BZ #15522] strtod ("nan(N)") returning a sNaN in some casesThomas Schwinge2013-08-295-20/+41
|
* Fix cproj handling of (finite, NaN) arguments (bug 15531).Joseph Myers2013-08-201-3/+1
|
* Fix cbrtl for ldbl-96Andreas Schwab2013-08-131-1/+1
|
* Fix spurious "inexact" exceptions from dbl-64 sqrt (bug 15631).Joseph Myers2013-06-151-2/+15
|
* Fix leading whitespaces.Ondrej Bilka2013-06-0619-48/+48
|
* Remove trailing whitespace.Joseph Myers2013-06-0530-217/+217
|
* Fix ldbl-96 hypotl of subnormals (bug 15529).Joseph Myers2013-05-241-1/+1
|
* Fix nearbyint scheduling of arithmetic past fesetenv (bug 15490).Joseph Myers2013-05-195-0/+13
|
* Fix remainder exceptions and directed-rounding results (bugs 15480, 15485).Joseph Myers2013-05-171-0/+1
|
* Add #include <stdint.h> for uint[32|64]_t usage (except installed headers).Ryan S. Arnold2013-05-1610-2/+10
|
* Make _LIB_VERSION a weak symbolSiddhesh Poyarekar2013-05-131-4/+5
| | | | | | | That way it can live alongside _LIB_VERSION in libieee.a for statically compiled programs. Resolves #14582.
* Fix ldbl-128ibm cos range reduction near pi/2 (bug 15359).Joseph Myers2013-05-091-5/+5
|
* Fix ldbl-128 cos range reduction near pi/2 (bug 15429).Joseph Myers2013-05-091-5/+5
|
* Improve tgamma accuracy (bugs 2546, 2560, 5159, 15426).Joseph Myers2013-05-0812-32/+1035
|
* Format s_sin.cSiddhesh Poyarekar2013-04-301-904/+1212
|
* [BZ #14686, #15336] Fix standard compliance. Don't use hard-coded qNaN values.Thomas Schwinge2013-04-052-12/+10
|
* [BZ #15335, #15342] Fix standard compliance. Don't use hard-coded qNaN values.Thomas Schwinge2013-04-052-9/+9
|
* Remove unreachable code.Thomas Schwinge2013-04-051-2/+1
| | | | The case of y == 0 is handled at the beginning of the function.
* Remove unused hard-coded qNaN definition.Thomas Schwinge2013-04-051-2/+0
|
* Remove TWOSiddhesh Poyarekar2013-04-032-3/+1
| | | | | Minor cleanup to remove the macro TWO and use the value directly instead.
* Use mantissa_t in mpexpSiddhesh Poyarekar2013-04-022-3/+4
|
* New <math.h> macro named issignaling to check for a signaling NaN (sNaN).Thomas Schwinge2013-04-026-0/+264
| | | | It is based on draft TS 18661 and currently enabled as a GNU extension.
* Remove ONE and MONESiddhesh Poyarekar2013-03-297-22/+20
|
* Format s_tan.cSiddhesh Poyarekar2013-03-291-405/+728
|
* Remove ZERO and MZERO macrosSiddhesh Poyarekar2013-03-296-53/+51
|
* Format s_atan.cSiddhesh Poyarekar2013-03-291-151/+246
|
* Format e_log.cSiddhesh Poyarekar2013-03-291-95/+133
|
* Fix e_logl (128ibm) spurious underflowAdhemerval Zanella2013-03-281-2/+11
|
* Format and clean up s_atan2.cSiddhesh Poyarekar2013-03-281-310/+494
|
* Use integral constantsSiddhesh Poyarekar2013-03-261-76/+76
| | | | | | The compiler is smart enough to convert those into double for powerpc, but if we put them as doubles, it adds overhead by performing those operations in floating point mode.
* Removed commented codeSiddhesh Poyarekar2013-03-2611-85/+0
|
* Make mantissa type of mp_no configurableSiddhesh Poyarekar2013-03-263-69/+101
| | | | | | | | | | The mantissa of mp_no is intended to take only integral values. This is a relatively good choice for powerpc due to its 4 fpus, but not for other architectures, which suffer due to this choice. This change makes the default mantissa a long integer and allows powerpc to override it. Additionally, some operations have been optimized for integer manipulation, resulting in a significant improvement in performance.
* BZ#13889: expl (709.75) wrongly overflows for ldbl-128ibmAdhemerval Zanella2013-03-222-6/+24
| | | | | | The patch increase the high value to check if expl overflows. Current high mark value is not really correct, the algorithm accepts high values. It also adds a correct wrapper function to check for overflow and underflow.
* Fix Bessel function spurious overflows for ldbl-128 / ldbl-128ibm (bug 15285).Joseph Myers2013-03-212-20/+34
|
* Replace 8388608.0 with HALFRAD in mp codeSiddhesh Poyarekar2013-03-212-3/+3
| | | | Minor cleanup
* Fix y1l spurious overflows for ldbl-96 (bug 15283).Joseph Myers2013-03-161-1/+1
|
* Fix spurious underflow exceptions for Bessel functions for ldbl-128 / ↵Joseph Myers2013-03-162-58/+79
| | | | ldbl-128ibm (bug 14155).
* Better distinguish between NaN/qNaN/sNaN.Thomas Schwinge2013-03-151-5/+5
|