public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/13942] New: x86 acos inaccurate near 1
@ 2012-04-03 19:25 jsm28 at gcc dot gnu.org
  2012-04-04  1:16 ` [Bug math/13942] " bugdal at aerifal dot cx
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-04-03 19:25 UTC (permalink / raw)
  To: glibc-bugs

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

             Bug #: 13942
           Summary: x86 acos inaccurate near 1
           Product: glibc
           Version: 2.15
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jsm28@gcc.gnu.org
    Classification: Unclassified


http://sourceware.org/ml/libc-help/2008-09/msg00031.html (mentioned in a recent
bug) reports an issue with acos on x86 being inaccurate near 1 because of using
sqrt (1 - x*x).  This is still present with current sources, as illustrated by
the test:

#include <math.h>
#include <stdio.h>

volatile double d = 0x0.ffffffff8p0;

int
main (void)
{
  volatile double r = acos (d);
  printf ("%.14a\n", r);
  return 0;
}

This prints 0x1.000000002aaab0p-16 when an accurate result computed by GNU MPFR
is 0x1.000000000aaab0p-16.

It looks like this issue will affect x86 acos and acosl and x86_64 acosl.  For
acosf the squaring (in x87 64-bit precision) will always be exact so there is
no problem.  For asin functions and for acos functions near -1 I don't think
there will be significant loss of accuracy from this issue (the result will be
near pi/2 or pi and the problem is for results near 0) but probably all the
functions (other than asinf/acosf) should be fixed and tests added to the
testsuite for all these cases.

-- 
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] 12+ messages in thread

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

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-03 19:25 [Bug math/13942] New: x86 acos inaccurate near 1 jsm28 at gcc dot gnu.org
2012-04-04  1:16 ` [Bug math/13942] " bugdal at aerifal dot cx
2012-04-04  9:21 ` joseph at codesourcery dot com
2012-04-04 14:13 ` bugdal at aerifal dot cx
2012-04-04 14:24 ` joseph at codesourcery dot com
2012-04-04 23:50 ` bugdal at aerifal dot cx
2012-04-05  0:13 ` joseph at codesourcery dot com
2012-04-05  0:31 ` bugdal at aerifal dot cx
2012-04-05  9:34 ` joseph at codesourcery dot com
2012-04-05 14:14 ` bugdal at aerifal dot cx
2012-04-30 18:59 ` jsm28 at gcc dot gnu.org
2014-06-25 11:22 ` 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).