Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the improved Lucas test from Baillie et al '21 #70

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fjarri
Copy link
Member

@fjarri fjarri commented Jan 25, 2025

Fixes #21

This should probably go in after #62 is fixed.

The plan is to have a "FIPS" is_prime() preset (the current one, with the plan to go through the items in #4), and a "BPSW21" preset (this PR). Which one should be the default is not clear.

Things to consider:

  • I don't know how to reach the point in lucas_test() where all the previous checks have passed, but the final one (Euler's criterion) failed. Baillie et al don't seem to know either, and include the Euler's criterion just in case, because we already have the values for it.
  • Should we remove ExtraStrong and AlmostExtraStrong (and maybe even LucasV) options? They are only used to test against known pseudoprimes, nobody will use them in practice. And they complicate the internals of lucas_test().
  • Speaking of which, can the structure there be improved? I tried to flatten it a bit, but it's still kind of messy.

@fjarri fjarri self-assigned this Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement full improved Baillie-PSW test
1 participant