This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result
- From: "kreckel at ginac dot de" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Mon, 17 Oct 2011 08:39:20 +0000
- Subject: [Bug math/13305] New: cacosh(+/-0.5+0.0*i) returns wrong result
- Auto-submitted: auto-generated
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.