This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/14610] New: atan2l inaccurate for ldbl-128ibm and x near 1


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

             Bug #: 14610
           Summary: atan2l inaccurate for ldbl-128ibm and x near 1
           Product: glibc
           Version: 2.16
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jsm28@gcc.gnu.org
    Classification: Unclassified
              Host: powerpc*


When the ldbl-128ibm version of atan2l is called with an x argument whose high
part is 1, it returns a result as if that x were exactly 1.  Testcase:

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

volatile long double x = 0x1.00000000000001p0L;
volatile long double one = 0x1p0L;

int
main (void)
{
  printf ("%La\n%La\n", atan2l (x, x), atanl (one));
  return 0;
}

Prints:

0x1.921fb54442d18569898cc517018p-1
0x1.921fb54442d18469898cc517018p-1

The two numbers should of course be the same or very similar, but one digit is
different in the middle.

The problem code looks like

        if(((hx-0x3ff0000000000000LL))==0) return __atanl(y);   /* x=1.0L */

where the test is only checking if the high part of x is 1.0.

This causes large ulps in clog tests in the testsuite (but still should have
its own atan2 tests added when fixed).

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]