Bill Allombert on Sun, 22 Sep 2024 16:03:43 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Suspicious average timing of isprime() (maybe a bug?!)
|
- To: pari-dev@pari.math.u-bordeaux.fr
- Subject: Re: Suspicious average timing of isprime() (maybe a bug?!)
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Sun, 22 Sep 2024 16:03:39 +0200
- Delivery-date: Sun, 22 Sep 2024 16:03:43 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=math.u-bordeaux.fr; s=2022; t=1727013821; bh=XCQnuTDXFHhVDFcKymaSy4ry8gBwhLv7+rsiD0xCvMs=; h=Date:From:To:Subject:References:In-Reply-To:From; b=kOnKFV28g5Zy+ktzcp/vTsuA5AmUAd4Fw9zIM1mv2X2TzF8bScymeUJqAuSw4BX5c w2T1cW7nu2TVZVcSrjh6Gdv8FS0buwb61UhaJYrbk8ER0sVjAfZ2mRpsrcdqhRfxHQ ArL4EkPt0ddVW1n9F1cPGfUTIeaTzwl1x58jyG9T7UV2OeMNDodfNtwd/Q/Q1xP5NR KXil2qfn0gxlKW5lb4/0Hd7XLg/3URfHQGUo5POEKhgbRXk5G8AI6kQW4LlYYbDHdS IZYpMZi9PNVfX+eD/XAVozhskmnUxA5rODhIK1vZh2ap9o8NtDzn1eja9I5UC2/3T+ Lw4KnKgO3lZczk8CWixY+rdJIwOwsfBP+zefqzaTJ3FgcVcm7VQPJmTu6tCkA7+nTk aLJNY36ACXVmQ+OwhlV+Td+WK/6hSEsE3VP8oOZuFvnyWwKXQPHU8wX2IxnssWgL23 uPey689B7phWh+RWAoDZuX3RBe/yFnRiqb8BcVKlfcsKNTp6YqyDA3K3gotGQMo8I7 ebQmFU1pTRWMTtDjWxufhz7Jjcsrrp1DOeT4rfHjvhs/LvZQDp6hQSq0oUx6WqBsg2 Lew/4N+3C3ZJLMXr/6bQk4i04lkEMfc6sX94UplfgbS1/zSsLNwZpHn1Z9iUUrNqgr hYl29l7dkLpQ3IE2XbKpBC5o=
- In-reply-to: <ZvAgoJzPkbFiA5fk@debian.attlocal.net>
- Mail-followup-to: pari-dev@pari.math.u-bordeaux.fr
- References: <Zu8Uh--qjsxq61SQ@debian.attlocal.net> <Zu8l2GUjRZOmqGxu@seventeen> <ZvAgoJzPkbFiA5fk@debian.attlocal.net>
On Sun, Sep 22, 2024 at 06:50:24AM -0700, Ilya Zakharevich wrote:
> On Sat, Sep 21, 2024 at 10:00:24PM +0200, Bill Allombert wrote:
> > > THE RESULT:
> > >
> > > # Start Time Checked primes
> > > 1e19 118.700 457665
> >
> > This one make sense.
>
> This is why I did not exclude it. ;―)
>
> > > 2e19 5323.600 449605
> > > 4e19 6414.950 443260
> > > 8e19 8459.400 437461
> > > 1e20 8443.400 434090
> > > 2e20 8546.700 427974
> > > 4e20 8610.000 422382
>
> Every batch shows a gradual growth with variation of about 1%.
Numbers such that p-1 is hard to factor should be significantly
slower than other.
> > So maybe compute the standard deviation for each batchs ?
>
> See above. Completely negligible variation, then a ∼2x growth/decay
> on an interval of width less than twice the width of averaging.
You can try to change the threshold in
src/basemath/prime.c: 554
static GEN
BPSW_try_PL(GEN N)
{
ulong B = minuu(1UL<<19, maxprime());
Replace 19 by DEBUGVAR, then in GP do
install(setdebugvar,vL)
setdebugvar(19)
Cheers,
Bill