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.17-281-g2f22a1e


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  2f22a1e8dd817fecce67a8f3f8b807257960eec5 (commit)
      from  8930ddc705b9197fede41fae2a00f1d3e227a2a4 (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://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2f22a1e8dd817fecce67a8f3f8b807257960eec5

commit 2f22a1e8dd817fecce67a8f3f8b807257960eec5
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Mon Feb 25 16:13:35 2013 +0530

    Format slowexp.c

diff --git a/ChangeLog b/ChangeLog
index 2ff7799..04bb632 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2013-02-25  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+	* sysdeps/ieee754/dbl-64/slowexp.c: Reformat in GNU coding
+	style.
+
 	* sysdeps/ieee754/dbl-64/slowpow.c: Reformat in GNU coding
 	style.
 
diff --git a/sysdeps/ieee754/dbl-64/slowexp.c b/sysdeps/ieee754/dbl-64/slowexp.c
index 4899af7..c423fc3 100644
--- a/sysdeps/ieee754/dbl-64/slowexp.c
+++ b/sysdeps/ieee754/dbl-64/slowexp.c
@@ -34,32 +34,36 @@
 # define SECTION
 #endif
 
-void __mpexp(mp_no *x, mp_no *y, int p);
+void __mpexp (mp_no *x, mp_no *y, int p);
 
 /*Converting from double precision to Multi-precision and calculating  e^x */
 double
 SECTION
-__slowexp(double x) {
-  double w,z,res,eps=3.0e-26;
+__slowexp (double x)
+{
+  double w, z, res, eps = 3.0e-26;
   int p;
-  mp_no mpx, mpy, mpz,mpw,mpeps,mpcor;
+  mp_no mpx, mpy, mpz, mpw, mpeps, mpcor;
 
-  p=6;
-  __dbl_mp(x,&mpx,p); /* Convert a double precision number  x               */
-		    /* into a multiple precision number mpx with prec. p. */
-  __mpexp(&mpx, &mpy, p); /* Multi-Precision exponential function */
-  __dbl_mp(eps,&mpeps,p);
-  __mul(&mpeps,&mpy,&mpcor,p);
-  __add(&mpy,&mpcor,&mpw,p);
-  __sub(&mpy,&mpcor,&mpz,p);
-  __mp_dbl(&mpw, &w, p);
-  __mp_dbl(&mpz, &z, p);
-  if (w == z) return w;
-  else  {                   /* if calculating is not exactly   */
-    p = 32;
-    __dbl_mp(x,&mpx,p);
-    __mpexp(&mpx, &mpy, p);
-    __mp_dbl(&mpy, &res, p);
-    return res;
-  }
+  /* Use the multiple precision __MPEXP function to compute the exponential
+     First at 144 bits and if it is not accurate enough, at 768 bits.  */
+  p = 6;
+  __dbl_mp (x, &mpx, p);
+  __mpexp (&mpx, &mpy, p);
+  __dbl_mp (eps, &mpeps, p);
+  __mul (&mpeps, &mpy, &mpcor, p);
+  __add (&mpy, &mpcor, &mpw, p);
+  __sub (&mpy, &mpcor, &mpz, p);
+  __mp_dbl (&mpw, &w, p);
+  __mp_dbl (&mpz, &z, p);
+  if (w == z)
+    return w;
+  else
+    {
+      p = 32;
+      __dbl_mp (x, &mpx, p);
+      __mpexp (&mpx, &mpy, p);
+      __mp_dbl (&mpy, &res, p);
+      return res;
+    }
 }

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

Summary of changes:
 ChangeLog                        |    3 ++
 sysdeps/ieee754/dbl-64/slowexp.c |   48 ++++++++++++++++++++-----------------
 2 files changed, 29 insertions(+), 22 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]