Comment #22 on issue 1827 by smi...@gmail.com: log eval gives more standard form
http://code.google.com/p/sympy/issues/detail?id=1827
Well, ya got lucky and sympy improved because of it! From what I've learned, a more deterministic way of doing it would be to pick a large prime, p, out of the 2**15 range and then pick another that is more than sqrt(p) away, preferably p away, and then the product shouldn't be so easily factored with trial division (at least). If the second prime is within sqrt(p) then factors will be found as easily with the relatively quick Fermat test as the small factors are found with trial division. So...p = nextprime(2**30); p *= nextprime(2*p) should give a small(er) p that is hard to factor with trial division. Starting from 2**24 gives a slight delay...2**25 gives a significant delay. 2**30 would be big enough to write a test that would appear to hang The thing is, the special methods can find a factor if it's is sitting *next to* something that has special properties. So that prime made starting with primes past 2**30 factors in less than 2 seconds. So if you employ the special methods you're going to be able to handle much larger input...at the risk of getting hung up by the rarer strong pseudoprime. While writing this I have had a loop running: >>> for i in range(25,60): ... p=nextprime(2**i);p*=nextprime(2*p);print i, p, factorint(p) i = 41 took a long time and 42 is taking a long time. So perhaps I should add one of these into the tests. -- You received this message because you are subscribed to the Google Groups "sympy-issues" group. To post to this group, send email to sympy-issues@googlegroups.com. To unsubscribe from this group, send email to sympy-issues+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy-issues?hl=en.