public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result
@ 2011-10-17  8:39 kreckel at ginac dot de
  2011-10-29 20:17 ` [Bug math/13305] " kreckel at ginac dot de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: kreckel at ginac dot de @ 2011-10-17  8:39 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13305

             Bug #: 13305
           Summary: cacosh(+/-0.5+0.0*i) returns wrong result
           Product: glibc
           Version: 2.14
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj@suse.de
        ReportedBy: kreckel@ginac.de
    Classification: Unclassified


Created attachment 6007
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6007
patch

The current implementation computes cacosh(0.5+0.0*o)=0.0-1.047*i and
cacosh(-0.5+0.0*i)=0.0-2.094*i. But that result has the wrong sign.

Wes Loewer's patch for BZ#2182 was wrongly applied and should be reverted. The
patch tried to fix the choice of branch cut by inverting res, if Re(res)<0.0.
This is okay for picking the right branch cut but it suffers to the problem
that round-off errors might have occurred in the computation of res. A safer
approach is checking the position of the actual argument z. Indeed, the current
implementation is doing just that a few lines above, but I don't see this in
BZ#2182! Removing the extra test fixes the case.

Impact: A different result is computed only when res, as computed so far, has a
negative real part. But a negative real part of res can only happen due to
round-off errors, as mathematically the argument of log is bounded below by
+1.0.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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/13305] cacosh(+/-0.5+0.0*i) returns wrong result
  2011-10-17  8:39 [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result kreckel at ginac dot de
@ 2011-10-29 20:17 ` kreckel at ginac dot de
  2011-11-19 22:19 ` kreckel at ginac dot de
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: kreckel at ginac dot de @ 2011-10-29 20:17 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13305

--- Comment #1 from Richard B. Kreckel <kreckel at ginac dot de> 2011-10-29 20:16:38 UTC ---
I just see that in order to correctly account for signed zero, the patch has to
be extended. After computing the square root, the condition if (__real__ x <
0.0) should be modified to if (signbit(x)).

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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/13305] cacosh(+/-0.5+0.0*i) returns wrong result
  2011-10-17  8:39 [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result kreckel at ginac dot de
  2011-10-29 20:17 ` [Bug math/13305] " kreckel at ginac dot de
@ 2011-11-19 22:19 ` kreckel at ginac dot de
  2011-11-19 22:21 ` kreckel at ginac dot de
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: kreckel at ginac dot de @ 2011-11-19 22:19 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13305

--- Comment #2 from Richard B. Kreckel <kreckel at ginac dot de> 2011-11-19 22:19:10 UTC ---
I attach a cumulative patch. Please apply. Don't hesitate to contact me if
anything is unclear.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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/13305] cacosh(+/-0.5+0.0*i) returns wrong result
  2011-10-17  8:39 [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result kreckel at ginac dot de
  2011-10-29 20:17 ` [Bug math/13305] " kreckel at ginac dot de
  2011-11-19 22:19 ` kreckel at ginac dot de
@ 2011-11-19 22:21 ` kreckel at ginac dot de
  2011-12-19  9:37 ` aj at suse dot de
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: kreckel at ginac dot de @ 2011-11-19 22:21 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13305

--- Comment #3 from Richard B. Kreckel <kreckel at ginac dot de> 2011-11-19 22:20:38 UTC ---
Created attachment 6066
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6066
cumulative patch

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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/13305] cacosh(+/-0.5+0.0*i) returns wrong result
  2011-10-17  8:39 [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result kreckel at ginac dot de
                   ` (2 preceding siblings ...)
  2011-11-19 22:21 ` kreckel at ginac dot de
@ 2011-12-19  9:37 ` aj at suse dot de
  2011-12-22  2:03 ` drepper.fsp at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: aj at suse dot de @ 2011-12-19  9:37 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13305

Andreas Jaeger <aj at suse dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|aj at suse dot de           |drepper.fsp at gmail dot
                   |                            |com

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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/13305] cacosh(+/-0.5+0.0*i) returns wrong result
  2011-10-17  8:39 [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result kreckel at ginac dot de
                   ` (3 preceding siblings ...)
  2011-12-19  9:37 ` aj at suse dot de
@ 2011-12-22  2:03 ` drepper.fsp at gmail dot com
  2011-12-23 16:04 ` drepper.fsp at gmail dot com
  2014-06-27 11:51 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-12-22  2:03 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13305

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

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

--- Comment #4 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-12-22 02:02:43 UTC ---
I've checked in the patch.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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/13305] cacosh(+/-0.5+0.0*i) returns wrong result
  2011-10-17  8:39 [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result kreckel at ginac dot de
                   ` (4 preceding siblings ...)
  2011-12-22  2:03 ` drepper.fsp at gmail dot com
@ 2011-12-23 16:04 ` drepper.fsp at gmail dot com
  2014-06-27 11:51 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: drepper.fsp at gmail dot com @ 2011-12-23 16:04 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=13305

Ulrich Drepper <drepper.fsp at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bert.barbe at oracle dot
                   |                            |com

--- Comment #5 from Ulrich Drepper <drepper.fsp at gmail dot com> 2011-12-23 16:02:28 UTC ---
*** Bug 12786 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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/13305] cacosh(+/-0.5+0.0*i) returns wrong result
  2011-10-17  8:39 [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result kreckel at ginac dot de
                   ` (5 preceding siblings ...)
  2011-12-23 16:04 ` drepper.fsp at gmail dot com
@ 2014-06-27 11:51 ` fweimer at redhat dot com
  6 siblings, 0 replies; 8+ messages in thread
From: fweimer at redhat dot com @ 2014-06-27 11:51 UTC (permalink / raw)
  To: glibc-bugs

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

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-17  8:39 [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result kreckel at ginac dot de
2011-10-29 20:17 ` [Bug math/13305] " kreckel at ginac dot de
2011-11-19 22:19 ` kreckel at ginac dot de
2011-11-19 22:21 ` kreckel at ginac dot de
2011-12-19  9:37 ` aj at suse dot de
2011-12-22  2:03 ` drepper.fsp at gmail dot com
2011-12-23 16:04 ` drepper.fsp at gmail dot com
2014-06-27 11:51 ` fweimer at redhat dot com

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).