projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests for module 'unicase/u16-is-uppercase'.
[gnulib.git]
/
lib
/
tanl.c
diff --git
a/lib/tanl.c
b/lib/tanl.c
index
d173d6b
..
60e6637
100644
(file)
--- a/
lib/tanl.c
+++ b/
lib/tanl.c
@@
-124,7
+124,7
@@
long double
kernel_tanl (long double x, long double y, int iy)
{
long double z, r, v, w, s, u, u1;
kernel_tanl (long double x, long double y, int iy)
{
long double z, r, v, w, s, u, u1;
- int
flag
, sign;
+ int
invert = 0
, sign;
sign = 1;
if (x < 0)
sign = 1;
if (x < 0)
@@
-146,7
+146,7
@@
kernel_tanl (long double x, long double y, int iy)
}
if (x >= 0.6743316650390625) /* |x| >= 0.6743316650390625 */
{
}
if (x >= 0.6743316650390625) /* |x| >= 0.6743316650390625 */
{
-
flag
= 1;
+
invert
= 1;
z = pio4hi - x;
w = pio4lo - y;
z = pio4hi - x;
w = pio4lo - y;
@@
-162,7
+162,7
@@
kernel_tanl (long double x, long double y, int iy)
r = y + z * (s * r + y);
r += TH * s;
w = x + r;
r = y + z * (s * r + y);
r += TH * s;
w = x + r;
- if (
flag
)
+ if (
invert
)
{
v = (long double) iy;
w = (v - 2.0 * (x - (w * w / (w + v) - r)));
{
v = (long double) iy;
w = (v - 2.0 * (x - (w * w / (w + v) - r)));
@@
-191,13
+191,17
@@
tanl (long double x)
long double y[2], z = 0.0L;
int n;
long double y[2], z = 0.0L;
int n;
+ /* tanl(NaN) is NaN */
+ if (isnanl (x))
+ return x;
+
/* |x| ~< pi/4 */
if (x >= -0.7853981633974483096156608458198757210492 &&
x <= 0.7853981633974483096156608458198757210492)
return kernel_tanl (x, z, 1);
/* |x| ~< pi/4 */
if (x >= -0.7853981633974483096156608458198757210492 &&
x <= 0.7853981633974483096156608458198757210492)
return kernel_tanl (x, z, 1);
- /* tanl(Inf
or NaN
) is NaN, tanl(0) is 0 */
- else if (x + x == x
|| x != x
)
+ /* tanl(Inf) is NaN, tanl(0) is 0 */
+ else if (x + x == x)
return x - x; /* NaN */
/* argument reduction needed */
return x - x; /* NaN */
/* argument reduction needed */