Closed asmeurer closed 4 years ago
But I think it's abandoned. It you want to pick up the work there feel free.
@Amitjha1412, @skirpichev is correct that this should be fixed by 2209. I will get that completed in early February.
Could be closed? #2209 superseded by #10943, which has been merged.
I just tested on master and the original isprime(int("1808010808"*1560 + "1"))
took 28min 41s to finish on my laptop. I don't know how long it took before. Presumably we can get it faster than this still.
We should also go through the discussion here and see if all the ideas that were discussed were either implemented or decided that they would not actually help the implementation. If someone wants to go through this and write out the list of things that were mentioned, that would be helpful.
I just tested on master and the original
isprime(int("1808010808"*1560 + "1"))
took 28min 41s to finish on my laptop. I don't know how long it took before. Presumably we can get it faster than this still.We should also go through the discussion here and see if all the ideas that were discussed were either implemented or decided that they would not actually help the implementation. If someone wants to go through this and write out the list of things that were mentioned, that would be helpful.
Hi, I may have been a bit hasty in suggesting to close this issue, but only slightly so:
>>> start=time.time(); isprime(int("1808010808"*1560 + "1")); end=time.time(); print(end-start)
True
91.85459184646606
but that's with gmpy2 installed. Anyway here's the requested summary of the discussion:
So SymPy's pure-python isprime seems to have come down from hours to half an hour (not confirmed personally, may have been on very different hardware), while with gmpy2 installed it's at most a couple of minutes.
IMHO there's only a tiny missing piece: the current isprime
docstring mentions BSPW, but omits to clarify that this requires gmpy2.
Is BSPW something we can implement in pure Python for when we don't have gmpy2 to speed up that case?
Is BSPW something we can implement in pure Python for when we don't have gmpy2 to speed up that case?
Hmm, it may well be that the new isprime
actually implements BSPW as well! Might have missed that.
Is BSPW something we can implement in pure Python for when we don't have gmpy2 to speed up that case?
Yep, is already implemented: https://github.com/sympy/sympy/blob/56dceb1974848d97636f2f41c0893c738380e2e2/sympy/ntheory/primetest.py#L628-L641
Original issue for #6908: http://code.google.com/p/sympy/issues/detail?id=3809 Original author: https://code.google.com/u/asmeurer@gmail.com/