[sage-devel] Re: Divisors

2009-04-09 Thread Peter Jeremy
On 2009-Apr-07 21:49:12 -0700, William Stein wst...@gmail.com wrote: On Tue, Apr 7, 2009 at 9:24 PM, Bill Hart goodwillh...@googlemail.com 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)

[sage-devel] Re: Divisors

2009-04-09 Thread mabshoff
On Apr 9, 2:03 pm, Peter Jeremy peterjer...@optushome.com.au wrote: On 2009-Apr-07 21:49:12 -0700, William Stein wst...@gmail.com wrote: On Tue, Apr 7, 2009 at 9:24 PM, Bill Hart goodwillh...@googlemail.com wrote: The reason it runs slow is a.factor() is bizarrely slow in Sage. It's

[sage-devel] Re: Divisors

2009-04-09 Thread mabshoff
On Apr 9, 2:11 pm, mabshoff mabsh...@googlemail.com wrote: On Apr 9, 2:03 pm, Peter Jeremy peterjer...@optushome.com.au wrote: SNIP 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,

[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

[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-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 goodwillh...@googlemail.com wrote: Yeah, the divisors function otherwise kicks proverbial: Here in Sage (excuse my rubbish python): def random(n):     a = ZZ.random_element(n)    

[sage-devel] Re: Divisors

2009-04-07 Thread William Stein
On Tue, Apr 7, 2009 at 9:24 PM, Bill Hart goodwillh...@googlemail.com 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,

[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 goodwillh...@googlemail.com 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

[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

[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 is a