In[]:=
CloseKernels[]
Out[]=
{KernelObject[9,local,<defunct>],KernelObject[10,local,<defunct>],KernelObject[11,local,<defunct>],KernelObject[12,local,<defunct>],KernelObject[13,local,<defunct>],KernelObject[14,local,<defunct>],KernelObject[15,local,<defunct>],KernelObject[16,local,<defunct>]}
In[]:=
Needs["SubKernels`LocalKernels`"]Block[{$mathkernel=$mathkernel<>" -threadpriority=2"},LaunchKernels[]]
DESKTOP-0U8UH9R
.Out[]=
{KernelObject[2,DESKTOP-0U8UH9R],KernelObject[3,DESKTOP-0U8UH9R],KernelObject[4,DESKTOP-0U8UH9R],KernelObject[5,DESKTOP-0U8UH9R],KernelObject[6,DESKTOP-0U8UH9R],KernelObject[7,DESKTOP-0U8UH9R],KernelObject[8,DESKTOP-0U8UH9R],KernelObject[9,DESKTOP-TLQ2UBE],KernelObject[10,DESKTOP-TLQ2UBE],KernelObject[11,DESKTOP-TLQ2UBE],KernelObject[12,DESKTOP-TLQ2UBE],KernelObject[13,DESKTOP-TLQ2UBE],KernelObject[14,DESKTOP-TLQ2UBE],KernelObject[15,DESKTOP-TLQ2UBE],KernelObject[16,DESKTOP-TLQ2UBE],KernelObject[17,local],KernelObject[18,local],KernelObject[19,local],KernelObject[20,local],KernelObject[21,local],KernelObject[22,local],KernelObject[23,local],KernelObject[24,local]}
In[]:=
Print["Start time is ",ds=DateString[],"."];prec=1000000;(**Numberofrequireddecimals.*.*)ClearSystemCache[];T0=SessionTime[];expM[pre_]:=Module[{a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=16(*=4*numberofphysicalcores*),tsize=2^7,chunksize,start=1,ll,ctab,pr=Floor[1.005pre]},chunksize=cores*tsize;n=Floor[1.32pr];end=Ceiling[n/chunksize];Print["Iterations required: ",n];Print["Will give ",end," time estimates, each more accurate than the previous."];Print["Will stop at ",end*chunksize," iterations to ensure precsion of around ",pr," decimal places."];d=ChebyshevT[n,3];{b,c,s}={SetPrecision[-1,1.1*n],-d,0};iprec=Ceiling[pr/6912];Do[xvals=Flatten[Parallelize[Table[Table[ll=start+j*tsize+l;x=N[E^(Log[ll]/(ll)),iprec];pc=iprec;While[pc<pr/1024,pc=Min[3pc,pr/1024];x=SetPrecision[x,pc];y=x^ll-ll;x=x(1-2y/((ll+1)y+2llll));];(**N[Exp[Log[ll]/ll],pr/1024]**)x=SetPrecision[x,pr/256];xll=x^ll;z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pr/256](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pr/256]ll(ll-1)1/(3llt2+t^3z));(*N[Exp[Log[ll]/ll],pr/256]*)x=SetPrecision[x,pr/64];xll=x^ll;z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pr/64](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pr/64]ll(ll-1)1/(3llt2+t^3z));(**N[Exp[Log[ll]/ll],pr/64]**)x=SetPrecision[x,pr/16];xll=x^ll;z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pr/16](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pr/16]ll(ll-1)1/(3llt2+t^3z));(**N[Exp[Log[ll]/ll],pr/16]**)x=SetPrecision[x,pr/4];xll=x^ll;z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pr/4](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pr/4]ll(ll-1)1/(3llt2+t^3z));(**N[Exp[Log[ll]/ll],pr/4]**)x=SetPrecision[x,pr];xll=x^ll;z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pr](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pr]ll(ll-1)1/(3llt2+t^3z));(*N[Exp[Log[ll]/ll],pr]*)x,{l,0,tsize-1}],{j,0,cores-1}]]];ctab=ParallelTable[Table[c=b-c;ll=start+l-2;b*=2(ll+n)(ll-n)/((ll+1)(2ll+1));c,{l,chunksize}],Method->"Automatic"];s+=ctab.(xvals-1);start+=chunksize;st=SessionTime[]-T0;kc=k*chunksize;ti=(st)/(kc+10^-4)*(n)/(3600)/(24);Print[kc," iterations done in ",N[st,4]," seconds."," Should take ",N[ti,4]," days or ",N[ti*24*3600,4],"s, finish ",DatePlus[ds,ti],"."],{k,0,end-1}];N[-s/d,pr]];t2=Timing[MRBtest2=expM[prec];];Print["Finished on ",DateString[],". Proccessor time was ",t2[[1]]," s."];Print["Actual time was ",st];(*Print[*)MRBtest2(*]*)(*Remove(**)orenterMRBtest2toprintoutput*);Print["Enter MRBtest2 to print ",Floor[Precision[MRBtest2]]," digits"];Print["If you saved m3M, the difference between this and 3,014,991 known digits is ",N[MRBtest2-m3M,10]]
Start time is Sun 4 Dec 2022 03:11:25.
Iterations required: 1326598
Will give 648 time estimates, each more accurate than the previous.
Will stop at 1327104 iterations to ensure precsion of around 1004999 decimal places.
0 iterations done in 137.2 seconds. Should take 2.106× days or 1.820×s, finish Thu 28 Oct 59694 21:27:53.
7
10
12
10
2048 iterations done in 279.4 seconds. Should take 2.095 days or 1.810×s, finish Tue 6 Dec 2022 05:28:01.
5
10
4096 iterations done in 423.2 seconds. Should take 1.587 days or 1.371×s, finish Mon 5 Dec 2022 17:16:04.
5
10
6144 iterations done in 568.6 seconds. Should take 1.421 days or 1.228×s, finish Mon 5 Dec 2022 13:17:43.
5
10
8192 iterations done in 714.0 seconds. Should take 1.338 days or 1.156×s, finish Mon 5 Dec 2022 11:18:33.
5
10
10240 iterations done in 860.2 seconds. Should take 1.290 days or 1.114×s, finish Mon 5 Dec 2022 10:08:42.
5
10
12288 iterations done in 1008. seconds. Should take 1.259 days or 1.088×s, finish Mon 5 Dec 2022 09:24:13.
5
10
14336 iterations done in 1155. seconds. Should take 1.237 days or 1.069×s, finish Mon 5 Dec 2022 08:52:54.
5
10
16384 iterations done in 1303. seconds. Should take 1.221 days or 1.055×s, finish Mon 5 Dec 2022 08:29:47.
5
10
18432 iterations done in 1452. seconds. Should take 1.209 days or 1.045×s, finish Mon 5 Dec 2022 08:13:03.
5
10
20480 iterations done in 1601. seconds. Should take 1.200 days or 1.037×s, finish Mon 5 Dec 2022 07:59:35.
5
10
22528 iterations done in 1751. seconds. Should take 1.193 days or 1.031×s, finish Mon 5 Dec 2022 07:49:29.
5
10
24576 iterations done in 1900. seconds. Should take 1.187 days or 1.026×s, finish Mon 5 Dec 2022 07:40:56.
5
10
26624 iterations done in 2051. seconds. Should take 1.183 days or 1.022×s, finish Mon 5 Dec 2022 07:34:36.
5
10
28672 iterations done in 2202. seconds. Should take 1.179 days or 1.019×s, finish Mon 5 Dec 2022 07:29:46.
5
10
30720 iterations done in 2355. seconds. Should take 1.177 days or 1.017×s, finish Mon 5 Dec 2022 07:26:07.
5
10
32768 iterations done in 2506. seconds. Should take 1.174 days or 1.015×s, finish Mon 5 Dec 2022 07:22:22.
5
10
34816 iterations done in 2658. seconds. Should take 1.172 days or 1.013×s, finish Mon 5 Dec 2022 07:19:14.
5
10
36864 iterations done in 2810. seconds. Should take 1.170 days or 1.011×s, finish Mon 5 Dec 2022 07:16:41.
5
10
38912 iterations done in 2963. seconds. Should take 1.169 days or 1.010×s, finish Mon 5 Dec 2022 07:14:53.
5
10
40960 iterations done in 3115. seconds. Should take 1.168 days or 1.009×s, finish Mon 5 Dec 2022 07:12:48.
5
10
43008 iterations done in 3268. seconds. Should take 1.167 days or 1.008×s, finish Mon 5 Dec 2022 07:11:39.
5
10
45056 iterations done in 3423. seconds. Should take 1.166 days or 1.008×s, finish Mon 5 Dec 2022 07:10:57.
5
10
47104 iterations done in 3577. seconds. Should take 1.166 days or 1.007×s, finish Mon 5 Dec 2022 07:10:11.
5
10
49152 iterations done in 3730. seconds. Should take 1.165 days or 1.007×s, finish Mon 5 Dec 2022 07:09:13.
5
10
51200 iterations done in 3884. seconds. Should take 1.165 days or 1.006×s, finish Mon 5 Dec 2022 07:08:48.
5
10
53248 iterations done in 4039. seconds. Should take 1.165 days or 1.006×s, finish Mon 5 Dec 2022 07:08:39.
5
10
55296 iterations done in 4194. seconds. Should take 1.164 days or 1.006×s, finish Mon 5 Dec 2022 07:08:15.
5
10
57344 iterations done in 4349. seconds. Should take 1.164 days or 1.006×s, finish Mon 5 Dec 2022 07:08:03.
5
10
59392 iterations done in 4503. seconds. Should take 1.164 days or 1.006×s, finish Mon 5 Dec 2022 07:07:54.
5
10
61440 iterations done in 4659. seconds. Should take 1.164 days or 1.006×s, finish Mon 5 Dec 2022 07:07:58.
5
10
63488 iterations done in 4816. seconds. Should take 1.165 days or 1.006×s, finish Mon 5 Dec 2022 07:08:40.
5
10
65536 iterations done in 4972. seconds. Should take 1.165 days or 1.006×s, finish Mon 5 Dec 2022 07:08:40.
5
10
67584 iterations done in 5128. seconds. Should take 1.165 days or 1.007×s, finish Mon 5 Dec 2022 07:09:01.
5
10
69632 iterations done in 5284. seconds. Should take 1.165 days or 1.007×s, finish Mon 5 Dec 2022 07:09:21.
5
10
71680 iterations done in 5442. seconds. Should take 1.166 days or 1.007×s, finish Mon 5 Dec 2022 07:10:07.
5
10
73728 iterations done in 5599. seconds. Should take 1.166 days or 1.008×s, finish Mon 5 Dec 2022 07:10:35.
5
10
75776 iterations done in 5758. seconds. Should take 1.167 days or 1.008×s, finish Mon 5 Dec 2022 07:11:35.
5
10
77824 iterations done in 5916. seconds. Should take 1.167 days or 1.009×s, finish Mon 5 Dec 2022 07:12:16.
5
10
79872 iterations done in 6077. seconds. Should take 1.168 days or 1.009×s, finish Mon 5 Dec 2022 07:13:39.
5
10
81920 iterations done in 6237. seconds. Should take 1.169 days or 1.010×s, finish Mon 5 Dec 2022 07:14:52.
5
10
83968 iterations done in 6398. seconds. Should take 1.170 days or 1.011×s, finish Mon 5 Dec 2022 07:16:00.
5
10
86016 iterations done in 6558. seconds. Should take 1.171 days or 1.011×s, finish Mon 5 Dec 2022 07:17:04.
5
10
88064 iterations done in 6723. seconds. Should take 1.172 days or 1.013×s, finish Mon 5 Dec 2022 07:19:15.
5
10
90112 iterations done in 6888. seconds. Should take 1.174 days or 1.014×s, finish Mon 5 Dec 2022 07:21:29.
5
10
92160 iterations done in 7052. seconds. Should take 1.175 days or 1.015×s, finish Mon 5 Dec 2022 07:23:20.
5
10
94208 iterations done in 7220. seconds. Should take 1.177 days or 1.017×s, finish Mon 5 Dec 2022 07:25:48.
5
10
96256 iterations done in 7384. seconds. Should take 1.178 days or 1.018×s, finish Mon 5 Dec 2022 07:27:30.
5
10
98304 iterations done in 7550. seconds. Should take 1.179 days or 1.019×s, finish Mon 5 Dec 2022 07:29:32.
5
10
100352 iterations done in 7713. seconds. Should take 1.180 days or 1.020×s, finish Mon 5 Dec 2022 07:30:43.
5
10
102400 iterations done in 7879. seconds. Should take 1.181 days or 1.021×s, finish Mon 5 Dec 2022 07:32:39.
5
10
104448 iterations done in 8042. seconds. Should take 1.182 days or 1.021×s, finish Mon 5 Dec 2022 07:33:50.
5
10
106496 iterations done in 8211. seconds. Should take 1.184 days or 1.023×s, finish Mon 5 Dec 2022 07:36:05.
5
10
108544 iterations done in 8374. seconds. Should take 1.184 days or 1.023×s, finish Mon 5 Dec 2022 07:37:05.
5
10
110592 iterations done in 8544. seconds. Should take 1.186 days or 1.025×s, finish Mon 5 Dec 2022 07:39:34.
5
10
112640 iterations done in 8710. seconds. Should take 1.187 days or 1.026×s, finish Mon 5 Dec 2022 07:41:10.
5
10
114688 iterations done in 8882. seconds. Should take 1.189 days or 1.027×s, finish Mon 5 Dec 2022 07:43:44.
5
10