In[]:=
Print["Start time is ",ds=DateString[],"."];prec=2000;(**Numberofrequireddecimals.*.*)ClearSystemCache[];T0=SessionTime[];expM[pre_]:=Module[{x11,z,t,a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=16(*=4*numberofphysicalcores*),tsize=128,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=pr/64;Do[xvals=Flatten[ParallelTable[Table[ll=start+j*tsize+l;x=N[E^(Log[ll]/(ll)),iprec];pc=iprec;While[pc<pr,pc=Min[4pc,pr];x=SetPrecision[x,pc];xll=Power[x,ll];z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pc](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pc]ll(ll-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);If[kc>1,Print["As of ",DateString[]," there were ",kc," iterations done in ",N[st,5]," seconds. That is ",N[kc/st,5]," iterations/s. ",N[kc/(end*chunksize)*100,7],"% complete."," It should take ",N[ti,6]," days or ",N[ti*24*3600,4],"s, and finish ",DatePlus[ds,ti],"."]];Print[];,{k,0,end-1}];N[-s/d,pr]];t2=Timing[MRB1=expM[prec];];Print["Finished on ",DateString[],". Proccessor and actual time were ",t2[[1]]," and ",SessionTime[]-T0," s. respectively"];Print["Enter MRB1 to print ",Floor[Precision[MRB1]]," digits. The error from a 6,500,000 or more digit calculation that used a different method is "];N[MRB-MRB1,20]
Start time is Thu 20 Oct 2022 11:48:17.
Iterations required: 2651
Will give 2 time estimates, each more accurate than the previous.
Will stop at 4096 iterations to ensure precsion of around 2009 decimal places.
As of Thu 20 Oct 2022 11:48:18 there were 2048 iterations done in 0.23258 seconds. That is 8805.5 iterations/s. 50.00000% complete. It should take 3.48449× days or 0.3011s, and finish Thu 20 Oct 2022 11:48:17.
-6
10
Finished on Thu 20 Oct 2022 11:48:18. Proccessor and actual time were 0.171875 and 0.2325806 s. respectively
Enter MRB1 to print 2004 digits. The error from a 6,500,000 or more digit calculation that used a different method is
Out[]=
0.×
-2006
10
In[]:=
Print["Start time is ",ds=DateString[],"."];prec=2500;(**Numberofrequireddecimals.*.*)ClearSystemCache[];T0=SessionTime[];expM[pre_]:=Module[{x11,z,t,a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=16(*=4*numberofphysicalcores*),tsize=128,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=pr/64;Do[xvals=Flatten[ParallelTable[Table[ll=start+j*tsize+l;x=N[E^(Log[ll]/(ll)),iprec];pc=iprec;While[pc<pr,pc=Min[4pc,pr];x=SetPrecision[x,pc];xll=Power[x,ll];z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pc](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pc]ll(ll-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);If[kc>1,Print["As of ",DateString[]," there were ",kc," iterations done in ",N[st,5]," seconds. That is ",N[kc/st,5]," iterations/s. ",N[kc/(end*chunksize)*100,7],"% complete."," It should take ",N[ti,6]," days or ",N[ti*24*3600,4],"s, and finish ",DatePlus[ds,ti],"."]];Print[];,{k,0,end-1}];N[-s/d,pr]];t2=Timing[MRB1=expM[prec];];Print["Finished on ",DateString[],". Proccessor and actual time were ",t2[[1]]," and ",SessionTime[]-T0," s. respectively"];Print["Enter MRB1 to print ",Floor[Precision[MRB1]]," digits. The error from a 6,500,000 or more digit calculation that used a different method is "];N[MRB-MRB1,20]
Start time is Thu 20 Oct 2022 11:46:27.
Iterations required: 3315
Will give 2 time estimates, each more accurate than the previous.
Will stop at 4096 iterations to ensure precsion of around 2512 decimal places.
As of Thu 20 Oct 2022 11:46:27 there were 2048 iterations done in 0.27374 seconds. That is 7481.6 iterations/s. 50.00000% complete. It should take 5.12830× days or 0.4431s, and finish Thu 20 Oct 2022 11:46:27.
-6
10
Finished on Thu 20 Oct 2022 11:46:27. Proccessor and actual time were 0.234375 and 0.2737370 s. respectively
Enter MRB1 to print 2507 digits. The error from a 6,500,000 or more digit calculation that used a different method is
Out[]=
0.×
-2509
10
In[]:=
Print["Start time is ",ds=DateString[],"."];prec=5000;(**Numberofrequireddecimals.*.*)ClearSystemCache[];T0=SessionTime[];expM[pre_]:=Module[{x11,z,t,a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=16(*=4*numberofphysicalcores*),tsize=128,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=pr/64;Do[xvals=Flatten[ParallelTable[Table[ll=start+j*tsize+l;x=N[E^(Log[ll]/(ll)),iprec];pc=iprec;While[pc<pr,pc=Min[4pc,pr];x=SetPrecision[x,pc];xll=Power[x,ll];z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pc](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pc]ll(ll-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);If[kc>1,Print["As of ",DateString[]," there were ",kc," iterations done in ",N[st,5]," seconds. That is ",N[kc/st,5]," iterations/s. ",N[kc/(end*chunksize)*100,7],"% complete."," It should take ",N[ti,6]," days or ",N[ti*24*3600,4],"s, and finish ",DatePlus[ds,ti],"."]];Print[];,{k,0,end-1}];N[-s/d,pr]];t2=Timing[MRB1=expM[prec];];Print["Finished on ",DateString[],". Proccessor and actual time were ",t2[[1]]," and ",SessionTime[]-T0," s. respectively"];Print["Enter MRB1 to print ",Floor[Precision[MRB1]]," digits. The error from a 6,500,000 or more digit calculation that used a different method is "];N[MRB-MRB1,20]