Karim Belabas on Mon, 23 Nov 2015 20:00:14 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: keep flag=1 recursively in isprime |
* Bill Allombert [2015-05-24 17:37]: > On Tue, May 05, 2015 at 10:53:11PM +0200, Pascal Molin wrote: > > isprime(p,1) calls Pocklington-Lehmer only at the first recursion level and > > then > > falls back to the check_prime rountine which may call APRCL. > > > > Looking at the code I assume this is intentional but I find it misleading. > > I would prefer if the flag were kept recursively, or suggest having a > > stronger flag ensuring to use only the PL test -- in particular the > > returned certificate would never contain '2'. > > This is not really practical. However, what should be done is > for check_prime to use the same criterion as BPSW_isprime_big, > instead of simply (expi(p) <= 250), otherwise > > * 2 if x is a large prime whose primality could only sensibly be > proven (given the algorithms implemented in PARI) using the APRCL > test. > > is a white lie. Done in 'master' branch. Cheers, K.B. P.S. A combined N^2-1 test (N-1 & N+1) is still of interest... -- Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17 Universite de Bordeaux Fax: (+33) (0)5 40 00 69 50 351, cours de la Liberation http://www.math.u-bordeaux.fr/~kbelabas/ F-33405 Talence (France) http://pari.math.u-bordeaux.fr/ [PARI/GP] `