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/15004] New: `Y/X' is incorrectly estimated in sysdeps/ieee754/ldbl-96/e_atan2l.c


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

             Bug #: 15004
           Summary: `Y/X' is incorrectly estimated in
                    sysdeps/ieee754/ldbl-96/e_atan2l.c
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: unassigned@sourceware.org
        ReportedBy: ilmalakhov@yandex.ru
    Classification: Unclassified


Hi.

 `k = sy-sx' in the code below should obviously be replaced with `k = iy-ix'.
Otherwise K may appear unexpectedly big if `Y > 0' and `X < 0'.

 E.g., `atan2l (1.0L, -1.0L)' returns `PI / 2' rather than `3 * PI / 4'.

$ cat sysdeps/ieee754/ldbl-96/e_atan2l.c
. . .
long double
__ieee754_atan2l (long double y, long double x)
{
. . .
        GET_LDOUBLE_WORDS(sx,hx,lx,x);
        ix = sx&0x7fff;
. . .
        GET_LDOUBLE_WORDS(sy,hy,ly,y);
        iy = sy&0x7fff;
. . .
   /* compute y/x */
   k = sy-sx;
   if(k > 70) z=pi_o_2+0.5*pi_lo;       /* |y/x| >  2**70 */
. . .

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