In[]:=
CloseKernels[]
Out[]=
{}
In[]:=
9
Out[]=
9
In[]:=
Needs["SubKernels`LocalKernels`"]Block[{$mathkernel=$mathkernel<>" -threadpriority=2"},LaunchKernels[]]
Out[]=
{KernelObject[1,local],KernelObject[2,local],KernelObject[3,local],KernelObject[4,local],KernelObject[5,local],KernelObject[6,local],KernelObject[7,local],KernelObject[8,local],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,2600:1700:71d0:fd50:0:0:0:28],KernelObject[18,2600:1700:71d0:fd50:0:0:0:28],KernelObject[19,2600:1700:71d0:fd50:0:0:0:28],KernelObject[20,2600:1700:71d0:fd50:0:0:0:28],KernelObject[21,2600:1700:71d0:fd50:0:0:0:28],KernelObject[22,2600:1700:71d0:fd50:0:0:0:28],KernelObject[23,2600:1700:71d0:fd50:0:0:0:28],KernelObject[24,2600:1700:71d0:fd50:0:0:0:28]}
In[]:=
Print["Start time is ",ds=DateString[],"."];prec=10000;(**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 December 3, 2022 11:54 pm.
Iterations required: 13264
Will give 7 time estimates, each more accurate than the previous.
Will stop at 14336 iterations to ensure precsion of around 10049 decimal places.
0 iterations done in 2.829 seconds. Should take 4343. days or 3.752×s, finish October 24, 2034 2:19 pm.
8
10
2048 iterations done in 5.986 seconds. Should take 0.0004487 days or 38.77s, finish December 3, 2022 11:54 pm.
4096 iterations done in 9.198 seconds. Should take 0.0003447 days or 29.78s, finish December 3, 2022 11:54 pm.
6144 iterations done in 12.57 seconds. Should take 0.0003142 days or 27.14s, finish December 3, 2022 11:54 pm.
8192 iterations done in 16.00 seconds. Should take 0.0002998 days or 25.90s, finish December 3, 2022 11:54 pm.
10240 iterations done in 19.39 seconds. Should take 0.0002907 days or 25.12s, finish December 3, 2022 11:54 pm.
12288 iterations done in 22.70 seconds. Should take 0.0002836 days or 24.50s, finish December 3, 2022 11:54 pm.
Finished on December 3, 2022 11:55 pm. Proccessor time was 22.6453 s.
Actual time was 22.696642
Enter MRBtest2 to print 10043 digits
If you saved m3M, the difference between this and 3,014,991 known digits is 0.1878596425-1.000000000m3M
In[]:=
N[m3M=MRBtest2]
Out[]=
0.18786