public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/17803] New: scalblnl differs from scabnl and ldexpl (with radix 2)
@ 2015-01-06 11:22 walter.mascarenhas at gmail dot com
  2015-01-06 11:23 ` [Bug libc/17803] " walter.mascarenhas at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: walter.mascarenhas at gmail dot com @ 2015-01-06 11:22 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 17803
           Summary: scalblnl differs from scabnl and ldexpl (with radix 2)
           Product: glibc
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: walter.mascarenhas at gmail dot com
                CC: drepper.fsp at gmail dot com

Created attachment 8046
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8046&action=edit
test case illustrating the problem

It would be convenient if the functions scalbnl, ldexpl (when the radix = 2)
and scalblnl delivered the same results when the exponents were within the
common range supported by these functions. However, when rounding to nearest,
scalblnl may deliver a result that differs from the one obtained by ldexpl and
scalbnl
(please see the enclosed main.cc file)

I do not have a copy of the ISO/IEC 60559 standard and therefore I cannot tell
whether this behavior is compatible with the standard. However, there is much
confusion this point in some webpages, and it would be nice if glibc's
documentation contained a detailed description of the outupt in all possible
cases.

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


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

* [Bug libc/17803] scalblnl differs from scabnl and ldexpl (with radix 2)
  2015-01-06 11:22 [Bug libc/17803] New: scalblnl differs from scabnl and ldexpl (with radix 2) walter.mascarenhas at gmail dot com
@ 2015-01-06 11:23 ` walter.mascarenhas at gmail dot com
  2015-01-06 17:35 ` [Bug math/17803] " jsm28 at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: walter.mascarenhas at gmail dot com @ 2015-01-06 11:23 UTC (permalink / raw)
  To: glibc-bugs

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

walter.mascarenhas at gmail dot com <walter.mascarenhas at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |walter.mascarenhas at gmail dot co
                   |                            |m

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


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

* [Bug math/17803] scalblnl differs from scabnl and ldexpl (with radix 2)
  2015-01-06 11:22 [Bug libc/17803] New: scalblnl differs from scabnl and ldexpl (with radix 2) walter.mascarenhas at gmail dot com
  2015-01-06 11:23 ` [Bug libc/17803] " walter.mascarenhas at gmail dot com
@ 2015-01-06 17:35 ` jsm28 at gcc dot gnu.org
  2015-01-12 22:36 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-01-06 17:35 UTC (permalink / raw)
  To: glibc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libc                        |math

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


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

* [Bug math/17803] scalblnl differs from scabnl and ldexpl (with radix 2)
  2015-01-06 11:22 [Bug libc/17803] New: scalblnl differs from scabnl and ldexpl (with radix 2) walter.mascarenhas at gmail dot com
  2015-01-06 11:23 ` [Bug libc/17803] " walter.mascarenhas at gmail dot com
  2015-01-06 17:35 ` [Bug math/17803] " jsm28 at gcc dot gnu.org
@ 2015-01-12 22:36 ` cvs-commit at gcc dot gnu.org
  2015-01-12 23:03 ` cvs-commit at gcc dot gnu.org
  2015-01-12 23:04 ` jsm28 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-01-12 22:36 UTC (permalink / raw)
  To: glibc-bugs

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

