public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bert.barbe at oracle dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug math/12786] New: cacosh sometimes returning wrong result for real values between -1 and 1
Date: Thu, 19 May 2011 15:49:00 -0000	[thread overview]
Message-ID: <bug-12786-131@http.sourceware.org/bugzilla/> (raw)

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

           Summary: cacosh sometimes returning wrong result for real
                    values between -1 and 1
           Product: glibc
           Version: 2.12
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj@suse.de
        ReportedBy: bert.barbe@oracle.com


Created attachment 5738
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5738
test program

After the fix for http://sourceware.org/bugzilla/show_bug.cgi?id=2182
cacosh, cacoshf and cacoshl can return results with the wrong sign when
the argument is a real value between -1 and 1.
This is because due to rounding errors, the real part of the result is a small
negative value instead of 0. The fix for bz2182 will change the sign of the
result because the real part is negative.

Note that the formula w=clogf(z+ csqrtf(z+1) * csqrtf (z -1)) of other
implementations does give the correct sign right away.

Some examples on a x86_64 linux , Intel(R) Xeon(R) CPU  5160 ,
glibc-2.12-1.7.el6.x86_64:

*** z=-0.680000 + 0.000000*i   cacoshf(z)=+5.960464e-08  -2.318559e+00 *i
*** z=-0.670000 + 0.000000*i   cacoshf(z)=+5.960464e-08  -2.305006e+00 *i
*** z=-0.580000 + 0.000000*i   cacoshf(z)=+5.960464e-08  -2.189526e+00 *i
*** z=-0.570000 + 0.000000*i   cacoshf(z)=+5.960464e-08  -2.177303e+00 *i

Attached is a test program that will print the cacosh values for real arguments
between -1 and +1 , at interval 0.01 and indicate the results with a wrong sign
with "***"

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


             reply	other threads:[~2011-05-19 15:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 15:49 bert.barbe at oracle dot com [this message]
2011-05-20 13:31 ` [Bug math/12786] " bert.barbe at oracle dot com
2011-05-20 14:47 ` carlos at codesourcery dot com
2011-06-09 15:18 ` carlos at systemhalted dot org
2011-11-23  9:05 ` kreckel at ginac dot de
2011-12-23 15:59 ` drepper.fsp at gmail dot com
2011-12-23 16:03 ` drepper.fsp at gmail dot com
2014-06-27 13:20 ` fweimer at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-12786-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).