public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16560] New: spurious underflow exception from exp2
@ 2014-02-12  9:53 zimmerma+gcc at loria dot fr
  2014-02-12 10:44 ` [Bug math/16560] spurious underflow exception from exp2/exp10 zimmerma+gcc at loria dot fr
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2014-02-12  9:53 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 16560
           Summary: spurious underflow exception from exp2
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: zimmerma+gcc at loria dot fr

on x86_64 I get:

Testing function exp2 for exponent 0 [seed=11871].
 rounding mode MPFR_RNDN:
      wrong underflow flag: mpfr gives 0, library 16
      x=8.000000@-38
      library gives 1.000000
      mpfr    gives 1.000000

since the result is 1, there should be no underflow exception!

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug math/16560] spurious underflow exception from exp2/exp10
  2014-02-12  9:53 [Bug math/16560] New: spurious underflow exception from exp2 zimmerma+gcc at loria dot fr
@ 2014-02-12 10:44 ` zimmerma+gcc at loria dot fr
  2014-02-12 10:51 ` zimmerma+gcc at loria dot fr
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2014-02-12 10:44 UTC (permalink / raw)
  To: glibc-bugs

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

Paul Zimmermann <zimmerma+gcc at loria dot fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|spurious underflow          |spurious underflow
                   |exception from exp2         |exception from exp2/exp10

--- Comment #1 from Paul Zimmermann <zimmerma+gcc at loria dot fr> ---
idem in double precision with exp10:

Testing function exp10 for exponent 0 [seed=14309].
 rounding mode MPFR_RNDN:
      wrong underflow flag for x=4.0000000000000@-269
      library gives 1.0000000000000
      mpfr    gives 1.0000000000000
      underflow: mpfr 0, library 16

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug math/16560] spurious underflow exception from exp2/exp10
  2014-02-12  9:53 [Bug math/16560] New: spurious underflow exception from exp2 zimmerma+gcc at loria dot fr
  2014-02-12 10:44 ` [Bug math/16560] spurious underflow exception from exp2/exp10 zimmerma+gcc at loria dot fr
@ 2014-02-12 10:51 ` zimmerma+gcc at loria dot fr
  2014-02-12 13:16 ` zimmerma+gcc at loria dot fr
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2014-02-12 10:51 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from Paul Zimmermann <zimmerma+gcc at loria dot fr> ---
same in double precision (for exp2):

Testing function exp2 for exponent 0 [seed=14309].
 rounding mode MPFR_RNDN:
      wrong underflow flag: mpfr gives 0, library 16
      x=4.0000000000000@-269
      library gives 1.0000000000000
      mpfr    gives 1.0000000000000

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug math/16560] spurious underflow exception from exp2/exp10
  2014-02-12  9:53 [Bug math/16560] New: spurious underflow exception from exp2 zimmerma+gcc at loria dot fr
  2014-02-12 10:44 ` [Bug math/16560] spurious underflow exception from exp2/exp10 zimmerma+gcc at loria dot fr
  2014-02-12 10:51 ` zimmerma+gcc at loria dot fr
@ 2014-02-12 13:16 ` zimmerma+gcc at loria dot fr
  2014-02-12 13:22 ` zimmerma+gcc at loria dot fr
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2014-02-12 13:16 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from Paul Zimmermann <zimmerma+gcc at loria dot fr> ---
and in extended precision for exp2:

Testing function exp2 for exponent 0 [seed=16203].
 rounding mode MPFR_RNDN:
      wrong underflow flag: mpfr gives 0, library 16
      x=8.0000000000000000@-4112
      library gives 1.0000000000000000
      mpfr    gives 1.0000000000000000

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug math/16560] spurious underflow exception from exp2/exp10
  2014-02-12  9:53 [Bug math/16560] New: spurious underflow exception from exp2 zimmerma+gcc at loria dot fr
                   ` (2 preceding siblings ...)
  2014-02-12 13:16 ` zimmerma+gcc at loria dot fr
