This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/19046] ldbl-128 / ldbl-128ibm lgamma bad overflow handling


https://sourceware.org/bugzilla/show_bug.cgi?id=19046

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  4b84e2471b5f0c9197073395eb77843c6f23e790 (commit)
      from  e27fcd027cbdc2f13bf440177c0434eb9ec3dd28 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4b84e2471b5f0c9197073395eb77843c6f23e790

commit 4b84e2471b5f0c9197073395eb77843c6f23e790
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Oct 1 17:15:54 2015 +0000

    Fix ldbl-128 / ldbl-128ibm lgamma overflow handling (bug 16347, bug 19046).

    The ldbl-128 / ldbl-128ibm implementation of lgamma has problems with
    its handling of large arguments.  It has an overflow threshold that is
    correct only for ldbl-128, despite being used for both types - with
    diagnostic control macros as a temporary measure to disable warnings
    about that constant overflowing for ldbl-128ibm - and it has a
    calculation that's roughly x * log(x) - x, resulting in overflows for
    arguments that are roughly at most a factor 1/log(threshold) below the
    overflow threshold.

    This patch fixes both issues, using an overflow threshold appropriate
    for the type in question and adding another case for large arguments
    that avoids the possible intermediate overflow.

    Tested for x86_64, x86, mips64 and powerpc.

        [BZ #16347]
        [BZ #19046]
        * sysdeps/ieee754/ldbl-128/e_lgammal_r.c: Do not include
        <libc-internal.h>.
        (MAXLGM): Do not use diagnostic control macros.
        [LDBL_MANT_DIG == 106] (MAXLGM): Change value to overflow
        threshold for ldbl-128ibm.
        (__ieee754_lgammal_r): For large arguments, multiply by log - 1
        instead of multiplying by log then subtracting.
        * math/auto-libm-test-in: Add more tests of lgamma.
        * math/auto-libm-test-out: Regenerated.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                              |   12 +
 NEWS                                   |   16 +-
 math/auto-libm-test-in                 |   18 +
 math/auto-libm-test-out                |  642 ++++++++++++++++++++++++++++++++
 sysdeps/ieee754/ldbl-128/e_lgammal_r.c |   13 +-
 5 files changed, 686 insertions(+), 15 deletions(-)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]