--- 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  34e93d6c76b7a6eaf94697a172b958704fd33396 (commit)
      from  ca677d3c3cd0eba7d1f03092517aea553a0e8569 (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=34e93d6c76b7a6eaf94697a172b958704fd33396

commit 34e93d6c76b7a6eaf94697a172b958704fd33396
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Jan 12 22:34:58 2015 +0000

    Fix ldbl-96 scalblnl for subnormal arguments (bug 17834).

    The ldbl-96 implementation of scalblnl (used for x86_64 and ia64) is
    incorrect for subnormal arguments (this is a separate bug from bug
    17803, which is about underflowing results).  There are two problems
    with the adjustments of subnormal arguments: the "two63" variable
    multiplied by is actually 0x1p52L not 0x1p63L, so is insufficient to
    make values normal, and then GET_LDOUBLE_EXP(es,x), used to extract
    the new exponent, extracts it into a variable that isn't used, while
    the value taken to by the new exponent is wrongly taken from the high
    part of the mantissa before the adjustment (hx).  This patch fixes
    both those problems and adds appropriate tests.

    Tested for x86_64.

        [BZ #17834]
        * sysdeps/ieee754/ldbl-96/s_scalblnl.c (two63): Change value to
        0x1p63L.
        (__scalblnl): Get new exponent of adjusted subnormal value from ES
        not HX.
        * math/libm-test.inc (scalbn_test_data): Add more tests.
        (scalbln_test_data): Likewise.

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

Summary of changes:
 ChangeLog                            |   10 ++++++++++
 NEWS                                 |    2 +-
 math/libm-test.inc                   |   22 ++++++++++++++++++++++
 sysdeps/ieee754/ldbl-96/s_scalblnl.c |    4 ++--
 4 files changed, 35 insertions(+), 3 deletions(-)

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


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

* [Bug math/17803] scalblnl differs from scabnl and ldexpl (with radix 2)
  2015-01-06 11:22 [Bug libc/17803] New: scalblnl differs from scabnl and ldexpl (with radix 2) walter.mascarenhas at gmail dot com
                   ` (2 preceding siblings ...)
  2015-01-12 22:36 ` cvs-commit at gcc dot gnu.org
@ 2015-01-12 23:03 ` cvs-commit at gcc dot gnu.org
  2015-01-12 23:04 ` jsm28 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-01-12 23:03 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 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  5a9e4c09a2601a8100ea9a1f7bc0360782cd1625 (commit)
      from  34e93d6c76b7a6eaf94697a172b958704fd33396 (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=5a9e4c09a2601a8100ea9a1f7bc0360782cd1625

commit 5a9e4c09a2601a8100ea9a1f7bc0360782cd1625
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Jan 12 23:02:14 2015 +0000

    Fix ldbl-96 scalblnl underflowing results (bug 17803).

    The ldbl-96 implementation of scalblnl (used for x86_64 and ia64) uses
    a condition k <= -63 to determine when a standard underflowing result
    tiny*__copysignl(tiny,x) should be returned.  However, that condition
    corresponds to values with exponent -16446 or less, and in the case of
    -16446, the correct result for round-to-nearest depends on whether the
    value is exactly 0x1p-16446 (half the least subnormal) or more than
    that.  This patch fixes the bug by changing the condition to k <= -64
    and accordingly adjusting the exponent by 64 not 63 when converting to
    a normal value.

    Tested for x86_64.

        [BZ #17803]
        * sysdeps/ieee754/ldbl-96/s_scalblnl.c (twom63): Rename to
        twom64.  Adjust value to 0x1p-64L.
        (__scalblnl): Only return standard underflowing result for K <=
        -64 not K <= -63; adjust exponent for underflowing result by 64
        not 63.
        * math/libm-test.inc (scalbn_test_data): Add more tests.
        (scalbln_test_data): Likewise.

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

Summary of changes:
 ChangeLog                            |    9 ++++++++
 NEWS                                 |    2 +-
 math/libm-test.inc                   |   38 ++++++++++++++++++++++++++++++++++
 sysdeps/ieee754/ldbl-96/s_scalblnl.c |    8 +++---
 4 files changed, 52 insertions(+), 5 deletions(-)

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


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

* [Bug math/17803] scalblnl differs from scabnl and ldexpl (with radix 2)
  2015-01-06 11:22 [Bug libc/17803] New: scalblnl differs from scabnl and ldexpl (with radix 2) walter.mascarenhas at gmail dot com
                   ` (3 preceding siblings ...)
  2015-01-12 23:03 ` cvs-commit at gcc dot gnu.org
@ 2015-01-12 23:04 ` jsm28 at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-01-12 23:04 UTC (permalink / raw)
  To: glibc-bugs

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

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

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

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

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


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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-06 11:22 [Bug libc/17803] New: scalblnl differs from scabnl and ldexpl (with radix 2) walter.mascarenhas at gmail dot com
2015-01-06 11:23 ` [Bug libc/17803] " walter.mascarenhas at gmail dot com
2015-01-06 17:35 ` [Bug math/17803] " jsm28 at gcc dot gnu.org
2015-01-12 22:36 ` cvs-commit at gcc dot gnu.org
2015-01-12 23:03 ` cvs-commit at gcc dot gnu.org
2015-01-12 23: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).