]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove ONE and MONE
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Fri, 29 Mar 2013 11:10:36 +0000 (16:40 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Fri, 29 Mar 2013 11:10:36 +0000 (16:40 +0530)
ChangeLog
sysdeps/ieee754/dbl-64/e_log.c
sysdeps/ieee754/dbl-64/mpa.h
sysdeps/ieee754/dbl-64/mpatan.c
sysdeps/ieee754/dbl-64/mpatan2.c
sysdeps/ieee754/dbl-64/mptan.c
sysdeps/ieee754/dbl-64/s_atan.c
sysdeps/ieee754/dbl-64/s_tan.c

index 345a8d6b712bea66a7048ca483b546dbd0509f11..59797b9a410439fe26b924c9891fb6fa22afb4e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index f8d5a19ad080ed2a725bb018f8edfb634fcece41..f9300f9cefe406b503e9e8342802a2fe2b04de37 100644 (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 */
index 27bc7dcb5d316d2883f6cdffc3f1ffd754154456..ee81f5cbefc05bc8583f7cd272611238f55f3e30 100644 (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.  */
index cc879d8ec4f7fc47279043b3963ba44880680199..33c6847d9c3891b4c73e5c34578ec9dcef213379 100644 (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);
index f4aa9dbd06f34b043ced312d383ba6a9f8908ff9..f66f9eb8847b929cdce6361ec4d06fcd72f37ec7 100644 (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);
index 51b5718e738327511d79f5d892e4bd702cc99db7..281bfca1c356ea1f5240797c21c257641bd5585c 100644 (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
index e3c4be775ae30f89932538063e33b0e0355c4ab6..7b6c83ffb6b9075293cf2d8b86c792538c6e516b 100644 (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 (, 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 (, 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);
 
index 91fe2b85f738d62fa664174763ea4409fc2c2e7c..54f863e5441d60ab8bd6cfaca0490db2652dcfb6 100644 (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 */