public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/16561] New: Bad overflowing y0/y1/yn results for directed rounding
@ 2014-02-12 10:20 zimmerma+gcc at loria dot fr
  2014-02-12 10:22 ` [Bug math/16561] " zimmerma+gcc at loria dot fr
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2014-02-12 10:20 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 16561
           Summary: Bad overflowing y0/y1/yn results for directed rounding
           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 in single precision (y17 means yn with n=17):

Testing function y17 for exponent 0 [seed=14309].
 rounding mode MPFR_RNDU:
      wrong overflow for x=4.0000000000000@-269
      library gives -@Inf@
      mpfr    gives -f.ffffffffffff8@255

Since rounding is towards +Inf, the result should not be -Inf.

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


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

* [Bug math/16561] Bad overflowing y0/y1/yn results for directed rounding
  2014-02-12 10:20 [Bug math/16561] New: Bad overflowing y0/y1/yn results for directed rounding zimmerma+gcc at loria dot fr
@ 2014-02-12 10:22 ` zimmerma+gcc at loria dot fr
  2014-02-12 12:47 ` zimmerma+gcc at loria dot fr
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2014-02-12 10:22 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #1 from Paul Zimmermann <zimmerma+gcc at loria dot fr> ---
> on x86_64 in single precision

sorry this is double precision of course

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


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

* [Bug math/16561] Bad overflowing y0/y1/yn results for directed rounding
  2014-02-12 10:20 [Bug math/16561] New: Bad overflowing y0/y1/yn results for directed rounding zimmerma+gcc at loria dot fr
  2014-02-12 10:22 ` [Bug math/16561] " zimmerma+gcc at loria dot fr
@ 2014-02-12 12:47 ` zimmerma+gcc at loria dot fr
  2014-06-12 17:09 ` jsm28 at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2014-02-12 12:47 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from Paul Zimmermann <zimmerma+gcc at loria dot fr> ---
same in extended precision:

Testing function y17 for exponent 0 [seed=16203].
 rounding mode MPFR_RNDU:
      wrong overflow for x=8.0000000000000000@-4112
      library gives -@Inf@
      mpfr    gives -f.fffffffffffffff0@4095

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


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

* [Bug math/16561] Bad overflowing y0/y1/yn results for directed rounding
  2014-02-12 10:20 [Bug math/16561] New: Bad overflowing y0/y1/yn results for directed rounding zimmerma+gcc at loria dot fr
  2014-02-12 10:22 ` [Bug math/16561] " zimmerma+gcc at loria dot fr
  2014-02-12 12:47 ` zimmerma+gcc at loria dot fr
@ 2014-06-12 17:09 ` jsm28 at gcc dot gnu.org
  2014-06-13  8:38 ` fweimer at redhat dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-06-12 17:09 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
The bug summary refers to y0 and y1, but y0 can't overflow and no test inputs
are given to show a problem with y1.  As far as I can see, there can be results
inconsistent with the rounding mode for overflowing yn (-1, ...) (negating a
result from y1), but not for y1.  If you see incorrect overflowing results for
y1, please give a test input that shows them.

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


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

* [Bug math/16561] Bad overflowing y0/y1/yn results for directed rounding
  2014-02-12 10:20 [Bug math/16561] New: Bad overflowing y0/y1/yn results for directed rounding zimmerma+gcc at loria dot fr
                   ` (2 preceding siblings ...)
  2014-06-12 17:09 ` jsm28 at gcc dot gnu.org
@ 2014-06-13  8:38 ` fweimer at redhat dot com
  2014-06-13  9:38 ` [Bug math/16561] Bad overflowing yn " zimmerma+gcc at loria dot fr
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ 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=16561

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] 8+ messages in thread

* [Bug math/16561] Bad overflowing yn results for directed rounding
  2014-02-12 10:20 [Bug math/16561] New: Bad overflowing y0/y1/yn results for directed rounding zimmerma+gcc at loria dot fr
                   ` (3 preceding siblings ...)
  2014-06-13  8:38 ` fweimer at redhat dot com
