public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/18593] New: csin, csinh bad overflow results in directed rounding modes
@ 2015-06-24 15:54 jsm28 at gcc dot gnu.org
  2015-06-24 16:21 ` [Bug math/18593] " cvs-commit at gcc dot gnu.org
  2015-06-24 16:22 ` jsm28 at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-06-24 15:54 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 18593
           Summary: csin, csinh bad overflow results in directed rounding
                    modes
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
          Assignee: unassigned at sourceware dot org
          Reporter: jsm28 at gcc dot gnu.org
  Target Milestone: ---

csin and csinh can produce bad results when overflowing in directed rounding
modes.  E.g., for float on x86_64:

Failure: Test: Real part of: csin_downward (-0xcp-4 - 0x2.c5d4p+12 i)
Result:
 is:         -3.40282346638528859812e+38  -0x1.fffffe00000000000000p+127
 should be:  -inf  -inf

Failure: Test: Real part of: csinh_downward (-0x2.c5d4p+12 - 0xcp-4 i)
Result:
 is:         -3.40282346638528859812e+38  -0x1.fffffe00000000000000p+127
 should be:  -inf  -inf

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


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

* [Bug math/18593] csin, csinh bad overflow results in directed rounding modes
  2015-06-24 15:54 [Bug math/18593] New: csin, csinh bad overflow results in directed rounding modes jsm28 at gcc dot gnu.org
@ 2015-06-24 16:21 ` cvs-commit at gcc dot gnu.org
  2015-06-24 16:22 ` jsm28 at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-06-24 16:21 UTC (permalink / raw)
  To: glibc-bugs

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

--- 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  ac831b362ad6ecd49643625481ec700a9812e52f (commit)
      from  8475ab16848cf2adb6ce3446749c2f1d10233286 (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=ac831b362ad6ecd49643625481ec700a9812e52f

commit ac831b362ad6ecd49643625481ec700a9812e52f
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Jun 24 16:20:48 2015 +0000

    Fix csin, csinh overflow in directed rounding modes (bug 18593).

    csin and csinh can produce bad results when overflowing in directed
    rounding modes, because a multiplication that can overflow is followed
    by a possible negation.  This patch fixes this by negating one of the
    arguments of the multiplication before the multiplication instead of
    negating the result.

    The new tests for this issue are added to auto-libm-test-in, starting
    use of that file for csin and csinh.  The issue was found in the
    course of moving existing tests for csin and csinh (existing tests, by
    being enabled in more cases than previously, showed the issue for
    float and double but not for long double); that move will now be done
    separately.

    Tested for x86_64 and x86 and ulps updated accordingly.

        [BZ #18593]
        * math/s_csin.c (__csin): Negate before rather than after possibly
        overflowing multiplication.
        * math/s_csinf.c (__csinf): Likewise.
        * math/s_csinh.c (__csinh): Likewise.
        * math/s_csinhf.c (__csinhf): Likewise.
        * math/s_csinhl.c (__csinhl): Likewise.
        * math/s_csinl.c (__csinl): Likewise.
        * math/auto-libm-test-in: Add some tests of csin and csinh.
        * math/auto-libm-test-out: Regenerated.
        * math/libm-test.inc (csin_test_data): Use AUTO_TESTS_c_c.
        (csinh_test_data): Likewise.
        * sysdeps/x86_64/fpu/libm-test-ulps: Update.

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

Summary of changes:
 ChangeLog                         |   14 +++
 NEWS                              |    2 +-
 math/auto-libm-test-in            |   10 ++
 math/auto-libm-test-out           |  200 +++++++++++++++++++++++++++++++++++++
 math/libm-test.inc                |    4 +
 math/s_csin.c                     |    6 +-
 math/s_csinf.c                    |    6 +-
 math/s_csinh.c                    |    6 +-
 math/s_csinhf.c                   |    6 +-
 math/s_csinhl.c                   |    6 +-
 math/s_csinl.c                    |    6 +-
 sysdeps/x86_64/fpu/libm-test-ulps |    8 +-
 12 files changed, 251 insertions(+), 23 deletions(-)

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


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

* [Bug math/18593] csin, csinh bad overflow results in directed rounding modes
  2015-06-24 15:54 [Bug math/18593] New: csin, csinh bad overflow results in directed rounding modes jsm28 at gcc dot gnu.org
  2015-06-24 16:21 ` [Bug math/18593] " cvs-commit at gcc dot gnu.org
@ 2015-06-24 16:22 ` jsm28 at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-06-24 16:22 UTC (permalink / raw)
  To: glibc-bugs

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

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

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

--- Comment #2 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] 3+ messages in thread

end of thread, other threads:[~2015-06-24 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-24 15:54 [Bug math/18593] New: csin, csinh bad overflow results in directed rounding modes jsm28 at gcc dot gnu.org
2015-06-24 16:21 ` [Bug math/18593] " cvs-commit at gcc dot gnu.org
2015-06-24 16:22 ` 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).