Re: Bug in maxima



I think it's not a bug, it's a too slow algorithm. Have a look of timings on 
my Dell 8100 

(C10) primep(100000000003);
Evaluation took 0.14 seconds (0.14 elapsed)
(D10)                                TRUE
(C11) primep(1000000000039);
Evaluation took 0.44 seconds (0.45 elapsed)
(D11)                                TRUE
(C12) primep(10000000000037);
Evaluation took 1.42 seconds (1.42 elapsed)
(D12)                                TRUE
(C13) primep(100000000000031);
Evaluation took 4.92 seconds (5.05 elapsed)
(D13)                                TRUE
(C14) primep(1000000000000037);
Evaluation took 17.64 seconds (17.97 elapsed)
(D14)                                TRUE
(C15) primep(10000000000000061);
Evaluation took 61.32 seconds (63.25 elapsed)
(D15)                                TRUE

Now imagine how long it takes to check 
340282366762482138434845932244680310783.

Maybe this has to do with the not implemented PRIME command:

 - Function: PRIME (n)
     gives the nth prime. MAXPRIME[489318] is the largest number
     accepted as argument.  Note:  The PRIME command does not work in
     maxima, since it required a large file of primes, which most users
     do not want.    PRIMEP does work however.

Jürgen

On Friday 26 April 2002 17:09, Camm Maguire wrote:
> Greetings, and thanks for your report!  Are you using the Debian
> package?  If not, what version of maxima, and what underlying lisp?
>
> If you are using the Debian package, I'd be most appreciative if you
> would submit a bug through the Debian Bug Tracking System.  In any
> case, I'll forward this to the maxima list on your behalf.
>
> Take care,
>
> Cyril Guyot <cyril@zoy.org> writes:
> > Dear Camm,
> >
> > I think there is a bug in the primep routine of maxima. I believe
> > 340282366762482138434845932244680310783 is prime but it does not seem to
> > be recognized as such by maxima.
> >
> > Unfortunately I don't know enough about lisp to actually locate the bug.
> > Let me know if you need more info about it.
> >
> > Best,
> >
> > Cyril
> > --
> > Cyril Guyot