tanh is an odd function
Stephen L Moshier
moshier@mediaone.net
Sun May 13 17:32:00 GMT 2001
The following test case fails on i386 with libc-2.2.3. Fix is below.
----
long double tanhl (long double);
int
main()
{
long double x, y, ny;
x = -1.0;
ny = tanhl (x);
y = tanhl (-x);
if (y == ny)
abort ();
exit (0);
}
----
* sysdeps/ieee754/ldbl-96/s_tanhl.c (__tanhl): Fix sign test.
*** s_tanhl.c 1999/07/14 00:15:23 1.1
--- s_tanhl.c 2001/05/14 00:11:15
***************
*** 90,95 ****
} else {
z = one - tiny; /* raised inexact flag */
}
! return (se>0x7fff)? -z: z;
}
weak_alias (__tanhl, tanhl)
--- 90,95 ----
} else {
z = one - tiny; /* raised inexact flag */
}
! return (se&0x8000)? -z: z;
}
weak_alias (__tanhl, tanhl)
More information about the Libc-alpha
mailing list