[libmath-prime-util-perl] 21/33: Small RiemannR speedup

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:51:42 UTC 2015


This is an automated email from the git hooks/post-receive script.

ppm-guest pushed a commit to annotated tag v0.37
in repository libmath-prime-util-perl.

commit 4df059c0ddbfc3d157eb63ec69f7eeb3d275c462
Author: Dana Jacobsen <dana at acm.org>
Date:   Wed Jan 22 23:14:57 2014 -0800

    Small RiemannR speedup
---
 util.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/util.c b/util.c
index 54466bc..870581f 100644
--- a/util.c
+++ b/util.c
@@ -1610,7 +1610,8 @@ long double _XS_RiemannR(long double x) {
 
   for (k = 1; k <= 10000; k++) {
     part_term *= flogx / k;
-    term = part_term / (k + k * ld_riemann_zeta(k+1));
+    if (k-1 < NPRECALC_ZETA)  term = part_term / (k+k*riemann_zeta_table[k-1]);
+    else                      term = part_term / (k+k*ld_riemann_zeta(k+1));
     KAHAN_SUM(sum, term);
     /* printf("R %5d after adding %.18Lg, sum = %.19Lg\n", k, term, sum); */
     if (fabsl(term) < fabsl(LDBL_EPSILON*sum)) break;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git



More information about the Pkg-perl-cvs-commits mailing list