On Tue, May 5, 2009 at 11:43 AM, VictorMiller <victorsmil...@gmail.com> wrote:
>
> As a comparison I just ran my old C program (implementing the
> algorithm in my paper with Lagarias and Odlyzko) on my workstation
> which is a fast Dell '86 box (sorry I don't have more details) running
> Red Hat:

Wow, I didn't know Dell was selling computers back in 1986.  :-)  [just kiddin']

>
> time ./findn 249999999999999
> n=249_999_999_999_999
> pi(249_999_999_999_999)=7_783_516_108_362
>
> real    0m18.826s
> user    0m18.628s
> sys     0m0.028s

Wow, nice!    Give my your C code!!


>
>
> On May 5, 4:18 am, mabshoff <mabsh...@googlemail.com> wrote:
>> On May 5, 12:44 am, "Dr. David Kirkby" <david.kir...@onetel.net>
>> wrote:
>>
>> > mabshoff wrote:
>>
>> <SNIP>
>>
>> Hi Dave,
>>
>> > > We are talking about two different limits here.
>>
>> > No, we were not - just a confusing way I wrote it. A memory alloction
>> > issue is completely different to limiting an algorithm due to concerns
>> > about it.
>>
>> Well, I certainly am. To recap:
>>
>>  (a) prime_pi() used to use to be trivially implemented as len
>> (prime_range())
>>  (b) len(prime_range()) sucks memory and performance wise, i.e. eats
>> in excess of 124GB for input n=2^35 and plainly segfaults for n=2^50.
>>  (c) we have known failures of the new prime_pi() for some inputs,
>> i.e. n=2^47
>>
>> So what I am doing is:
>>
>>  (a) cap the new prime_pi() to 2^40 since that is the upper bound we
>> can verify via doctests in reasonable time. Given the wide testing I
>> have done this seems to work.
>>  (c) cap prime_range() to a reasonable value and/or rewrite it sanely
>> - this has not happened yet.
>>
>> > As a matter of interested, what does Sage give for
>> > primepi(249999999999999)? Is it the same as Mathematica (7783516108362)?
>>
>> Sage.math, i.e. 64 bit, gives me:
>>
>> sage: time prime_pi(249999999999999)
>> CPU times: user 1241.60 s, sys: 1.07 s, total: 1242.67 s
>> Wall time: 1243.69 s
>> 7783516108362
>>
>> Since this is 20 minutes CPU time on a fast box we cannot make this a
>> doctest, even a long one. I guess we need to implement a better
>> algorithm :p
>>
>> > It would be interesting if it gave the same result as Mathematica on any
>> > of the computers.
>>
>> > In[95]:= PrimePi[249999999999999]
>> > Out[95]= 7783516108362
>>
>> > Dave
>>
>> Cheers,
>>
>> Michael
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to