Remove ONE and MONE

This commit is contained in:
Siddhesh Poyarekar 2013-03-29 16:40:36 +05:30
parent 27ec37f185
commit c2d94018c6
8 changed files with 29 additions and 22 deletions

View File

@ -1,5 +1,14 @@
2013-03-29 Siddhesh Poyarekar <siddhesh@redhat.com>
* sysdeps/ieee754/dbl-64/mpa.h (ONE, MONE): Remove defines.
(__pow_mp): Replace ONE and MONE with their values.
* sysdeps/ieee754/dbl-64/e_log.c (__ieee754_log): Likewise.
* sysdeps/ieee754/dbl-64/mpatan.c (__mpatan): Likewise.
* sysdeps/ieee754/dbl-64/mpatan2.c (__mpatan2): Likewise.
* sysdeps/ieee754/dbl-64/mptan.c (__mptan): Likewise.
* sysdeps/ieee754/dbl-64/s_atan.c (atan): Likewise.
* sysdeps/ieee754/dbl-64/s_tan.c (tan): Likewise.
* sysdeps/ieee754/dbl-64/s_tan.c: Fix formatting.
* sysdeps/ieee754/dbl-64/mpa.h (ZERO, MZERO): Remove defines.

View File

@ -91,7 +91,7 @@ __ieee754_log (double x)
/* Regular values of x */
w = x - ONE;
w = x - 1;
if (__builtin_expect (ABS (w) > U03, 1))
goto case_03;
@ -178,7 +178,7 @@ case_03:
j = (num.i[HIGH_HALF] & 0x000fffff) >> 4;
/* Compute w=(u-ui*vj)/(ui*vj) */
p0 = (ONE + (i - 75) * DEL_U) * (ONE + (j - 180) * DEL_V);
p0 = (1 + (i - 75) * DEL_U) * (1 + (j - 180) * DEL_V);
q = u - p0;
r0 = Iu[i].d * Iv[j].d;
w = q * r0;
@ -206,7 +206,7 @@ case_03:
/* Improve the accuracy of r0 */
EMULV (p0, r0, sa, sb, t1, t2, t3, t4, t5);
t = r0 * ((ONE - sa) - sb);
t = r0 * ((1 - sa) - sb);
EADD (r0, t, ra, rb);
/* Compute w */

View File

@ -91,8 +91,6 @@ extern const mp_no mptwo;
# define TWO52 0x1.0p52 /* 2^52 */
#endif
#define ONE 1.0 /* 1 */
#define MONE -1.0 /* -1 */
#define TWO 2.0 /* 2 */
#define TWO5 TWOPOW (5) /* 2^5 */
@ -150,7 +148,7 @@ __pow_mp (int pow, mp_no *y, int p)
rem += 24;
}
/* The sign of any 2^x is always positive. */
Y[0] = ONE;
Y[0] = 1;
Y[1] = 1 << rem;
/* Everything else is 0. */

View File

@ -74,7 +74,7 @@ __mpatan (mp_no *x, mp_no *y, int p)
}
}
mptwoim1.e = 1;
mptwoim1.d[0] = ONE;
mptwoim1.d[0] = 1;
/* Reduce x m times. */
__sqr (x, &mpsm, p);

View File

@ -51,7 +51,7 @@ __mpatan2 (mp_no *y, mp_no *x, mp_no *z, int p)
__dvd (x, y, &mpt1, p);
__mul (&mpt1, &mpt1, &mpt2, p);
if (mpt1.d[0] != 0)
mpt1.d[0] = ONE;
mpt1.d[0] = 1;
__add (&mpt2, &mpone, &mpt3, p);
__mpsqrt (&mpt3, &mpt2, p);
__add (&mpt1, &mpt2, &mpt3, p);

View File

@ -56,7 +56,7 @@ __mptan (double x, mp_no *mpy, int p)
if (n)
{
__dvd (&mpc, &mps, mpy, p);
mpy->d[0] *= MONE;
mpy->d[0] *= -1;
}
/* tan is negative in this area. */
else

View File

@ -179,9 +179,9 @@ atan (double x)
{
if (u < D)
{ /* C <= u < D */
w = ONE / u;
w = 1 / u;
EMULV (w, u, t1, t2, t3, t4, t5, t6, t7);
ww = w * ((ONE - t1) - t2);
ww = w * ((1 - t1) - t2);
i = (TWO52 + TWO8 * w) - TWO52;
i -= 16;
z = (w - cij[i][0].d) + ww;
@ -200,7 +200,7 @@ atan (double x)
if ((y = t1 + (yy - u3)) == t1 + (yy + u3))
return __signArctan (x, y);
DIV2 (ONE, 0, u, 0, w, ww, t1, t2, t3, t4, t5, t6, t7, t8, t9,
DIV2 (1 , 0, u, 0, w, ww, t1, t2, t3, t4, t5, t6, t7, t8, t9,
t10);
t1 = w - hij[i][0].d;
EADD (t1, ww, z, zz);
@ -230,7 +230,7 @@ atan (double x)
{
if (u < E)
{ /* D <= u < E */
w = ONE / u;
w = 1 / u;
v = w * w;
EMULV (w, u, t1, t2, t3, t4, t5, t6, t7);
@ -241,13 +241,13 @@ atan (double x)
yy = d3.d + v * yy;
yy *= w * v;
ww = w * ((ONE - t1) - t2);
ww = w * ((1 - t1) - t2);
ESUB (HPI, w, t3, cor);
yy = ((HPI1 + cor) - ww) - yy;
if ((y = t3 + (yy - U4)) == t3 + (yy + U4))
return __signArctan (x, y);
DIV2 (ONE, 0, u, 0, w, ww, t1, t2, t3, t4, t5, t6, t7, t8,
DIV2 (1 , 0, u, 0, w, ww, t1, t2, t3, t4, t5, t6, t7, t8,
t9, t10);
MUL2 (w, ww, w, ww, v, vv, t1, t2, t3, t4, t5, t6, t7, t8);

View File

@ -154,7 +154,7 @@ tan (double x)
i = ((int) (mfftnhf.d + TWO8 * w));
z = w - xfg[i][0].d;
z2 = z * z;
s = (x < 0.0) ? MONE : ONE;
s = (x < 0.0) ? -1 : 1;
pz = z + z * z2 * (e0.d + z2 * e1.d);
fi = xfg[i][1].d;
gi = xfg[i][2].d;
@ -214,13 +214,13 @@ tan (double x)
{
ya = -a;
yya = -da;
sy = MONE;
sy = -1;
}
else
{
ya = a;
yya = da;
sy = ONE;
sy = 1;
}
/* (IV),(V) The case 0.787 < abs(x) <= 25, abs(y) <= 1e-7 */
@ -438,13 +438,13 @@ tan (double x)
{
ya = -a;
yya = -da;
sy = MONE;
sy = -1;
}
else
{
ya = a;
yya = da;
sy = ONE;
sy = 1;
}
/* (+++) The case 25 < abs(x) <= 1e8, abs(y) <= 1e-7 */
@ -631,13 +631,13 @@ tan (double x)
{
ya = -a;
yya = -da;
sy = MONE;
sy = -1;
}
else
{
ya = a;
yya = da;
sy = ONE;
sy = 1;
}
/* (+++) The case 1e8 < abs(x) < 2**1024, abs(y) <= 1e-7 */