This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.18-270-g8857663


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  885766357dee331079e6ab4d18320193d42d000c (commit)
       via  e7b2d1dd620f26341e431c212f3c0544448d9be5 (commit)
      from  09544cbcd6ef9e5ea2553c8b410dd55712171c33 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=885766357dee331079e6ab4d18320193d42d000c

commit 885766357dee331079e6ab4d18320193d42d000c
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Tue Oct 8 16:23:16 2013 +0530

    Format e_pow.c

diff --git a/ChangeLog b/ChangeLog
index 14f12d6..297ff42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2013-10-08  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+	* sysdeps/ieee754/dbl-64/e_pow.c: Fix code formatting.
+
 	* sysdeps/ieee754/dbl-64/e_exp.c: Fix code formatting.
 
 	* sysdeps/generic/math_private.h (__mpsin1): Remove
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
index 9a766e7..9cf2309 100644
--- a/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/sysdeps/ieee754/dbl-64/e_pow.c
@@ -49,354 +49,407 @@
 
 static const double huge = 1.0e300, tiny = 1.0e-300;
 
-double __exp1(double x, double xx, double error);
-static double log1(double x, double *delta, double *error);
-static double my_log2(double x, double *delta, double *error);
-double __slowpow(double x, double y,double z);
-static double power1(double x, double y);
-static int checkint(double x);
+double __exp1 (double x, double xx, double error);
+static double log1 (double x, double *delta, double *error);
+static double my_log2 (double x, double *delta, double *error);
+double __slowpow (double x, double y, double z);
+static double power1 (double x, double y);
+static int checkint (double x);
 
-/***************************************************************************/
-/* An ultimate power routine. Given two IEEE double machine numbers y,x    */
-/* it computes the correctly rounded (to nearest) value of X^y.            */
-/***************************************************************************/
+/* An ultimate power routine. Given two IEEE double machine numbers y, x it
+   computes the correctly rounded (to nearest) value of X^y.  */
 double
 SECTION
-__ieee754_pow(double x, double y) {
-  double z,a,aa,error, t,a1,a2,y1,y2;
-  mynumber u,v;
+__ieee754_pow (double x, double y)
+{
+  double z, a, aa, error, t, a1, a2, y1, y2;
+  mynumber u, v;
   int k;
-  int4 qx,qy;
-  v.x=y;
-  u.x=x;
-  if (v.i[LOW_HALF] == 0) { /* of y */
-    qx = u.i[HIGH_HALF]&0x7fffffff;
-    /* Is x a NaN?  */
-    if (((qx == 0x7ff00000) && (u.i[LOW_HALF] != 0)) || (qx > 0x7ff00000))
-      return x;
-    if (y == 1.0) return x;
-    if (y == 2.0) return x*x;
-    if (y == -1.0) return 1.0/x;
-    if (y == 0) return 1.0;
-  }
+  int4 qx, qy;
+  v.x = y;
+  u.x = x;
+  if (v.i[LOW_HALF] == 0)
+    {				/* of y */
+      qx = u.i[HIGH_HALF] & 0x7fffffff;
+      /* Is x a NaN?  */
+      if (((qx == 0x7ff00000) && (u.i[LOW_HALF] != 0)) || (qx > 0x7ff00000))
+	return x;
+      if (y == 1.0)
+	return x;
+      if (y == 2.0)
+	return x * x;
+      if (y == -1.0)
+	return 1.0 / x;
+      if (y == 0)
+	return 1.0;
+    }
   /* else */
-  if(((u.i[HIGH_HALF]>0 && u.i[HIGH_HALF]<0x7ff00000)||        /* x>0 and not x->0 */
-       (u.i[HIGH_HALF]==0 && u.i[LOW_HALF]!=0))  &&
-				      /*   2^-1023< x<= 2^-1023 * 0x1.0000ffffffff */
-      (v.i[HIGH_HALF]&0x7fffffff) < 0x4ff00000) {              /* if y<-1 or y>1   */
-    double retval;
+  if (((u.i[HIGH_HALF] > 0 && u.i[HIGH_HALF] < 0x7ff00000) ||	/* x>0 and not x->0 */
+       (u.i[HIGH_HALF] == 0 && u.i[LOW_HALF] != 0)) &&
+      /*   2^-1023< x<= 2^-1023 * 0x1.0000ffffffff */
+      (v.i[HIGH_HALF] & 0x7fffffff) < 0x4ff00000)
+    {				/* if y<-1 or y>1   */
+      double retval;
 
-    SET_RESTORE_ROUND (FE_TONEAREST);
+      SET_RESTORE_ROUND (FE_TONEAREST);
 
-    /* Avoid internal underflow for tiny y.  The exact value of y does
-       not matter if |y| <= 2**-64.  */
-    if (ABS (y) < 0x1p-64)
-      y = y < 0 ? -0x1p-64 : 0x1p-64;
-    z = log1(x,&aa,&error);                                 /* x^y  =e^(y log (X)) */
-    t = y*CN;
-    y1 = t - (t-y);
-    y2 = y - y1;
-    t = z*CN;
-    a1 = t - (t-z);
-    a2 = (z - a1)+aa;
-    a = y1*a1;
-    aa = y2*a1 + y*a2;
-    a1 = a+aa;
-    a2 = (a-a1)+aa;
-    error = error*ABS(y);
-    t = __exp1(a1,a2,1.9e16*error);     /* return -10 or 0 if wasn't computed exactly */
-    retval = (t>0)?t:power1(x,y);
+      /* Avoid internal underflow for tiny y.  The exact value of y does
+         not matter if |y| <= 2**-64.  */
+      if (ABS (y) < 0x1p-64)
+	y = y < 0 ? -0x1p-64 : 0x1p-64;
+      z = log1 (x, &aa, &error);	/* x^y  =e^(y log (X)) */
+      t = y * CN;
+      y1 = t - (t - y);
+      y2 = y - y1;
+      t = z * CN;
+      a1 = t - (t - z);
+      a2 = (z - a1) + aa;
+      a = y1 * a1;
+      aa = y2 * a1 + y * a2;
+      a1 = a + aa;
+      a2 = (a - a1) + aa;
+      error = error * ABS (y);
+      t = __exp1 (a1, a2, 1.9e16 * error);	/* return -10 or 0 if wasn't computed exactly */
+      retval = (t > 0) ? t : power1 (x, y);
 
-    return retval;
-  }
+      return retval;
+    }
 
-  if (x == 0) {
-    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) return (y>0)?0:1.0/0.0;
-    k = checkint(y);
-    if (k == -1)
-      return y < 0 ? 1.0/x : x;
-    else
-      return y < 0 ? 1.0/0.0 : 0.0;                               /* return 0 */
-  }
+  if (x == 0)
+    {
+      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)
+	return (y > 0) ? 0 : 1.0 / 0.0;
+      k = checkint (y);
+      if (k == -1)
+	return y < 0 ? 1.0 / x : x;
+      else
+	return y < 0 ? 1.0 / 0.0 : 0.0;	/* return 0 */
+    }
 
