Comment #39 on issue 3809 by dana.jac...@gmail.com: isprime can be faster
http://code.google.com/p/sympy/issues/detail?id=3809

I can check the gmpy2 functions -- the underlying code should be solid since it was written for a PRIMO validator that has been used a lot in the last two years, but it wouldn't hurt to run a few more tests on the code that's present. The issue I had with is_strong_bpsw_prp looks like some sort of wrapping issue where the second internal call is getting the wrong number of arguments.

Perl modules, (note links to the github pages for the development versions):
  https://metacpan.org/release/Math-Prime-Util
  https://metacpan.org/release/Math-Prime-Util-GMP

License is the Perl artistic license (which is either GPL or Artistic License), and a LICENSE file is included. The GMP module uses a derivative of SIMPQS which is GPL v2+, though that is only used for certain factoring tasks.

There are versions in pure Perl, C, and for many things (including the primality tests) C+GMP in the Math::Prime::Util::GMP module. The timing above all went to C+GMP for the real work. The pure Perl code really is two parts:
  1) a lot of wrapping and tasks where performance isn't critical
2) backup for all other functionality, or for big number use when MPU::GMP isn't installed The performance of pure Perl for big number operations leaves a lot to be desired, especially with the default bigint backend, but at least it works.

If you'd like, I can write something to start, for instance:
- use deterministic bases for numbers < 2^64 which should simplify the code and make it a little faster - put try / except for HAS_GMPY == 2 and use the tests it has to do a BPSW test.
and tests.

Implementing the strong Lucas test in pure Python should be possible -- it isn't that much code. I'll give it a shot and we'll see what the performance looks like.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy-issues+unsubscr...@googlegroups.com.
To post to this group, send email to sympy-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy-issues.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to