[sage-devel] Re: Divisors

2009-04-09 Thread Bill Hart
Feeding the factors to Sage's factor command to check they are prime is precisely what proof=true is all about. Testing primality in a proven way, for numbers bigger than 10^16 is still very slow as there is no really good algorithm known for it. I have some code written by a student of mine (Pete

[sage-devel] Re: Divisors

2009-04-09 Thread mabshoff
On Apr 9, 2:11 pm, mabshoff wrote: > On Apr 9, 2:03 pm, Peter Jeremy wrote: > The primality test for pari is known to be lead to false results up to > 10^14 or so (FLINT's is up to 10^16 IIRC what Bill told me a couple > days ago). Opps, I don't know what I was thinking, but the above make

[sage-devel] Re: Divisors

2009-04-09 Thread mabshoff
On Apr 9, 2:03 pm, Peter Jeremy wrote: > On 2009-Apr-07 21:49:12 -0700, William Stein wrote: > > > > >On Tue, Apr 7, 2009 at 9:24 PM, Bill Hart > >wrote: > >> The reason it runs slow is a.factor() is bizarrely slow in Sage. It's > >> like a factor of 50 times slower than Pari. > > >There are

[sage-devel] Re: Divisors

2009-04-09 Thread Peter Jeremy
On 2009-Apr-07 21:49:12 -0700, William Stein wrote: > >On Tue, Apr 7, 2009 at 9:24 PM, Bill Hart wrote: >> The reason it runs slow is a.factor() is bizarrely slow in Sage. It's >> like a factor of 50 times slower than Pari. > >There are some differences: > (1) pari's factor is *not* provably c

[sage-devel] Re: Divisors

2009-04-08 Thread Bill Hart
I mean half the memory that Sage uses, not half the memory of the machine. Bill. On 8 Apr, 09:21, Bill Hart wrote: > Yeah, the divisors function otherwise kicks proverbial: > > Here in Sage (excuse my rubbish python): > > def random(n): >     a = ZZ.random_element(n) >     return a > > def z_di

[sage-devel] Re: Divisors

2009-04-08 Thread Bill Hart
Yeah, the divisors function otherwise kicks proverbial: Here in Sage (excuse my rubbish python): def random(n): a = ZZ.random_element(n) return a def z_divisors_test(m): for j in range(0, m) : n = random(10) z = 1 c = 1 for i in range(0, n):

[sage-devel] Re: Divisors

2009-04-07 Thread Robert Bradshaw
On Apr 7, 2009, at 10:26 PM, Bill Hart wrote: > > William didn't mention the context of this, which is that for small > integers most of the time taken by the divisors method in ZZ is taken > up with factoring. It seems much more likely people will use small > numbers as inputs to this, so this i

[sage-devel] Re: Divisors

2009-04-07 Thread Bill Hart
William didn't mention the context of this, which is that for small integers most of the time taken by the divisors method in ZZ is taken up with factoring. It seems much more likely people will use small numbers as inputs to this, so this is a shame, given the amount of work that (I hear) went in

[sage-devel] Re: Divisors

2009-04-07 Thread Bill Hart
Proof won't make a difference on the numbers I'm using, which are less than 1,000,000. Pari does the same thing for proving primality below about 10^13 or something like that, whether proved or not (the pseudoprimality test it uses is known to have no counterexample). By the way, the FLINT functio

[sage-devel] Re: Divisors

2009-04-07 Thread Robert Bradshaw
On Apr 7, 2009, at 9:49 PM, William Stein wrote: > > On Tue, Apr 7, 2009 at 9:24 PM, Bill Hart > wrote: >> The reason it runs slow is a.factor() is bizarrely slow in Sage. It's >> like a factor of 50 times slower than Pari. > > There are some differences: >(1) pari's factor is *not* prova

[sage-devel] Re: Divisors

2009-04-07 Thread William Stein
On Tue, Apr 7, 2009 at 9:24 PM, Bill Hart wrote: > The reason it runs slow is a.factor() is bizarrely slow in Sage. It's > like a factor of 50 times slower than Pari. There are some differences: (1) pari's factor is *not* provably correct, but Sage's is. [That said, this will make no differe