Georgi Guninski on Sun, 12 May 2024 11:45:32 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: p=randomprime(2^2000) is significantly slower than isprime(p)


Oooops, I made a critical language error, sorry.
isprime(p) is slower than randomprime(p):


? default(timer,1)
? setrand(1)
? p=randomprime(2^2000)
time = 747 ms.
? isprime(p)
time = 14,758 ms.
%4 = 1
? ispseudoprime(p)
time = 40 ms.
%5 = 1

On Sun, May 12, 2024 at 12:38 PM Georgi Guninski <gguninski@gmail.com> wrote:
>
> I find it counter-intuitive p=randomprime(2^2000) to be
> significantly slower than isprime(p)
>
>
> Session
> ---
> default(timer,1)
> setrand(1)
> p=randomprime(2^2000)
> isprime(p)
> ispseudoprime(p)
> ---