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)
|
- To: pari-dev@pari.math.u-bordeaux.fr
- Subject: Re: p=randomprime(2^2000) is significantly slower than isprime(p)
- From: Georgi Guninski <gguninski@gmail.com>
- Date: Sun, 12 May 2024 12:44:58 +0300
- Delivery-date: Sun, 12 May 2024 11:45:32 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715507129; x=1716111929; darn=pari.math.u-bordeaux.fr; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9FuUcpxZuozpQLCJ9zs/H8FU/jl6tKucMIwuOeJuLkA=; b=iIA85Urd50vhlv9ZpvSzBdXwaBXnoDTkiHx+t2GVTVFjjkD2+yWi0ZARe1mn13RAw7 sEdWMB7MZT4RjkjcgkgOexTU6KNh5zohW7t/N4jSqURqoJWDM3rIlKFZhzr7E2eezywb 8TK4MNIq/VTzzR4dlNh+gi/RxTVGNCbsiNb0Cf2Su564NfCe7rgVDpbX9bNDIumwDHOq A0dHkBT7pZaPcll8Bl23Jyb67v5UGHJlZM2xsAV+nW4WR8T7B25VBqOv0etBAwlPK3bu wL63II1D8UT8/s+n4uk8TQyy2GX36UTEq+rD/Jk/IQS7du7xt5lrRKgzrCoIZP7rsiA9 hv6w==
- In-reply-to: <CAGUWgD8XoGdsdR0ammRUG6EhVoeJVPM8Yvp6KSUie1F4U_cCvQ@mail.gmail.com>
- References: <CAGUWgD8XoGdsdR0ammRUG6EhVoeJVPM8Yvp6KSUie1F4U_cCvQ@mail.gmail.com>
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)
> ---