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-221-gc2af38a


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  c2af38aa768d1c24b24ba1bed473aaee6c2d675e (commit)
      from  4e92d59e26eb33c3ae523783e918a6e839e83ffd (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=c2af38aa768d1c24b24ba1bed473aaee6c2d675e

commit c2af38aa768d1c24b24ba1bed473aaee6c2d675e
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 13 17:19:06 2013 +0530

    Remove unnecessary factorial array
    
    kf is n! at the end of the loop, so storing the values is unnecessary.

diff --git a/ChangeLog b/ChangeLog
index 07ad26f..ed911fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2013-02-13  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+	* sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): Remove NFA.
+
 	* sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): Faster polynomial
 	evaluation.
 
diff --git a/sysdeps/ieee754/dbl-64/mpexp.c b/sysdeps/ieee754/dbl-64/mpexp.c
index 35c4e80..5b3ff04 100644
--- a/sysdeps/ieee754/dbl-64/mpexp.c
+++ b/sysdeps/ieee754/dbl-64/mpexp.c
@@ -50,14 +50,6 @@ __mpexp (mp_no *x, mp_no *y, int p)
       6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8
     };
 
-  /* Factorials for the values of np above.  */
-  static const double nfa[33] =
-    {
-      1.0, 1.0, 1.0, 1.0, 6.0, 6.0, 24.0, 24.0, 120.0, 24.0, 24.0,
-      120.0, 120.0, 120.0, 720.0, 720.0, 720.0, 720.0, 720.0, 720.0,
-      720.0, 720.0, 720.0, 720.0, 5040.0, 5040.0, 5040.0, 5040.0,
-      40320.0, 40320.0, 40320.0, 40320.0, 40320.0
-    };
   static const int m1p[33] =
     {
       0, 0, 0, 0,
@@ -130,7 +122,8 @@ __mpexp (mp_no *x, mp_no *y, int p)
          e^x = 1 + (x * n!/1! + x^2 * n!/2! + x^3 * n!/3!) / n!
              = 1 + (x * (n!/1! + x * (n!/2! + x * (n!/3! + x ...)))) / n!
 
-     n! is pre-computed and saved while k! is computed on the fly.  */
+     k! is computed on the fly as KF and at the end of the polynomial loop, KF
+     is n!, which can be used directly.  */
   __cpy (&mps, &mpt2, p);
 
   double kf = 1.0;
@@ -145,7 +138,7 @@ __mpexp (mp_no *x, mp_no *y, int p)
       __add (&mpt2, &mpk, &mpt1, p);
       __mul (&mps, &mpt1, &mpt2, p);
     }
-  __dbl_mp (nfa[p], &mpk, p);
+  __dbl_mp (kf, &mpk, p);
   __dvd (&mpt2, &mpk, &mpt1, p);
   __add (&mpone, &mpt1, &mpt2, p);
 

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

Summary of changes:
 ChangeLog                      |    2 ++
 sysdeps/ieee754/dbl-64/mpexp.c |   13 +++----------
 2 files changed, 5 insertions(+), 10 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]