Format mplog.c
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Wed, 27 Feb 2013 05:54:45 +0000 (11:24 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Wed, 27 Feb 2013 05:54:45 +0000 (11:24 +0530)
ChangeLog
sysdeps/ieee754/dbl-64/mplog.c

index c39884b..9cd6b9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-02-27  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+       * sysdeps/ieee754/dbl-64/mplog.c: Reformat.
+
 2013-02-26  Roland McGrath  <roland@hack.frob.com>
 
        * Makeconfig (%.v.i, %.v): Move these pattern rules outside of
index e3d1084..f8d5c10 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * IBM Accurate Mathematical Library
  * written by International Business Machines Corp.
 #include "endian.h"
 #include "mpa.h"
 
-void __mpexp(mp_no *, mp_no *, int);
-
-void __mplog(mp_no *x, mp_no *y, int p) {
-  int i,m;
-  static const int mp[33] = {0,0,0,0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,
-                             4,4,4,4,4,4,4,4,4,4,4,4,4,4};
-  mp_no mpt1,mpt2;
+void
+__mplog (mp_no *x, mp_no *y, int p)
+{
+  int i, m;
+  static const int mp[33] =
+    {
+      0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
+      4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
+    };
+  mp_no mpt1, mpt2;
 
-  /* Choose m */
+  /* Choose m */
   m = mp[p];
 
-  /* Perform m newton iterations to solve for y: exp(y)-x=0.     */
-  /* The iterations formula is:  y(n+1)=y(n)+(x*exp(-y(n))-1).   */
-  __cpy(y,&mpt1,p);
-  for (i=0; i<m; i++) {
-    mpt1.d[0]=-mpt1.d[0];
-    __mpexp(&mpt1,&mpt2,p);
-    __mul(x,&mpt2,&mpt1,p);
-    __sub(&mpt1,&mpone,&mpt2,p);
-    __add(y,&mpt2,&mpt1,p);
-    __cpy(&mpt1,y,p);
-  }
-  return;
+  /* Perform m newton iterations to solve for y: exp(y) - x = 0.  The
+     iterations formula is:  y(n + 1) = y(n) + (x * exp(-y(n)) - 1).   */
+  __cpy (y, &mpt1, p);
+  for (i = 0; i < m; i++)
+    {
+      mpt1.d[0] = -mpt1.d[0];
+      __mpexp (&mpt1, &mpt2, p);
+      __mul (x, &mpt2, &mpt1, p);
+      __sub (&mpt1, &mpone, &mpt2, p);
+      __add (y, &mpt2, &mpt1, p);
+      __cpy (&mpt1, y, p);
+    }
 }