[libmath-prime-util-perl] 13/13: Turn off racing squfof in main routine

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


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

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

commit 0cb4b425b3beb5b45d098a84c8d8ac1c58f3d93b
Author: Dana Jacobsen <dana at acm.org>
Date:   Mon Jul 23 01:39:16 2012 -0600

    Turn off racing squfof in main routine
---
 Changes |  3 ++-
 XS.xs   | 19 +++++--------------
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/Changes b/Changes
index 617ed05..4e2f05c 100644
--- a/Changes
+++ b/Changes
@@ -7,7 +7,8 @@ Revision history for Perl extension Math::Prime::Util.
     - Fix compile issues on MSC, thanks to Sisyphus.
     - some bigint/bignum changes (next_prime and math functions).
     - speed up and enhance some tests.
-    - Add racing SQUFOF for UVs, also add a little more trial division.
+    - Test version of racing SQUFOF (not used in main code yet).  Also add
+      a little more up-front trial division for main factor routine.
 
 
 0.10  16 July 2012
diff --git a/XS.xs b/XS.xs
index 7236fa6..604edff 100644
--- a/XS.xs
+++ b/XS.xs
@@ -250,14 +250,6 @@ _XS_factor(IN UV n)
                          ((n>>29) < 100000) ? 250000 :
                                               600000;
 
- #if 0
-          if (!split_success && n < 1000000) {
-            nfactored += trial_factor(n, factored_stack+nfactored, 0);
-            n = 1;
-            break;
-          }
- #endif
-
           /* Small factors will be found quite rapidly with this */
           if (!split_success) {
             split_success = pbrent_factor(n, tofac_stack+ntofac, 1500)-1;
@@ -265,12 +257,11 @@ _XS_factor(IN UV n)
           }
 
           if (!split_success) {
-            /* SQUFOF does very well with what's left after TD and Rho.
-             * On such input, racing SQUFOF is ~40% faster and has better
-             * success, but has input size restrictions. */
-            split_success = (n > (UV_MAX >> 3))
-                  ? squfof_factor(n, tofac_stack+ntofac, sq_rounds)-1
-                  : racing_squfof_factor(n, tofac_stack+ntofac, 0)-1;
+            /* SQUFOF does very well with what's left after TD and Rho. */
+            /* Racing SQUFOF is about 40% faster and has better success, but
+             * has input size restrictions and I'm seeing cases where it gets
+             * stuck in stage 2.  For now just stick with the old one.  */
+            split_success = squfof_factor(n, tofac_stack+ntofac, sq_rounds)-1;
             if (verbose) printf("squfof %d\n", split_success);
           }
 

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