Use Montgomery arithmetic in n_is_prime#2519
Use Montgomery arithmetic in n_is_prime#2519fredrik-johansson merged 2 commits intoflintlib:mainfrom
n_is_prime#2519Conversation
3a5d21c to
9591404
Compare
|
Should I be concerned by the sudden failure of msolve on CI? It's reproducible (3 times) on CI, but I can't reproduce it locally on my machine. |
After some investigation with the specific compile commands from the CI, I've been able to reproduce, and the minimal context where I can reproduce is when using I see no test failure when using just My guess is that this could be related to some functions that pick primes / nextprimes in |
|
Well, the explanation for the impact of We do not call this recent function in |
|
Ah, that would explain it. Now I need to investigate why our own tests don't pick that up. |
|
Oh, our CI doesn't actually run |
This speeds up the strong probable prime tests for n between 33 and 64 bits. Shoup reduction is still faster than Montgomery for <= 32 bits (to get a speedup there, a "fast" Shoup with non-canonical residues looks promising).
Edit: initial version had a small bug causing 5% performance degradation; updated with timings for the newly pushed version.