On May 2, 2:44 pm, "Dr. David Kirkby" <david.kir...@onetel.net> wrote:
> Alex Ghitza wrote:
Hi David,
<SNIP>
> > I'm pretty sure that the sage.math answer is more likely to be the
> > right one. You can maybe guess from the timings why I didn't try
> > prime_pi(2^51). I have, however, tried smaller values. I'm going to
> > put that data up on the trac ticket.
>
> Mathematica 6 (on a Sun SPARC) gives an answer in far less time than Sage:
>
> In[3]:= PrimePi[2^50]
>
> PrimePi::largp:
> Argument 1125899906842624 in PrimePi[1125899906842624]
> is too large for this implementation.
>
> Out[3]= PrimePi[1125899906842624]
>
> Well, perhaps not really an answer!
:)
Could you figure out what the upper bound is that MMA allows? I have
discussed this with William in IRC and in 3.4.2 we should just throw a
NotImplementedError for some bound where we are comfortable with
knowing the result is correct on 32 and 64 bit. Unfortunately this
isn't something we can doctest with a reasonable amount of time.
The suggestion then was to implement something on top of the range
computed with floats using MPFR for example, but we will see what
happens. I am sure that if I asked if someone needed to compute
prime_pi() for anything larger than 2^48 someone would say yes, so
this ought to be fixed.
Cheers,
Michael
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---