Ilya Zakharevich on Wed, 24 Jan 2024 10:08:42 +0100


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

Re: Big GOTCHAs WITH forprime()


On Sat, Jan 13, 2024 at 02:25:53AM +0100, Oliver Bandel wrote:
> Here is what I got, after I ran your code example for a while (which I
> then terminated):

> ? my((f(s)=forprime(p=s,s+10^8,)),n=98,x=190333*10^12,y=x+2*10^12,t,z,t0);while(n>0,t=getwalltime();n-=1+if(if(1,f(z=(x+3*y)/4);20000<(t0=-(t-(t=getwalltime())))),x=z;4,y=z;0);print([1.*x,1.*y,t0,n]))
> [190333000000000000.00000000000000000000, 190334500000000000.00000000000000000000, 14699, 97]
  			…
> [190333000000000000.00000000000000000000, 190333000008485243.73013163789896043821, 19491, 55]
> [190333000006363932.79759872842422032866, 190333000008485243.73013163789896043821, 22019, 50]
> [190333000006363932.79759872842422032866, 190333000007954915.99699841053027541082, 19633, 49]
> [190333000006363932.79759872842422032866, 190333000007557170.19714849000376164028, 19783, 48]
> [190333000007258860.84726104960887631237, 190333000007557170.19714849000376164028, 20094, 43]
> [190333000007258860.84726104960887631237, 190333000007482592.85967662990504030830, 19683, 42]
> [190333000007258860.84726104960887631237, 190333000007426659.85657273483099930932, 19150, 41]

Finally, found tuits to look through your “report”.  Thanks!

As you can immediate see, there is no convergence to the “magic
number” 190334138131456478. —  Which means you did not follow the
instructions about tuning up the number 20000 msec to the speed of
your processor.

⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜⁜

Anyway — unless you want (the dubious fun of) running the binary
search yourself — you missed the second part of the bug report
   https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2520#10
which lists the command which fails immediately on my system.

Hope this helps,
Ilya — with no line at all