@ 2014-06-13  9:38 ` zimmerma+gcc at loria dot fr
  2014-06-27 14:53 ` cvs-commit at gcc dot gnu.org
  2014-06-27 14:55 ` jsm28 at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: zimmerma+gcc at loria dot fr @ 2014-06-13  9:38 UTC (permalink / raw)
  To: glibc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Bad overflowing y0/y1/yn    |Bad overflowing yn results
                   |results for directed        |for directed rounding
                   |rounding                    |

--- Comment #4 from Paul Zimmermann <zimmerma+gcc at loria dot fr> ---
Joseph, you are right, this can only happen for yn for n >= 2.
I've updated the summary accordingly.

Paul

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


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

* [Bug math/16561] Bad overflowing yn results for directed rounding
  2014-02-12 10:20 [Bug math/16561] New: Bad overflowing y0/y1/yn results for directed rounding zimmerma+gcc at loria dot fr
                   ` (4 preceding siblings ...)
  2014-06-13  9:38 ` [Bug math/16561] Bad overflowing yn " zimmerma+gcc at loria dot fr
@ 2014-06-27 14:53 ` cvs-commit at gcc dot gnu.org
  2014-06-27 14:55 ` jsm28 at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-06-27 14:53 UTC (permalink / raw)
  To: glibc-bugs

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

--- 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  be25493251c014a696b62834b0e63b155d8fe353 (commit)
      from  b351d85aa284f81271bc93e11301e1c2466b7c82 (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=be25493251c014a696b62834b0e63b155d8fe353

commit be25493251c014a696b62834b0e63b155d8fe353
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Jun 27 14:52:13 2014 +0000

    Fix yn overflow handling in non-default rounding modes (bug 16561, bug
16562).

    This patch fixes bugs 16561 and 16562, bad results of yn in overflow
    cases in non-default rounding modes, both because an intermediate
    overflow in the recurrence does not get detected if the result is not
    an infinity and because an overflowing result may occur in the wrong
    sign.  The fix is to set FE_TONEAREST mode internally for the parts of
    the function where such overflows can occur (which includes the call
    to y1 - where yn is used to compute a Bessel function of order -1,
    negating the result of y1 isn't correct for overflowing results in
    directed rounding modes) and then compute an overflowing value in the
    original rounding mode if the to-nearest result was an infinity.

    Tested x86_64 and x86 and ulps updated accordingly.  Also tested for
    mips64 and powerpc32 to test the ldbl-128 and ldbl-128ibm changes.

    (The tests for these bugs were added in my previous y1 patch, so the
    only thing this patch has to do with the testsuite is enable yn
    testing in all rounding modes.)

        [BZ #16561]
        [BZ #16562]
        * sysdeps/ieee754/dbl-64/e_jn.c: Include <float.h>.
        (__ieee754_yn): Set FE_TONEAREST mode internally and then
        recompute overflowing results in original rounding mode.
        * sysdeps/ieee754/flt-32/e_jnf.c: Include <float.h>.
        (__ieee754_ynf): Set FE_TONEAREST mode internally and then
        recompute overflowing results in original rounding mode.
        * sysdeps/ieee754/ldbl-128/e_jnl.c: Include <float.h>.
        (__ieee754_ynl): Set FE_TONEAREST mode internally and then
        recompute overflowing results in original rounding mode.
        * sysdeps/ieee754/ldbl-128ibm/e_jnl.c: Include <float.h>.
        (__ieee754_ynl): Set FE_TONEAREST mode internally and then
        recompute overflowing results in original rounding mode.
        * sysdeps/ieee754/ldbl-96/e_jnl.c: Include <float.h>.
        (__ieee754_ynl): Set FE_TONEAREST mode internally and then
        recompute overflowing results in original rounding mode.
        * sysdeps/i386/fpu/fenv_private.h [!__SSE2_MATH__]
        (libc_feholdsetround_ctx): New macro.
        * math/libm-test.inc (yn_test): Use ALL_RM_TEST.
        * sysdeps/i386/fpu/libm-test-ulps: Update.
        * sysdeps/x86_64/fpu/libm-test-ulps : Likewise.

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

Summary of changes:
 ChangeLog                           |   25 ++++++
 NEWS                                |   20 +++---
 math/libm-test.inc                  |    4 +-
 sysdeps/i386/fpu/fenv_private.h     |    1 +
 sysdeps/i386/fpu/libm-test-ulps     |   24 ++++++
 sysdeps/ieee754/dbl-64/e_jn.c       |  117 ++++++++++++++++-------------
 sysdeps/ieee754/flt-32/e_jnf.c      |   16 ++++-
 sysdeps/ieee754/ldbl-128/e_jnl.c    |  139 ++++++++++++++++++----------------
 sysdeps/ieee754/ldbl-128ibm/e_jnl.c |  143 +++++++++++++++++++----------------
 sysdeps/ieee754/ldbl-96/e_jnl.c     |  137 ++++++++++++++++++---------------
 sysdeps/x86_64/fpu/libm-test-ulps   |   24 ++++++
 11 files changed, 389 insertions(+), 261 deletions(-)

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


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

* [Bug math/16561] Bad overflowing yn results for directed rounding
  2014-02-12 10:20 [Bug math/16561] New: Bad overflowing y0/y1/yn results for directed rounding zimmerma+gcc at loria dot fr
                   ` (5 preceding siblings ...)
  2014-06-27 14:53 ` cvs-commit at gcc dot gnu.org
@ 2014-06-27 14:55 ` jsm28 at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-06-27 14:55 UTC (permalink / raw)
  To: glibc-bugs

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

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

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

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

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


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

end of thread, other threads:[~2014-06-27 14:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 10:20 [Bug math/16561] New: Bad overflowing y0/y1/yn results for directed rounding zimmerma+gcc at loria dot fr
2014-02-12 10:22 ` [Bug math/16561] " zimmerma+gcc at loria dot fr
2014-02-12 12:47 ` zimmerma+gcc at loria dot fr
2014-06-12 17:09 ` jsm28 at gcc dot gnu.org
2014-06-13  8:38 ` fweimer at redhat dot com
2014-06-13  9:38 ` [Bug math/16561] Bad overflowing yn " zimmerma+gcc at loria dot fr
2014-06-27 14:53 ` cvs-commit at gcc dot gnu.org
2014-06-27 14:55 ` 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).