-  qx = u.i[HIGH_HALF]&0x7fffffff;  /*   no sign   */
-  qy = v.i[HIGH_HALF]&0x7fffffff;  /*   no sign   */
+  qx = u.i[HIGH_HALF] & 0x7fffffff;	/*   no sign   */
+  qy = v.i[HIGH_HALF] & 0x7fffffff;	/*   no sign   */
 
-  if (qx >= 0x7ff00000 && (qx > 0x7ff00000 || u.i[LOW_HALF] != 0)) /* NaN */
+  if (qx >= 0x7ff00000 && (qx > 0x7ff00000 || u.i[LOW_HALF] != 0))	/* NaN */
     return x;
-  if (qy >= 0x7ff00000 && (qy > 0x7ff00000 || v.i[LOW_HALF] != 0)) /* NaN */
+  if (qy >= 0x7ff00000 && (qy > 0x7ff00000 || v.i[LOW_HALF] != 0))	/* NaN */
     return x == 1.0 ? 1.0 : y;
 
   /* if x<0 */
-  if (u.i[HIGH_HALF] < 0) {
-    k = checkint(y);
-    if (k==0) {
-      if (qy == 0x7ff00000) {
-	if (x == -1.0) return 1.0;
-	else if (x > -1.0) return v.i[HIGH_HALF] < 0 ? INF.x : 0.0;
-	else return v.i[HIGH_HALF] < 0 ? 0.0 : INF.x;
-      }
+  if (u.i[HIGH_HALF] < 0)
+    {
+      k = checkint (y);
+      if (k == 0)
+	{
+	  if (qy == 0x7ff00000)
+	    {
+	      if (x == -1.0)
+		return 1.0;
+	      else if (x > -1.0)
+		return v.i[HIGH_HALF] < 0 ? INF.x : 0.0;
+	      else
+		return v.i[HIGH_HALF] < 0 ? 0.0 : INF.x;
+	    }
+	  else if (qx == 0x7ff00000)
+	    return y < 0 ? 0.0 : INF.x;
+	  return (x - x) / (x - x);	/* y not integer and x<0 */
+	}
       else if (qx == 0x7ff00000)
-	return y < 0 ? 0.0 : INF.x;
-      return (x - x) / (x - x);                   /* y not integer and x<0 */
+	{
+	  if (k < 0)
+	    return y < 0 ? nZERO.x : nINF.x;
+	  else
+	    return y < 0 ? 0.0 : INF.x;
+	}
+      /* if y even or odd */
+      return (k == 1) ? __ieee754_pow (-x, y) : -__ieee754_pow (-x, y);
     }
-    else if (qx == 0x7ff00000)
-      {
-	if (k < 0)
-	  return y < 0 ? nZERO.x : nINF.x;
-	else
-	  return y < 0 ? 0.0 : INF.x;
-      }
-    return (k==1)?__ieee754_pow(-x,y):-__ieee754_pow(-x,y); /* if y even or odd */
-  }
   /* x>0 */
 
-  if (qx == 0x7ff00000)                              /* x= 2^-0x3ff */
+  if (qx == 0x7ff00000)		/* x= 2^-0x3ff */
     return y > 0 ? x : 0;
 
-  if (qy > 0x45f00000 && qy < 0x7ff00000) {
-    if (x == 1.0) return 1.0;
-    if (y>0) return (x>1.0)?huge*huge:tiny*tiny;
-    if (y<0) return (x<1.0)?huge*huge:tiny*tiny;
-  }
+  if (qy > 0x45f00000 && qy < 0x7ff00000)
+    {
+      if (x == 1.0)
+	return 1.0;
+      if (y > 0)
+	return (x > 1.0) ? huge * huge : tiny * tiny;
+      if (y < 0)
+	return (x < 1.0) ? huge * huge : tiny * tiny;
+    }
 
-  if (x == 1.0) return 1.0;
-  if (y>0) return (x>1.0)?INF.x:0;
-  if (y<0) return (x<1.0)?INF.x:0;
-  return 0;     /* unreachable, to make the compiler happy */
+  if (x == 1.0)
+    return 1.0;
+  if (y > 0)
+    return (x > 1.0) ? INF.x : 0;
+  if (y < 0)
+    return (x < 1.0) ? INF.x : 0;
+  return 0;			/* unreachable, to make the compiler happy */
 }
+
 #ifndef __ieee754_pow
 strong_alias (__ieee754_pow, __pow_finite)
 #endif
 
-/**************************************************************************/
-/* Computing x^y using more accurate but more slow log routine            */
-/**************************************************************************/
+/* Compute x^y using more accurate but more slow log routine.  */
 static double
 SECTION
