aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/e_pow.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2015-05-15 10:53:55 +0000
committerWilco Dijkstra <wdijkstr@arm.com>2015-05-15 11:04:40 +0000
commit0e9be4db8f655d3dc006c5b101f15a5912a5846f (patch)
treeb03088c533aab59ee41220bd469433d2a2abb527 /sysdeps/ieee754/dbl-64/e_pow.c
parentfbc68f03b0e56db6a07d789fd403eb79d726fe96 (diff)
downloadglibc-0e9be4db8f655d3dc006c5b101f15a5912a5846f.tar
glibc-0e9be4db8f655d3dc006c5b101f15a5912a5846f.tar.gz
glibc-0e9be4db8f655d3dc006c5b101f15a5912a5846f.tar.bz2
glibc-0e9be4db8f655d3dc006c5b101f15a5912a5846f.zip
Remove various ABS macros and replace uses with fabs (or in one case abs)
which is more efficient on all targets.
Diffstat (limited to 'sysdeps/ieee754/dbl-64/e_pow.c')
-rw-r--r--sysdeps/ieee754/dbl-64/e_pow.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
index ba932f4e24..8a1f72f1fa 100644
--- a/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/sysdeps/ieee754/dbl-64/e_pow.c
@@ -97,7 +97,7 @@ __ieee754_pow (double x, double y)
/* Avoid internal underflow for tiny y. The exact value of y does
not matter if |y| <= 2**-64. */
- if (ABS (y) < 0x1p-64)
+ if (fabs (y) < 0x1p-64)
y = y < 0 ? -0x1p-64 : 0x1p-64;
z = log1 (x, &aa, &error); /* x^y =e^(y log (X)) */
t = y * CN;
@@ -110,7 +110,7 @@ __ieee754_pow (double x, double y)
aa = y2 * a1 + y * a2;
a1 = a + aa;
a2 = (a - a1) + aa;
- error = error * ABS (y);
+ error = error * fabs (y);
t = __exp1 (a1, a2, 1.9e16 * error); /* return -10 or 0 if wasn't computed exactly */
retval = (t > 0) ? t : power1 (x, y);
}
@@ -127,7 +127,7 @@ __ieee754_pow (double x, double y)
if (((v.i[HIGH_HALF] & 0x7fffffff) == 0x7ff00000 && v.i[LOW_HALF] != 0)
|| (v.i[HIGH_HALF] & 0x7fffffff) > 0x7ff00000) /* NaN */
return y;
- if (ABS (y) > 1.0e20)
+ if (fabs (y) > 1.0e20)
return (y > 0) ? 0 : 1.0 / 0.0;
k = checkint (y);
if (k == -1)
@@ -232,7 +232,7 @@ power1 (double x, double y)
aa = ((y1 * a1 - a) + y1 * a2 + y2 * a1) + y2 * a2 + aa * y;
a1 = a + aa;
a2 = (a - a1) + aa;
- error = error * ABS (y);
+ error = error * fabs (y);
t = __exp1 (a1, a2, 1.9e16 * error);
return (t >= 0) ? t : __slowpow (x, y, z);
}
@@ -292,7 +292,7 @@ log1 (double x, double *delta, double *error)
* (r7 + t * r8)))))
- 0.5 * t2 * (t + t1));
res = e1 + e2;
- *error = 1.0e-21 * ABS (t);
+ *error = 1.0e-21 * fabs (t);
*delta = (e1 - res) + e2;
return res;
} /* |x-1| < 1.5*2**-10 */
@@ -398,7 +398,7 @@ my_log2 (double x, double *delta, double *error)
e2 = ((((t - e1) + z) + zz) + t * t * t
* (ss3 + t * (s4 + t * (s5 + t * (s6 + t * (s7 + t * s8))))));
res = e1 + e2;
- *error = 1.0e-25 * ABS (t);
+ *error = 1.0e-25 * fabs (t);
*delta = (e1 - res) + e2;
return res;
}