@ 2014-02-12 13:22 ` zimmerma+gcc at loria dot fr
  2014-03-27 18:42 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2014-02-12 13:22 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #4 from Paul Zimmermann <zimmerma+gcc at loria dot fr> ---
and in extended precision for exp10:

Testing function exp10 for exponent 0 [seed=16203].
 rounding mode MPFR_RNDN:
      wrong underflow flag: mpfr gives 0, library 16
      x=8.0000000000000000@-4112
      library gives 1.0000000000000000
      mpfr    gives 1.0000000000000000

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug math/16560] spurious underflow exception from exp2/exp10
  2014-02-12  9:53 [Bug math/16560] New: spurious underflow exception from exp2 zimmerma+gcc at loria dot fr
                   ` (3 preceding siblings ...)
  2014-02-12 13:22 ` zimmerma+gcc at loria dot fr
@ 2014-03-27 18:42 ` cvs-commit at gcc dot gnu.org
  2014-06-13  8:38 ` fweimer at redhat dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-03-27 18:42 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #5 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  03a7091fa2afc84e215fc99fceca52baa4b0f8f1 (commit)
      from  dd3022d75e6fb8957843d6d84257a5d8457822d5 (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=03a7091fa2afc84e215fc99fceca52baa4b0f8f1

commit 03a7091fa2afc84e215fc99fceca52baa4b0f8f1
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Mar 27 18:41:14 2014 +0000

    Fix x86/x86_64 expl/exp10l spurious underflows (bug 16348).

    This patch fixes bug 16348, spurious underflows from x86/x86_64 expl
    on arguments close to 0.  These implementations effectively use expm1
    (on the fractional part of the argument) internally, so resulting in
    spurious underflows when the result is very close to 1.  For arguments
    small enough that the round-to-nearest correct result is 1, this patch
    uses 1+x instead.

    These implementations are also used for exp10l and so the patch fixes
    similar issues there (the 0x1p-67 threshold being small enough to be
    correct for exp10l as well as expl).  But because of spurious
    underflows in other exp10 implementations (bug 16560), the tests
    aren't added for exp10 at this point - they can be added when the
    other exp10 parts of that bug are fixed.

    Tested x86_64 and x86; no ulps updates needed.

        [BZ #16348]
        * sysdeps/i386/fpu/e_expl.S (IEEE754_EXPL) [!USE_AS_EXPM1L]: Use
        1+x for argument with exponent below -67.
        * sysdeps/x86_64/fpu/e_expl.S (IEEE754_EXPL) [!USE_AS_EXPM1L]:
        Likewise.
        * math/auto-libm-test-in: Add more tests of exp.
        * math/auto-libm-test-out: Regenerated.

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

Summary of changes:
 ChangeLog                   |   10 +
 NEWS                        |   10 +-
 math/auto-libm-test-in      |   18 ++
 math/auto-libm-test-out     |  666 +++++++++++++++++++++++++++++++++++++++++++
 sysdeps/i386/fpu/e_expl.S   |   10 +-
 sysdeps/x86_64/fpu/e_expl.S |   10 +-
 6 files changed, 715 insertions(+), 9 deletions(-)

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug math/16560] spurious underflow exception from exp2/exp10
  2014-02-12  9:53 [Bug math/16560] New: spurious underflow exception from exp2 zimmerma+gcc at loria dot fr
                   ` (4 preceding siblings ...)
  2014-03-27 18:42 ` cvs-commit at gcc dot gnu.org
@ 2014-06-13  8:38 ` fweimer at redhat dot com
  2014-06-25 11:34 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13  8:38 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug math/16560] spurious underflow exception from exp2/exp10
  2014-02-12  9:53 [Bug math/16560] New: spurious underflow exception from exp2 zimmerma+gcc at loria dot fr
                   ` (5 preceding siblings ...)
  2014-06-13  8:38 ` fweimer at redhat dot com