-power1(double x, double y) {
-  double z,a,aa,error, t,a1,a2,y1,y2;
-  z = my_log2(x,&aa,&error);
-  t = y*CN;
-  y1 = t - (t-y);
+power1 (double x, double y)
+{
+  double z, a, aa, error, t, a1, a2, y1, y2;
+  z = my_log2 (x, &aa, &error);
+  t = y * CN;
+  y1 = t - (t - y);
   y2 = y - y1;
-  t = z*CN;
-  a1 = t - (t-z);
+  t = z * CN;
+  a1 = t - (t - z);
   a2 = z - a1;
-  a = y*z;
-  aa = ((y1*a1-a)+y1*a2+y2*a1)+y2*a2+aa*y;
-  a1 = a+aa;
-  a2 = (a-a1)+aa;
-  error = error*ABS(y);
-  t = __exp1(a1,a2,1.9e16*error);
-  return (t >= 0)?t:__slowpow(x,y,z);
+  a = y * z;
+  aa = ((y1 * a1 - a) + y1 * a2 + y2 * a1) + y2 * a2 + aa * y;
+  a1 = a + aa;
+  a2 = (a - a1) + aa;
+  error = error * ABS (y);
+  t = __exp1 (a1, a2, 1.9e16 * error);
+  return (t >= 0) ? t : __slowpow (x, y, z);
 }
 
-/****************************************************************************/
-/* Computing log(x) (x is left argument). The result is the returned double */
-/* + the parameter delta.                                                   */
-/* The result is bounded by error (rightmost argument)                      */
-/****************************************************************************/
+/* Compute log(x) (x is left argument). The result is the returned double + the
+   parameter DELTA.  The result is bounded by ERROR.  */
 static double
 SECTION
-log1(double x, double *delta, double *error) {
-  int i,j,m;
-  double uu,vv,eps,nx,e,e1,e2,t,t1,t2,res,add=0;
-  mynumber u,v;
+log1 (double x, double *delta, double *error)
+{
+  int i, j, m;
+  double uu, vv, eps, nx, e, e1, e2, t, t1, t2, res, add = 0;
+  mynumber u, v;
 #ifdef BIG_ENDI
-  mynumber
-/**/ two52          = {{0x43300000, 0x00000000}}; /* 2**52         */
+  mynumber /**/ two52 = {{0x43300000, 0x00000000}};	/* 2**52  */
 #else
-#ifdef LITTLE_ENDI
-  mynumber
-/**/ two52          = {{0x00000000, 0x43300000}}; /* 2**52         */
-#endif
+# ifdef LITTLE_ENDI
+  mynumber /**/ two52 = {{0x00000000, 0x43300000}};	/* 2**52  */
+# endif
 #endif
 
   u.x = x;
   m = u.i[HIGH_HALF];
   *error = 0;
   *delta = 0;
-  if (m < 0x00100000)             /*  1<x<2^-1007 */
-    { x = x*t52.x; add = -52.0; u.x = x; m = u.i[HIGH_HALF];}
+  if (m < 0x00100000)		/*  1<x<2^-1007 */
+    {
+      x = x * t52.x;
+      add = -52.0;
+      u.x = x;
+      m = u.i[HIGH_HALF];
+    }
 
-  if ((m&0x000fffff) < 0x0006a09e)
-    {u.i[HIGH_HALF] = (m&0x000fffff)|0x3ff00000; two52.i[LOW_HALF]=(m>>20); }
+  if ((m & 0x000fffff) < 0x0006a09e)
+    {
+      u.i[HIGH_HALF] = (m & 0x000fffff) | 0x3ff00000;
+      two52.i[LOW_HALF] = (m >> 20);
+    }
   else
-    {u.i[HIGH_HALF] = (m&0x000fffff)|0x3fe00000; two52.i[LOW_HALF]=(m>>20)+1; }
+    {
+      u.i[HIGH_HALF] = (m & 0x000fffff) | 0x3fe00000;
+      two52.i[LOW_HALF] = (m >> 20) + 1;
+    }
 
   v.x = u.x + bigu.x;
   uu = v.x - bigu.x;
-  i = (v.i[LOW_HALF]&0x000003ff)<<2;
-  if (two52.i[LOW_HALF] == 1023)         /* nx = 0              */
-  {
-      if (i > 1192 && i < 1208)          /* |x-1| < 1.5*2**-10  */
-      {
+  i = (v.i[LOW_HALF] & 0x000003ff) << 2;
+  if (two52.i[LOW_HALF] == 1023)	/* nx = 0              */
+    {
+      if (i > 1192 && i < 1208)	/* |x-1| < 1.5*2**-10  */
+	{
 	  t = x - 1.0;
-	  t1 = (t+5.0e6)-5.0e6;
-	  t2 = t-t1;
-	  e1 = t - 0.5*t1*t1;
-	  e2 = t*t*t*(r3+t*(r4+t*(r5+t*(r6+t*(r7+t*r8)))))-0.5*t2*(t+t1);
-	  res = e1+e2;
-	  *error = 1.0e-21*ABS(t);
-	  *delta = (e1-res)+e2;
+	  t1 = (t + 5.0e6) - 5.0e6;
+	  t2 = t - t1;
+	  e1 = t - 0.5 * t1 * t1;
+	  e2 = (t * t * t * (r3 + t * (r4 + t * (r5 + t * (r6 + t
+							   * (r7 + t * r8)))))
+		- 0.5 * t2 * (t + t1));
+	  res = e1 + e2;
+	  *error = 1.0e-21 * ABS (t);
+	  *delta = (e1 - res) + e2;
 	  return res;
-      }                  /* |x-1| < 1.5*2**-10  */
+	}			/* |x-1| < 1.5*2**-10  */
       else
-      {
-	  v.x = u.x*(ui.x[i]+ui.x[i+1])+bigv.x;
-	  vv = v.x-bigv.x;
-	  j = v.i[LOW_HALF]&0x0007ffff;
-	  j = j+j+j;
-	  eps = u.x - uu*vv;
-	  e1 = eps*ui.x[i];
-	  e2 = eps*(ui.x[i+1]+vj.x[j]*(ui.x[i]+ui.x[i+1]));
-	  e = e1+e2;
-	  e2 =  ((e1-e)+e2);
-	  t=ui.x[i+2]+vj.x[j+1];
-	  t1 = t+e;
-	  t2 = (((t-t1)+e)+(ui.x[i+3]+vj.x[j+2]))+e2+e*e*(p2+e*(p3+e*p4));
-	  res=t1+t2;
+	{
+	  v.x = u.x * (ui.x[i] + ui.x[i + 1]) + bigv.x;
+	  vv = v.x - bigv.x;
+	  j = v.i[LOW_HALF] & 0x0007ffff;
+	  j = j + j + j;
+	  eps = u.x - uu * vv;
+	  e1 = eps * ui.x[i];
+	  e2 = eps * (ui.x[i + 1] + vj.x[j] * (ui.x[i] + ui.x[i + 1]));
+	  e = e1 + e2;
+	  e2 = ((e1 - e) + e2);
+	  t = ui.x[i + 2] + vj.x[j + 1];
+	  t1 = t + e;
+	  t2 = ((((t - t1) + e) + (ui.x[i + 3] + vj.x[j + 2])) + e2 + e * e
+		* (p2 + e * (p3 + e * p4)));
+	  res = t1 + t2;
 	  *error = 1.0e-24;
-	  *delta = (t1-res)+t2;
+	  *delta = (t1 - res) + t2;
 	  return res;
-      }
-  }   /* nx = 0 */
-  else                            /* nx != 0   */
-  {
+	}
+    }				/* nx = 0 */
+  else				/* nx != 0   */
+    {
       eps = u.x - uu;
-      nx = (two52.x - two52e.x)+add;
-      e1 = eps*ui.x[i];
-      e2 = eps*ui.x[i+1];
-      e=e1+e2;
-      e2 = (e1-e)+e2;
-      t=nx*ln2a.x+ui.x[i+2];
-      t1=t+e;
-      t2=(((t-t1)+e)+nx*ln2b.x+ui.x[i+3]+e2)+e*e*(q2+e*(q3+e*(q4+e*(q5+e*q6))));
-      res = t1+t2;
+      nx = (two52.x - two52e.x) + add;
+      e1 = eps * ui.x[i];
+      e2 = eps * ui.x[i + 1];
+      e = e1 + e2;
+      e2 = (e1 - e) + e2;
+      t = nx * ln2a.x + ui.x[i + 2];
+      t1 = t + e;
+      t2 = ((((t - t1) + e) + nx * ln2b.x + ui.x[i + 3] + e2) + e * e
+	    * (q2 + e * (q3 + e * (q4 + e * (q5 + e * q6)))));
+      res = t1 + t2;
       *error = 1.0e-21;
-      *delta = (t1-res)+t2;
+      *delta = (t1 - res) + t2;
       return res;
-  }                                /* nx != 0   */
+    }				/* nx != 0   */
 }
 
-/****************************************************************************/
-/* More slow but more accurate routine of log                               */
-/* Computing log(x)(x is left argument).The result is return double + delta.*/
-/* The result is bounded by error (right argument)                           */
-/****************************************************************************/
+/* Slower but more accurate routine of log.  The returned result is double +
+   DELTA.  The result is bounded by ERROR.  */
 static double
 SECTION
-my_log2(double x, double *delta, double *error) {
-  int i,j,m;
-  double uu,vv,eps,nx,e,e1,e2,t,t1,t2,res,add=0;
-  double ou1,ou2,lu1,lu2,ov,lv1,lv2,a,a1,a2;
-  double y,yy,z,zz,j1,j2,j7,j8;
+my_log2 (double x, double *delta, double *error)
+{
+  int i, j, m;
+  double uu, vv, eps, nx, e, e1, e2, t, t1, t2, res, add = 0;
+  double ou1, ou2, lu1, lu2, ov, lv1, lv2, a, a1, a2;
+  double y, yy, z, zz, j1, j2, j7, j8;
 #ifndef DLA_FMS
-  double j3,j4,j5,j6;
+  double j3, j4, j5, j6;
 #endif
-  mynumber u,v;
+  mynumber u, v;
 #ifdef BIG_ENDI
-  mynumber
-/**/ two52          = {{0x43300000, 0x00000000}}; /* 2**52         */
+  mynumber /**/ two52 = {{0x43300000, 0x00000000}};	/* 2**52  */
 #else
-#ifdef LITTLE_ENDI
-  mynumber
-/**/ two52          = {{0x00000000, 0x43300000}}; /* 2**52         */
-#endif
+# ifdef LITTLE_ENDI
+  mynumber /**/ two52 = {{0x00000000, 0x43300000}};	/* 2**52  */
+# endif
 #endif
 
   u.x = x;
   m = u.i[HIGH_HALF];
   *error = 0;
   *delta = 0;
-  add=0;
-  if (m<0x00100000) {  /* x < 2^-1022 */
-    x = x*t52.x;  add = -52.0; u.x = x; m = u.i[HIGH_HALF]; }
+  add = 0;
+  if (m < 0x00100000)
+    {				/* x < 2^-1022 */
+      x = x * t52.x;
+      add = -52.0;
+      u.x = x;
+      m = u.i[HIGH_HALF];
+    }
 
-  if ((m&0x000fffff) < 0x0006a09e)
-    {u.i[HIGH_HALF] = (m&0x000fffff)|0x3ff00000; two52.i[LOW_HALF]=(m>>20); }
+  if ((m & 0x000fffff) < 0x0006a09e)
+    {
+      u.i[HIGH_HALF] = (m & 0x000fffff) | 0x3ff00000;
+      two52.i[LOW_HALF] = (m >> 20);
+    }
   else
-    {u.i[HIGH_HALF] = (m&0x000fffff)|0x3fe00000; two52.i[LOW_HALF]=(m>>20)+1; }
+    {
+      u.i[HIGH_HALF] = (m & 0x000fffff) | 0x3fe00000;
+      two52.i[LOW_HALF] = (m >> 20) + 1;
+    }
 
   v.x = u.x + bigu.x;
   uu = v.x - bigu.x;
-  i = (v.i[LOW_HALF]&0x000003ff)<<2;
+  i = (v.i[LOW_HALF] & 0x000003ff) << 2;
   /*------------------------------------- |x-1| < 2**-11-------------------------------  */
-  if ((two52.i[LOW_HALF] == 1023)  && (i == 1200))
-  {
+  if ((two52.i[LOW_HALF] == 1023) && (i == 1200))
+    {
       t = x - 1.0;
-      EMULV(t,s3,y,yy,j1,j2,j3,j4,j5);
-      ADD2(-0.5,0,y,yy,z,zz,j1,j2);
-      MUL2(t,0,z,zz,y,yy,j1,j2,j3,j4,j5,j6,j7,j8);
-      MUL2(t,0,y,yy,z,zz,j1,j2,j3,j4,j5,j6,j7,j8);
+      EMULV (t, s3, y, yy, j1, j2, j3, j4, j5);
+      ADD2 (-0.5, 0, y, yy, z, zz, j1, j2);
+      MUL2 (t, 0, z, zz, y, yy, j1, j2, j3, j4, j5, j6, j7, j8);
+      MUL2 (t, 0, y, yy, z, zz, j1, j2, j3, j4, j5, j6, j7, j8);
 
-      e1 = t+z;
-      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);
-      *delta = (e1-res)+e2;
+      e1 = t + z;
+      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);
+      *delta = (e1 - res) + e2;
       return res;
-  }
+    }
   /*----------------------------- |x-1| > 2**-11  --------------------------  */
   else
-  {          /*Computing log(x) according to log table                        */
-      nx = (two52.x - two52e.x)+add;
+    {				/*Computing log(x) according to log table                        */
+      nx = (two52.x - two52e.x) + add;
       ou1 = ui.x[i];
-      ou2 = ui.x[i+1];
-      lu1 = ui.x[i+2];
-      lu2 = ui.x[i+3];
-      v.x = u.x*(ou1+ou2)+bigv.x;
-      vv = v.x-bigv.x;
-      j = v.i[LOW_HALF]&0x0007ffff;
-      j = j+j+j;
-      eps = u.x - uu*vv;
-      ov  = vj.x[j];
-      lv1 = vj.x[j+1];
-      lv2 = vj.x[j+2];
-      a = (ou1+ou2)*(1.0+ov);
-      a1 = (a+1.0e10)-1.0e10;
-      a2 = a*(1.0-a1*uu*vv);
-      e1 = eps*a1;
-      e2 = eps*a2;
-      e = e1+e2;
-      e2 = (e1-e)+e2;
-      t=nx*ln2a.x+lu1+lv1;
-      t1 = t+e;
-      t2 = (((t-t1)+e)+(lu2+lv2+nx*ln2b.x+e2))+e*e*(p2+e*(p3+e*p4));
-      res=t1+t2;
+      ou2 = ui.x[i + 1];
+      lu1 = ui.x[i + 2];
+      lu2 = ui.x[i + 3];
+      v.x = u.x * (ou1 + ou2) + bigv.x;
+      vv = v.x - bigv.x;
+      j = v.i[LOW_HALF] & 0x0007ffff;
+      j = j + j + j;
+      eps = u.x - uu * vv;
+      ov = vj.x[j];
+      lv1 = vj.x[j + 1];
+      lv2 = vj.x[j + 2];
+      a = (ou1 + ou2) * (1.0 + ov);
+      a1 = (a + 1.0e10) - 1.0e10;
+      a2 = a * (1.0 - a1 * uu * vv);
+      e1 = eps * a1;
+      e2 = eps * a2;
+      e = e1 + e2;
+      e2 = (e1 - e) + e2;
+      t = nx * ln2a.x + lu1 + lv1;
+      t1 = t + e;
+      t2 = ((((t - t1) + e) + (lu2 + lv2 + nx * ln2b.x + e2)) + e * e
+	    * (p2 + e * (p3 + e * p4)));
+      res = t1 + t2;
       *error = 1.0e-27;
-      *delta = (t1-res)+t2;
+      *delta = (t1 - res) + t2;
       return res;
-  }
+    }
 }
 
-/**********************************************************************/
-/* Routine receives a double x and checks if it is an integer. If not */
-/* it returns 0, else it returns 1 if even or -1 if odd.              */
-/**********************************************************************/
+/* This function receives a double x and checks if it is an integer.  If not,
+   it returns 0, else it returns 1 if even or -1 if odd.  */
 static int
 SECTION
-checkint(double x) {
-  union {int4 i[2]; double x;} u;
-  int k,m,n;
+checkint (double x)
+{
+  union
+  {
+    int4 i[2];
+    double x;
+  } u;
+  int k, m, n;
   u.x = x;
-  m = u.i[HIGH_HALF]&0x7fffffff;    /* no sign */
-  if (m >= 0x7ff00000) return 0;    /*  x is +/-inf or NaN  */
-  if (m >= 0x43400000) return 1;    /*  |x| >= 2**53   */
-  if (m < 0x40000000) return 0;     /* |x| < 2,  can not be 0 or 1  */
+  m = u.i[HIGH_HALF] & 0x7fffffff;	/* no sign */
+  if (m >= 0x7ff00000)
+    return 0;			/*  x is +/-inf or NaN  */
+  if (m >= 0x43400000)
+    return 1;			/*  |x| >= 2**53   */
+  if (m < 0x40000000)
+    return 0;			/* |x| < 2,  can not be 0 or 1  */
   n = u.i[LOW_HALF];
-  k = (m>>20)-1023;                 /*  1 <= k <= 52   */
-  if (k == 52) return (n&1)? -1:1;  /* odd or even*/
-  if (k>20) {
-    if (n<<(k-20)) return 0;        /* if not integer */
-    return (n<<(k-21))?-1:1;
-  }
-  if (n) return 0;                  /*if  not integer*/
-  if (k == 20) return (m&1)? -1:1;
-  if (m<<(k+12)) return 0;
-  return (m<<(k+11))?-1:1;
+  k = (m >> 20) - 1023;		/*  1 <= k <= 52   */
+  if (k == 52)
+    return (n & 1) ? -1 : 1;	/* odd or even */
+  if (k > 20)
+    {
+      if (n << (k - 20))
+	return 0;		/* if not integer */
+      return (n << (k - 21)) ? -1 : 1;
+    }
+  if (n)
+    return 0;			/*if  not integer */
+  if (k == 20)
+    return (m & 1) ? -1 : 1;
+  if (m << (k + 12))
+    return 0;
+  return (m << (k + 11)) ? -1 : 1;
 }

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e7b2d1dd620f26341e431c212f3c0544448d9be5

commit e7b2d1dd620f26341e431c212f3c0544448d9be5
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Tue Oct 8 16:22:28 2013 +0530

    Format e_exp.c

diff --git a/ChangeLog b/ChangeLog
index 54f712d..14f12d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2013-10-08  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+	* sysdeps/ieee754/dbl-64/e_exp.c: Fix code formatting.
+
 	* sysdeps/generic/math_private.h (__mpsin1): Remove
 	declaration.
 	(__mpcos1): Likewise.
diff --git a/sysdeps/ieee754/dbl-64/e_exp.c b/sysdeps/ieee754/dbl-64/e_exp.c
index 07cc4a9..df3aa5e 100644
--- a/sysdeps/ieee754/dbl-64/e_exp.c
+++ b/sysdeps/ieee754/dbl-64/e_exp.c
@@ -44,221 +44,299 @@
 # define SECTION
 #endif
 
-double __slowexp(double);
+double __slowexp (double);
 
-/***************************************************************************/
-/* An ultimate exp routine. Given an IEEE double machine number x          */
-/* it computes the correctly rounded (to nearest) value of e^x             */
-/***************************************************************************/
+/* An ultimate exp routine. Given an IEEE double machine number x it computes
+   the correctly rounded (to nearest) value of e^x.  */
 double
 SECTION
-__ieee754_exp(double x) {
+__ieee754_exp (double x)
+{
   double bexp, t, eps, del, base, y, al, bet, res, rem, cor;
-  mynumber junk1, junk2, binexp  = {{0,0}};
-  int4 i,j,m,n,ex;
+  mynumber junk1, junk2, binexp = {{0, 0}};
+  int4 i, j, m, n, ex;
   double retval;
 
   SET_RESTORE_ROUND (FE_TONEAREST);
 
   junk1.x = x;
   m = junk1.i[HIGH_HALF];
-  n = m&hugeint;
-
-  if (n > smallint && n < bigint) {
-
-    y = x*log2e.x + three51.x;
-    bexp = y - three51.x;      /*  multiply the result by 2**bexp        */
-
-    junk1.x = y;
-
-    eps = bexp*ln_two2.x;      /* x = bexp*ln(2) + t - eps               */
-    t = x - bexp*ln_two1.x;
-
-    y = t + three33.x;
-    base = y - three33.x;      /* t rounded to a multiple of 2**-18      */
-    junk2.x = y;
-    del = (t - base) - eps;    /*  x = bexp*ln(2) + base + del           */
-    eps = del + del*del*(p3.x*del + p2.x);
-
-    binexp.i[HIGH_HALF] =(junk1.i[LOW_HALF]+1023)<<20;
-
-    i = ((junk2.i[LOW_HALF]>>8)&0xfffffffe)+356;
-    j = (junk2.i[LOW_HALF]&511)<<1;
-
-    al = coar.x[i]*fine.x[j];
-    bet =(coar.x[i]*fine.x[j+1] + coar.x[i+1]*fine.x[j]) + coar.x[i+1]*fine.x[j+1];
-
-    rem=(bet + bet*eps)+al*eps;
-    res = al + rem;
-    cor = (al - res) + rem;
-    if  (res == (res+cor*err_0)) { retval = res*binexp.x; goto ret; }
-    else { retval = __slowexp(x); goto ret; } /*if error is over bound */
-  }
+  n = m & hugeint;
+
+  if (n > smallint && n < bigint)
+    {
+      y = x * log2e.x + three51.x;
+      bexp = y - three51.x;	/*  multiply the result by 2**bexp        */
+
+      junk1.x = y;
+
+      eps = bexp * ln_two2.x;	/* x = bexp*ln(2) + t - eps               */
+      t = x - bexp * ln_two1.x;
+
+      y = t + three33.x;
+      base = y - three33.x;	/* t rounded to a multiple of 2**-18      */
+      junk2.x = y;
+      del = (t - base) - eps;	/*  x = bexp*ln(2) + base + del           */
+      eps = del + del * del * (p3.x * del + p2.x);
+
+      binexp.i[HIGH_HALF] = (junk1.i[LOW_HALF] + 1023) << 20;
+
+      i = ((junk2.i[LOW_HALF] >> 8) & 0xfffffffe) + 356;
+      j = (junk2.i[LOW_HALF] & 511) << 1;
+
+      al = coar.x[i] * fine.x[j];
+      bet = ((coar.x[i] * fine.x[j + 1] + coar.x[i + 1] * fine.x[j])
+	     + coar.x[i + 1] * fine.x[j + 1]);
+
+      rem = (bet + bet * eps) + al * eps;
+      res = al + rem;
+      cor = (al - res) + rem;
+      if (res == (res + cor * err_0))
+	{
+	  retval = res * binexp.x;
+	  goto ret;
+	}
+      else
+	{
+	  retval = __slowexp (x);
+	  goto ret;
+	}			/*if error is over bound */
+    }
 
-  if (n <= smallint) { retval = 1.0; goto ret; }
+  if (n <= smallint)
+    {
+      retval = 1.0;
+      goto ret;
+    }
 
-  if (n >= badint) {
-    if (n > infint) { retval = x+x; goto ret; }               /* x is NaN */
-    if (n < infint) { retval = (x>0) ? (hhuge*hhuge) : (tiny*tiny); goto ret; }
-    /* x is finite,  cause either overflow or underflow  */
-    if (junk1.i[LOW_HALF] != 0) { retval = x+x; goto ret; } /*  x is NaN  */
-    retval = (x>0)?inf.x:zero;             /* |x| = inf;  return either inf or 0 */
-    goto ret;
-  }
+  if (n >= badint)
+    {
+      if (n > infint)
+	{
+	  retval = x + x;
+	  goto ret;
+	}			/* x is NaN */
+      if (n < infint)
+	{
+	  retval = (x > 0) ? (hhuge * hhuge) : (tiny * tiny);
+	  goto ret;
+	}
+      /* x is finite,  cause either overflow or underflow  */
+      if (junk1.i[LOW_HALF] != 0)
+	{
+	  retval = x + x;
+	  goto ret;
+	}			/*  x is NaN  */
+      retval = (x > 0) ? inf.x : zero;	/* |x| = inf;  return either inf or 0 */
+      goto ret;
+    }
 
-  y = x*log2e.x + three51.x;
+  y = x * log2e.x + three51.x;
   bexp = y - three51.x;
   junk1.x = y;
-  eps = bexp*ln_two2.x;
-  t = x - bexp*ln_two1.x;
+  eps = bexp * ln_two2.x;
+  t = x - bexp * ln_two1.x;
   y = t + three33.x;
   base = y - three33.x;
   junk2.x = y;
   del = (t - base) - eps;
-  eps = del + del*del*(p3.x*del + p2.x);
-  i = ((junk2.i[LOW_HALF]>>8)&0xfffffffe)+356;
-  j = (junk2.i[LOW_HALF]&511)<<1;
-  al = coar.x[i]*fine.x[j];
-  bet =(coar.x[i]*fine.x[j+1] + coar.x[i+1]*fine.x[j]) + coar.x[i+1]*fine.x[j+1];
-  rem=(bet + bet*eps)+al*eps;
+  eps = del + del * del * (p3.x * del + p2.x);
+  i = ((junk2.i[LOW_HALF] >> 8) & 0xfffffffe) + 356;
+  j = (junk2.i[LOW_HALF] & 511) << 1;
+  al = coar.x[i] * fine.x[j];
+  bet = ((coar.x[i] * fine.x[j + 1] + coar.x[i + 1] * fine.x[j])
+	 + coar.x[i + 1] * fine.x[j + 1]);
+  rem = (bet + bet * eps) + al * eps;
   res = al + rem;
   cor = (al - res) + rem;
-  if (m>>31) {
-    ex=junk1.i[LOW_HALF];
-    if (res < 1.0) {res+=res; cor+=cor; ex-=1;}
-    if (ex >=-1022) {
-      binexp.i[HIGH_HALF] = (1023+ex)<<20;
-      if  (res == (res+cor*err_0)) { retval = res*binexp.x; goto ret; }
-      else { retval = __slowexp(x); goto ret; } /*if error is over bound */
+  if (m >> 31)
+    {
+      ex = junk1.i[LOW_HALF];
+      if (res < 1.0)
+	{
+	  res += res;
+	  cor += cor;
+	  ex -= 1;
+	}
+      if (ex >= -1022)
+	{
+	  binexp.i[HIGH_HALF] = (1023 + ex) << 20;
+	  if (res == (res + cor * err_0))
+	    {
+	      retval = res * binexp.x;
+	      goto ret;
+	    }
+	  else
+	    {
+	      retval = __slowexp (x);
+	      goto ret;
+	    }			/*if error is over bound */
+	}
+      ex = -(1022 + ex);
+      binexp.i[HIGH_HALF] = (1023 - ex) << 20;
+      res *= binexp.x;
+      cor *= binexp.x;
+      eps = 1.0000000001 + err_0 * binexp.x;
+      t = 1.0 + res;
+      y = ((1.0 - t) + res) + cor;
+      res = t + y;
+      cor = (t - res) + y;
+      if (res == (res + eps * cor))
+	{
+	  binexp.i[HIGH_HALF] = 0x00100000;
+	  retval = (res - 1.0) * binexp.x;
+	  goto ret;
+	}
+      else
+	{
+	  retval = __slowexp (x);
+	  goto ret;
+	}			/*   if error is over bound    */
     }
-    ex = -(1022+ex);
-    binexp.i[HIGH_HALF] = (1023-ex)<<20;
-    res*=binexp.x;
-    cor*=binexp.x;
-    eps=1.0000000001+err_0*binexp.x;
-    t=1.0+res;
-    y = ((1.0-t)+res)+cor;
-    res=t+y;
-    cor = (t-res)+y;
-    if (res == (res + eps*cor))
-    { binexp.i[HIGH_HALF] = 0x00100000;
-      retval = (res-1.0)*binexp.x;
-      goto ret;
+  else
+    {
+      binexp.i[HIGH_HALF] = (junk1.i[LOW_HALF] + 767) << 20;
+      if (res == (res + cor * err_0))
+	{
+	  retval = res * binexp.x * t256.x;
+	  goto ret;
+	}
+      else
+	{
+	  retval = __slowexp (x);
+	  goto ret;
+	}
     }
-    else { retval = __slowexp(x); goto ret; } /*   if error is over bound    */
-  }
-  else {
-    binexp.i[HIGH_HALF] =(junk1.i[LOW_HALF]+767)<<20;
-    if (res == (res+cor*err_0)) { retval = res*binexp.x*t256.x; goto ret; }
-    else { retval = __slowexp(x); goto ret; }
-  }
- ret:
+ret:
   return retval;
 }
 #ifndef __ieee754_exp
 strong_alias (__ieee754_exp, __exp_finite)
 #endif
 
-/************************************************************************/
-/* Compute e^(x+xx)(Double-Length number) .The routine also receive     */
-/* bound of error of previous calculation .If after computing exp       */
-/* error bigger than allows routine return non positive number          */
-/*else return   e^(x + xx)   (always positive )                         */
-/************************************************************************/
-
+/* Compute e^(x+xx).  The routine also receives bound of error of previous
+   calculation.  If after computing exp the error exceeds the allowed bounds,
+   the routine returns a non-positive number.  Otherwise it returns the
+   computed result, which is always positive.  */
 double
 SECTION
-__exp1(double x, double xx, double error) {
+__exp1 (double x, double xx, double error)
+{
   double bexp, t, eps, del, base, y, al, bet, res, rem, cor;
-  mynumber junk1, junk2, binexp  = {{0,0}};
-  int4 i,j,m,n,ex;
+  mynumber junk1, junk2, binexp = {{0, 0}};
+  int4 i, j, m, n, ex;
 
   junk1.x = x;
   m = junk1.i[HIGH_HALF];
-  n = m&hugeint;                 /* no sign */
-
-  if (n > smallint && n < bigint) {
-    y = x*log2e.x + three51.x;
-    bexp = y - three51.x;      /*  multiply the result by 2**bexp        */
+  n = m & hugeint;		/* no sign */
 
-    junk1.x = y;
+  if (n > smallint && n < bigint)
+    {
+      y = x * log2e.x + three51.x;
+      bexp = y - three51.x;	/*  multiply the result by 2**bexp        */
 
-    eps = bexp*ln_two2.x;      /* x = bexp*ln(2) + t - eps               */
-    t = x - bexp*ln_two1.x;
+      junk1.x = y;
 
-    y = t + three33.x;
-    base = y - three33.x;      /* t rounded to a multiple of 2**-18      */
-    junk2.x = y;
-    del = (t - base) + (xx-eps);    /*  x = bexp*ln(2) + base + del      */
-    eps = del + del*del*(p3.x*del + p2.x);
+      eps = bexp * ln_two2.x;	/* x = bexp*ln(2) + t - eps               */
+      t = x - bexp * ln_two1.x;
 
-    binexp.i[HIGH_HALF] =(junk1.i[LOW_HALF]+1023)<<20;
+      y = t + three33.x;
+      base = y - three33.x;	/* t rounded to a multiple of 2**-18      */
+      junk2.x = y;
+      del = (t - base) + (xx - eps);	/*  x = bexp*ln(2) + base + del      */
+      eps = del + del * del * (p3.x * del + p2.x);
 
-    i = ((junk2.i[LOW_HALF]>>8)&0xfffffffe)+356;
-    j = (junk2.i[LOW_HALF]&511)<<1;
+      binexp.i[HIGH_HALF] = (junk1.i[LOW_HALF] + 1023) << 20;
 
-    al = coar.x[i]*fine.x[j];
-    bet =(coar.x[i]*fine.x[j+1] + coar.x[i+1]*fine.x[j]) + coar.x[i+1]*fine.x[j+1];
+      i = ((junk2.i[LOW_HALF] >> 8) & 0xfffffffe) + 356;
+      j = (junk2.i[LOW_HALF] & 511) << 1;
 
-    rem=(bet + bet*eps)+al*eps;
-    res = al + rem;
-    cor = (al - res) + rem;
-    if  (res == (res+cor*(1.0+error+err_1))) return res*binexp.x;
-    else return -10.0;
-  }
+      al = coar.x[i] * fine.x[j];
+      bet = ((coar.x[i] * fine.x[j + 1] + coar.x[i + 1] * fine.x[j])
+	     + coar.x[i + 1] * fine.x[j + 1]);
 
-  if (n <= smallint) return 1.0; /*  if x->0 e^x=1 */
+      rem = (bet + bet * eps) + al * eps;
+      res = al + rem;
+      cor = (al - res) + rem;
+      if (res == (res + cor * (1.0 + error + err_1)))
+	return res * binexp.x;
+      else
+	return -10.0;
+    }
 
-  if (n >= badint) {
-    if (n > infint) return(zero/zero);    /* x is NaN,  return invalid */
-    if (n < infint) return ( (x>0) ? (hhuge*hhuge) : (tiny*tiny) );
-    /* x is finite,  cause either overflow or underflow  */
-    if (junk1.i[LOW_HALF] != 0)  return (zero/zero);        /*  x is NaN  */
-    return ((x>0)?inf.x:zero );   /* |x| = inf;  return either inf or 0 */
-  }
+  if (n <= smallint)
+    return 1.0;			/*  if x->0 e^x=1 */
+
+  if (n >= badint)
+    {
+      if (n > infint)
+	return (zero / zero);	/* x is NaN,  return invalid */
+      if (n < infint)
+	return ((x > 0) ? (hhuge * hhuge) : (tiny * tiny));
+      /* x is finite,  cause either overflow or underflow  */
+      if (junk1.i[LOW_HALF] != 0)
+	return (zero / zero);	/*  x is NaN  */
+      return ((x > 0) ? inf.x : zero);	/* |x| = inf;  return either inf or 0 */
+    }
 
-  y = x*log2e.x + three51.x;
+  y = x * log2e.x + three51.x;
   bexp = y - three51.x;
   junk1.x = y;
-  eps = bexp*ln_two2.x;
-  t = x - bexp*ln_two1.x;
+  eps = bexp * ln_two2.x;
+  t = x - bexp * ln_two1.x;
   y = t + three33.x;
   base = y - three33.x;
   junk2.x = y;
-  del = (t - base) + (xx-eps);
-  eps = del + del*del*(p3.x*del + p2.x);
-  i = ((junk2.i[LOW_HALF]>>8)&0xfffffffe)+356;
-  j = (junk2.i[LOW_HALF]&511)<<1;
-  al = coar.x[i]*fine.x[j];
-  bet =(coar.x[i]*fine.x[j+1] + coar.x[i+1]*fine.x[j]) + coar.x[i+1]*fine.x[j+1];
-  rem=(bet + bet*eps)+al*eps;
+  del = (t - base) + (xx - eps);
+  eps = del + del * del * (p3.x * del + p2.x);
+  i = ((junk2.i[LOW_HALF] >> 8) & 0xfffffffe) + 356;
+  j = (junk2.i[LOW_HALF] & 511) << 1;
+  al = coar.x[i] * fine.x[j];
+  bet = ((coar.x[i] * fine.x[j + 1] + coar.x[i + 1] * fine.x[j])
+	 + coar.x[i + 1] * fine.x[j + 1]);
+  rem = (bet + bet * eps) + al * eps;
   res = al + rem;
   cor = (al - res) + rem;
-  if (m>>31) {
-    ex=junk1.i[LOW_HALF];
-    if (res < 1.0) {res+=res; cor+=cor; ex-=1;}
-    if (ex >=-1022) {
-      binexp.i[HIGH_HALF] = (1023+ex)<<20;
-      if  (res == (res+cor*(1.0+error+err_1))) return res*binexp.x;
-      else return -10.0;
+  if (m >> 31)
+    {
+      ex = junk1.i[LOW_HALF];
+      if (res < 1.0)
+	{
+	  res += res;
+	  cor += cor;
+	  ex -= 1;
+	}
+      if (ex >= -1022)
+	{
+	  binexp.i[HIGH_HALF] = (1023 + ex) << 20;
+	  if (res == (res + cor * (1.0 + error + err_1)))
+	    return res * binexp.x;
+	  else
+	    return -10.0;
+	}
+      ex = -(1022 + ex);
+      binexp.i[HIGH_HALF] = (1023 - ex) << 20;
+      res *= binexp.x;
+      cor *= binexp.x;
+      eps = 1.00000000001 + (error + err_1) * binexp.x;
+      t = 1.0 + res;
+      y = ((1.0 - t) + res) + cor;
+      res = t + y;
+      cor = (t - res) + y;
+      if (res == (res + eps * cor))
+	{
+	  binexp.i[HIGH_HALF] = 0x00100000;
+	  return (res - 1.0) * binexp.x;
+	}
+      else
+	return -10.0;
+    }
+  else
+    {
+      binexp.i[HIGH_HALF] = (junk1.i[LOW_HALF] + 767) << 20;
+      if (res == (res + cor * (1.0 + error + err_1)))
+	return res * binexp.x * t256.x;
+      else
+	return -10.0;
     }
-    ex = -(1022+ex);
-    binexp.i[HIGH_HALF] = (1023-ex)<<20;
-    res*=binexp.x;
-    cor*=binexp.x;
-    eps=1.00000000001+(error+err_1)*binexp.x;
-    t=1.0+res;
-    y = ((1.0-t)+res)+cor;
-    res=t+y;
-    cor = (t-res)+y;
-    if (res == (res + eps*cor))
-      {binexp.i[HIGH_HALF] = 0x00100000; return (res-1.0)*binexp.x;}
-    else return -10.0;
-  }
-  else {
-    binexp.i[HIGH_HALF] =(junk1.i[LOW_HALF]+767)<<20;
-    if  (res == (res+cor*(1.0+error+err_1)))
-      return res*binexp.x*t256.x;
-    else return -10.0;
-  }
 }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                      |    4 +
 sysdeps/ieee754/dbl-64/e_exp.c |  406 +++++++++++++++++------------
 sysdeps/ieee754/dbl-64/e_pow.c |  573 ++++++++++++++++++++++------------------
 3 files changed, 559 insertions(+), 424 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]