mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 22:40:05 +00:00
Fix low-part sign handling in sin/cos for ldbl-128 and ldbl-128ibm.
This commit is contained in:
parent
e4d91429ae
commit
c0df8e693f
13
ChangeLog
13
ChangeLog
@ -1,3 +1,16 @@
|
||||
2012-03-22 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* sysdeps/ieee754/ldbl-128/k_cosl.c (__kernel_cosl): Negate y if
|
||||
negating x to take absolute value.
|
||||
* sysdeps/ieee754/ldbl-128/k_sincosl.c (__kernel_sincosl):
|
||||
Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/k_cosl.c (__kernel_cosl): Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/k_sincosl.c (__kernel_sincosl):
|
||||
Likewise.
|
||||
* sysdeps/ieee754/ldbl-128/k_sinl.c (__kernel_sinl): Negate y when
|
||||
computing low part if x was negated.
|
||||
* sysdeps/ieee754/ldbl-128ibm/k_sinl.c (__kernel_sinl): Likewise.
|
||||
|
||||
2012-03-21 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
* elf/tst-auditmod1.c: Support la_x32_gnu_pltenter and
|
||||
|
@ -105,7 +105,11 @@ __kernel_cosl(long double x, long double y)
|
||||
cosl(h+l) = cosl(h)cosl(l) - sinl(h)sinl(l). */
|
||||
index = 0x3ffe - (tix >> 16);
|
||||
hix = (tix + (0x200 << index)) & (0xfffffc00 << index);
|
||||
x = fabsl (x);
|
||||
if (signbit (x))
|
||||
{
|
||||
x = -x;
|
||||
y = -y;
|
||||
}
|
||||
switch (index)
|
||||
{
|
||||
case 0: index = ((45 << 10) + hix - 0x3ffe0000) >> 8; break;
|
||||
|
@ -132,7 +132,11 @@ __kernel_sincosl(long double x, long double y, long double *sinx, long double *c
|
||||
cosl(h+l) = cosl(h)cosl(l) - sinl(h)sinl(l). */
|
||||
index = 0x3ffe - (tix >> 16);
|
||||
hix = (tix + (0x200 << index)) & (0xfffffc00 << index);
|
||||
x = fabsl (x);
|
||||
if (signbit (x))
|
||||
{
|
||||
x = -x;
|
||||
y = -y;
|
||||
}
|
||||
switch (index)
|
||||
{
|
||||
case 0: index = ((45 << 10) + hix - 0x3ffe0000) >> 8; break;
|
||||
|
@ -116,7 +116,7 @@ __kernel_sinl(long double x, long double y, int iy)
|
||||
|
||||
SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
|
||||
if (iy)
|
||||
l = y - (h - x);
|
||||
l = (ix < 0 ? -y : y) - (h - x);
|
||||
else
|
||||
l = x - h;
|
||||
z = l * l;
|
||||
|
@ -123,7 +123,11 @@ __kernel_cosl(long double x, long double y)
|
||||
|
||||
index = 0x3fe - (tix >> 20);
|
||||
hix = (tix + (0x200 << index)) & (0xfffffc00 << index);
|
||||
x = fabsl (x);
|
||||
if (signbit (x))
|
||||
{
|
||||
x = -x;
|
||||
y = -y;
|
||||
}
|
||||
switch (index)
|
||||
{
|
||||
case 0: index = ((45 << 14) + hix - 0x3fe00000) >> 12; break;
|
||||
|
@ -151,7 +151,11 @@ __kernel_sincosl(long double x, long double y, long double *sinx, long double *c
|
||||
|
||||
index = 0x3fe - (tix >> 20);
|
||||
hix = (tix + (0x2000 << index)) & (0xffffc000 << index);
|
||||
x = fabsl (x);
|
||||
if (signbit (x))
|
||||
{
|
||||
x = -x;
|
||||
y = -y;
|
||||
}
|
||||
switch (index)
|
||||
{
|
||||
case 0: index = ((45 << 14) + hix - 0x3fe00000) >> 12; break;
|
||||
|
@ -134,7 +134,7 @@ __kernel_sinl(long double x, long double y, int iy)
|
||||
*/
|
||||
SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
|
||||
if (iy)
|
||||
l = y - (h - x);
|
||||
l = (ix < 0 ? -y : y) - (h - x);
|
||||
else
|
||||
l = x - h;
|
||||
z = l * l;
|
||||
|
Loading…
Reference in New Issue
Block a user