@ 2014-06-25 11:34 ` cvs-commit at gcc dot gnu.org
  2015-02-12 19:03 ` cvs-commit at gcc dot gnu.org
  2015-02-12 19:04 ` jsm28 at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-06-25 11:34 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #6 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  a638de828d877376fb238efc8b0bc9220dd2601e (commit)
      from  0f5b71850e7ae2a4fefade72c73556166d52bc93 (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=a638de828d877376fb238efc8b0bc9220dd2601e

commit a638de828d877376fb238efc8b0bc9220dd2601e
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Jun 25 11:33:22 2014 +0000

    Fix exp10 spurious underflows (bug 16560).

    This patch fixes spurious underflows from exp10 for arguments near 0
    (part of bug 16560; that bug also includes spurious underflows from
    exp2, which are not fixed by this patch).  The problem is underflows
    in the internal computation converting the exp10 argument to arguments
    for exp (with extra precision), and the fix is simply to return 1
    early for arguments near enough to 0 (just as arguments with large
    enough magnitude have their own overflow / underflow logic at the
    start of the function).

    Tested x86_64 and x86 and ulps updated accordingly; also tested for
    powerpc32 and mips64 to validate the ldbl-128ibm and ldbl-128 changes.

        [BZ #16560]
        * sysdeps/ieee754/dbl-64/e_exp10.c (__ieee754_exp10): Return 1 for
        arguments close to 0.
        * sysdeps/ieee754/ldbl-128/e_exp10l.c (__ieee754_exp10l):
        Likewise.
        * sysdeps/ieee754/ldbl-128ibm/e_exp10l.c (__ieee754_exp10l):
        Likewise.
        * math/auto-libm-test-in: Add more tests of exp10.
        * math/auto-libm-test-out: Regenerated.
        * sysdeps/x86_64/fpu/libm-test-ulps: Update.

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

Summary of changes:
 ChangeLog                              |   11 +
 math/auto-libm-test-in                 |   18 +
 math/auto-libm-test-out                |  666 ++++++++++++++++++++++++++++++++
 sysdeps/ieee754/dbl-64/e_exp10.c       |    2 +
 sysdeps/ieee754/ldbl-128/e_exp10l.c    |    2 +
 sysdeps/ieee754/ldbl-128ibm/e_exp10l.c |    2 +
 sysdeps/x86_64/fpu/libm-test-ulps      |    8 +
 7 files changed, 709 insertions(+), 0 deletions(-)

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug math/16560] spurious underflow exception from exp2/exp10
  2014-02-12  9:53 [Bug math/16560] New: spurious underflow exception from exp2 zimmerma+gcc at loria dot fr
                   ` (6 preceding siblings ...)
  2014-06-25 11:34 ` cvs-commit at gcc dot gnu.org
@ 2015-02-12 19:03 ` cvs-commit at gcc dot gnu.org
  2015-02-12 19:04 ` jsm28 at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-02-12 19:03 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #8 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  03d95bd48319256bd29cfaece45919fc58bf56cc (commit)
      from  98408b95b155464e760c22dce4842f29499db821 (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=03d95bd48319256bd29cfaece45919fc58bf56cc

commit 03d95bd48319256bd29cfaece45919fc58bf56cc
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Feb 12 19:02:45 2015 +0000

    Fix exp2 spurious underflows (bug 16560).

    This patch fixes the remaining part of bug 16560, spurious underflows
    from exp2 of arguments close to 0 (when the result is close to 1, so
    should not underflow), by just using 1+x instead of a more complicated
    calculation when the argument is sufficiently small.

    Tested for x86_64, x86 and mips64.

        [BZ #16560]
        * math/e_exp2l.c [LDBL_MANT_DIG == 106] (LDBL_EPSILON): Undefine
        and redefine.
        (__ieee754_exp2l): Do not multiply small fractional parts by
        M_LN2l.
        * sysdeps/i386/fpu/e_exp2l.S (__ieee754_exp2l): Just add 1 to
        small argument.
        * sysdeps/ieee754/dbl-64/e_exp2.c (__ieee754_exp2): Likewise.
        * sysdeps/ieee754/flt-32/e_exp2f.c (__ieee754_exp2f): Likewise.
        * sysdeps/x86_64/fpu/e_exp2l.S (__ieee754_exp2l): Likewise.
        * math/auto-libm-test-in: Add more tests of exp2.
        * math/auto-libm-test-out: Regenerated.

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

Summary of changes:
 ChangeLog                        |   15 +
 NEWS                             |    2 +-
 math/auto-libm-test-in           |   18 +
 math/auto-libm-test-out          |  666 ++++++++++++++++++++++++++++++++++++++
 math/e_exp2l.c                   |    9 +
 sysdeps/i386/fpu/e_exp2l.S       |   10 +-
 sysdeps/ieee754/dbl-64/e_exp2.c  |    3 +
 sysdeps/ieee754/flt-32/e_exp2f.c |    3 +
 sysdeps/x86_64/fpu/e_exp2l.S     |   10 +-
 9 files changed, 733 insertions(+), 3 deletions(-)

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug math/16560] spurious underflow exception from exp2/exp10
  2014-02-12  9:53 [Bug math/16560] New: spurious underflow exception from exp2 zimmerma+gcc at loria dot fr
                   ` (7 preceding siblings ...)
  2015-02-12 19:03 ` cvs-commit at gcc dot gnu.org
@ 2015-02-12 19:04 ` jsm28 at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-02-12 19:04 UTC (permalink / raw)
  To: glibc-bugs

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

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
Fixed for 2.22.

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-02-12 19:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12  9:53 [Bug math/16560] New: spurious underflow exception from exp2 zimmerma+gcc at loria dot fr
2014-02-12 10:44 ` [Bug math/16560] spurious underflow exception from exp2/exp10 zimmerma+gcc at loria dot fr
2014-02-12 10:51 ` zimmerma+gcc at loria dot fr
2014-02-12 13:16 ` zimmerma+gcc at loria dot fr
2014-02-12 13:22 ` zimmerma+gcc at loria dot fr
2014-03-27 18:42 ` cvs-commit at gcc dot gnu.org
2014-06-13  8:38 ` fweimer at redhat dot com
2014-06-25 11:34 ` cvs-commit at gcc dot gnu.org
2015-02-12 19:03 ` cvs-commit at gcc dot gnu.org
2015-02-12 19:04 ` jsm28 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).