[flint] 16/24: Updated docs on primality testing after recent changes.

felix salfelder felix-guest at moszumanska.debian.org
Wed Jun 25 11:16:11 UTC 2014


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

felix-guest pushed a commit to branch master
in repository flint.

commit 094a608a173c57aa0e95f45228aac8dfaed1337d
Author: William Hart <goodwillhart at googlemail.com>
Date:   Thu Jun 19 15:27:15 2014 +0100

    Updated docs on primality testing after recent changes.
---
 ulong_extras/doc/ulong_extras.txt | 40 ++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/ulong_extras/doc/ulong_extras.txt b/ulong_extras/doc/ulong_extras.txt
index 28d3d98..e6bcfc6 100644
--- a/ulong_extras/doc/ulong_extras.txt
+++ b/ulong_extras/doc/ulong_extras.txt
@@ -746,13 +746,14 @@ int n_is_prime_pseudosquare(mp_limb_t n)
 
 int n_is_prime(mp_limb_t n)
 
-    Tests if $n$ is a prime. Up to $10^{16}$ this simply calls 
-    \code{n_is_probabprime()} which is a primality test up to that limit. 
-    Beyond that point it calls \code{n_is_probabprime()} and returns $0$ 
-    if $n$ is composite, then it calls \code{n_is_prime_pocklington()} 
-    which proves the primality of $n$ in most cases. As a fallback, 
-    \code{n_is_prime_pseudosquare()} is called, which will unconditionally 
-    prove the primality of $n$.
+    Tests if $n$ is a prime. This first sieves for small prime factors,
+    then simply calls \code{n_is_probabprime()}. This has been checked
+    against the tables of Feitma and Galway and thus constitutes a
+    check for primality (rather than just pseudoprimality) up to $2^64$.
+
+    In future, this test may produce and check a certificate of 
+    primality. This is likely to be significantly slower for prime
+    inputs.
 
 int n_is_strong_probabprime_precomp(mp_limb_t n, double npre, 
                                                       mp_limb_t a, mp_limb_t d)
@@ -809,7 +810,8 @@ int n_is_probabprime_BPSW(mp_limb_t n)
 
     Implements the Baillie--Pomerance--Selfridge--Wagstaff probable primality
     test. There are no known counterexamples to this being a primality test.
-    For further details, see~\citep{CraPom2005}.
+    For further details, see~\citep{CraPom2005}. Up to $2^64$ this has been 
+    checked.
 
 int n_is_probabprime_lucas(mp_limb_t n)
 
@@ -822,17 +824,21 @@ int n_is_probabprime(mp_limb_t n)
 
     Tests if $n$ is a probable prime. Up to \code{FLINT_ODDPRIME_SMALL_CUTOFF} 
     this algorithm uses \code{n_is_oddprime_small()} which uses a lookup table.
+
     Next it calls \code{n_compute_primes()} with the maximum table size and 
     uses this table to perform a binary search for $n$ up to the table limit.
-    Then up to $10^{16}$ it uses a number of strong probable prime tests,
-    \code{n_is_strong_probabprime_precomp()}, etc., for various bases. The 
+
+    Then up to $1050535501$ it uses a number of strong probable prime tests,
+    \code{n_is_strong_probabprime_preinv()}, etc., for various bases. The 
     output of the algorithm is guaranteed to be correct up to this bound due 
     to exhaustive tables, described at 
     \url{http://uucode.com/obf/dalbec/alg.html}.
 
     Beyond that point the BPSW probabilistic primality test is used, by 
     calling the function \code{n_is_probabprime_BPSW()}. There are no known 
-    counterexamples, but it may well declare some composites to be prime.
+    counterexamples, and it has been checked against the tables of Feitma
+    and Galway and up to the accuracy of those tables, this is an exhaustive
+    check up to $2^64$, i.e. there are no counterexamples.
 
 *******************************************************************************
 
@@ -1030,10 +1036,14 @@ mp_limb_t n_factor_SQUFOF(mp_limb_t n, ulong iters)
 void n_factor(n_factor_t * factors, mp_limb_t n, int proved)
 
     Factors $n$ with no restrictions on $n$. If the prime factors are 
-    required to be certified prime, one may set \code{proved} to $1$, 
-    otherwise set it to $0$, and they will only be probable primes
-    (with no known counterexamples to the conjecture that they are
-    in fact all prime).
+    required to be checked with a primality test, one may set 
+    \code{proved} to $1$, otherwise set it to $0$, and they will only be 
+    probable primes. N.B: at the present there is no difference because 
+    the probable prime tests have been exhaustively tested up to $2^64$.
+
+    However, in future, this flag may produce and separately check
+    a primality certificate. This may be quite slow (and probably no
+    less reliable in practice).
 
     For details on the \code{n_factor_t} structure, see 
     \code{n_factor_trial()}.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/flint.git



More information about the debian-science-commits mailing list