V11.3

CloseKernels[]

Needs["SubKernels`LocalKernels`"]
Block[{$mathkernel=$mathkernel<>" -threadpriority=2"},LaunchKernels[]]

Print["Start time is ",ds=DateString[],"."];
prec=5000;
(**Number of required decimals.*.*)ClearSystemCache[];
T0=SessionTime[];
expM[pre_]:=Module[{a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=32(*=4*number of physical cores*),tsize=2^7,chunksize,start=1,ll,ctab,pr=Floor[1.005 pre]},chunksize=cores*tsize;
n=Floor[1.32 pr];
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/27];
Do[xvals=Flatten[ParallelTable[Table[ll=start+j*tsize+l;
x=N[E^(Log[ll]/(ll)),iprec];
pc=iprec;
While[pc<pr,pc=Min[3 pc,pr];
x=SetPrecision[x,pc];
y=x^ll-ll;
x=x (1-2 y/((ll+1) y+2 ll ll));];(**N[Exp[Log[ll]/ll],pr]**)x,{l,0,tsize-1}],{j,0,cores-1},Method->"EvaluationsPerKernel"->64(*a power of 2 commensurate with processor strength*)]];
ctab=ParallelTable[Table[c=b-c;
ll=start+l-2;
b*=2 (ll+n) (ll-n)/((ll+1) (2 ll+1));
c,{l,chunksize}],Method->"EvaluationsPerKernel"->16(*a power of 2 commensurate with processor strength*)];
s+=ctab.(xvals-1);
start+=chunksize;
st=SessionTime[]-T0;kc=k*chunksize;
ti=(st)/(kc+10^-4)*(n)/(3600)/(24);
If[kc>1,Print[kc," iterations done in ",N[st,3]," seconds."," Should take ",N[ti,2]," days or ",N[ti*24*3600,2],"s, finish ",DatePlus[ds,ti],"."]];,{k,0,end-1}];
N[-s/d,pr]];
t2=Timing[MRBtest2=expM[prec];];Print["Finished on ",DateString[],". Processor time was ",t2[[1]]," s. Actual time was ",SessionTime[]-T0,"."];
(*Print[*)MRBtest2(*]*)(*Remove (**) or enter MRBtest2 to print output*);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]]

"Finished on ""Sun 27 Sep 2020 08:00:35"". Processor time was "1.609375`" s. Actual time was "1.8351951`7.414197238817584"."

"Finished on ""Wed 23 Sep 2020 19:19:30"". Processor time was "1.671875`" s. Actual time was "1.8441328`7.41630719016268"."

Print["Start time is ",ds=DateString[],"."];
prec=10000;
(**Number of required decimals.*.*)ClearSystemCache[];
T0=SessionTime[];
expM[pre_]:=Module[{a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=32(*=4*number of physical cores*),tsize=2^7,chunksize,start=1,ll,ctab,pr=Floor[1.005 pre]},chunksize=cores*tsize;
n=Floor[1.32 pr];
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/27];
Do[xvals=Flatten[ParallelTable[Table[ll=start+j*tsize+l;
x=N[E^(Log[ll]/(ll)),iprec];
pc=iprec;
While[pc<pr,pc=Min[3 pc,pr];
x=SetPrecision[x,pc];
y=x^ll-ll;
x=x (1-2 y/((ll+1) y+2 ll ll));];(**N[Exp[Log[ll]/ll],pr]**)x,{l,0,tsize-1}],{j,0,cores-1},Method->"EvaluationsPerKernel"->64(*a power of 2 commensurate with processor strength*)]];
ctab=ParallelTable[Table[c=b-c;
ll=start+l-2;
b*=2 (ll+n) (ll-n)/((ll+1) (2 ll+1));
c,{l,chunksize}],Method->"EvaluationsPerKernel"->16(*a power of 2 commensurate with processor strength*)];
s+=ctab.(xvals-1);
start+=chunksize;
st=SessionTime[]-T0;kc=k*chunksize;
ti=(st)/(kc+10^-4)*(n)/(3600)/(24);
If[kc>1,Print[kc," iterations done in ",N[st,3]," seconds."," Should take ",N[ti,2]," days or ",N[ti*24*3600,2],"s, finish ",DatePlus[ds,ti],"."]];,{k,0,end-1}];
N[-s/d,pr]];
t2=Timing[MRBtest2=expM[prec];];Print["Finished on ",DateString[],". Processor time was ",t2[[1]]," s. Actual time was ",SessionTime[]-T0,"."];
(*Print[*)MRBtest2(*]*)(*Remove (**) or enter MRBtest2 to print output*);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-m5M,10]]

"Finished on ""Wed 23 Sep 2020 19:19:53"". Processor time was "6.609375`" s. Actual time was "7.1612446`8.005503505606175"."

Print["Start time is ",ds=DateString[],"."];
prec=20000;
(**Number of required decimals.*.*)ClearSystemCache[];
T0=SessionTime[];expM[pre_]:=Module[{a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=32(*=4*number of physical cores*),tsize=2^7,chunksize,start=1,ll,ctab,pr=Floor[1.005 pre]},chunksize=cores*tsize;
n=Floor[1.32 pr];
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/27];
Do[xvals=Flatten[ParallelTable[Table[ll=start+j*tsize+l;
x=N[E^(Log[ll]/(ll)),iprec];
pc=iprec;
While[pc<pr,pc=Min[3 pc,pr];
x=SetPrecision[x,pc];
y=x^ll-ll;
x=x (1-2 y/((ll+1) y+2 ll ll));];(**N[Exp[Log[ll]/ll],pr]**)x,{l,0,tsize-1}],{j,0,cores-1},Method->"EvaluationsPerKernel"->56(*a power of 2 commensurate with processor strength*)]];
ctab=ParallelTable[Table[c=b-c;
ll=start+l-2;
b*=2 (ll+n) (ll-n)/((ll+1) (2 ll+1));
c,{l,chunksize}],Method->"EvaluationsPerKernel"->16(*a power of 2 commensurate with processor strength*)];
s+=ctab.(xvals-1);
start+=chunksize;
st=SessionTime[]-T0;kc=k*chunksize;
ti=(st)/(kc+10^-4)*(n)/(3600)/(24);
If[kc>1,Print[kc," iterations done in ",N[st,3]," seconds."," Should take ",N[ti,2]," days or ",N[ti*24*3600,2],"s, finish ",DatePlus[ds,ti],"."]];,{k,0,end-1}];
N[-s/d,pr]];
t2=Timing[MRBtest2=expM[prec];];Print["Finished on ",DateString[],". Processor time was ",t2[[1]]," s. Actual time was ",SessionTime[]-T0,"."];
(*Print[*)MRBtest2(*]*)(*Remove (**) or enter MRBtest2 to print output*);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]]

Print["Start time is ",ds=DateString[],"."];
prec=30000;
(**Number of required decimals.*.*)ClearSystemCache[];
T0=SessionTime[];expM[pre_]:=Module[{a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=32(*=4*number of physical cores*),tsize=2^7,chunksize,start=1,ll,ctab,pr=Floor[1.005 pre]},chunksize=cores*tsize;
n=Floor[1.32 pr];
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/27];
Do[xvals=Flatten[ParallelTable[Table[ll=start+j*tsize+l;
x=N[E^(Log[ll]/(ll)),iprec];
pc=iprec;
While[pc<pr,pc=Min[3 pc,pr];
x=SetPrecision[x,pc];
y=x^ll-ll;
x=x (1-2 y/((ll+1) y+2 ll ll));];(**N[Exp[Log[ll]/ll],pr]**)x,{l,0,tsize-1}],{j,0,cores-1},Method->"EvaluationsPerKernel"->56(*a power of 2 commensurate with processor strength*)]];
ctab=ParallelTable[Table[c=b-c;
ll=start+l-2;
b*=2 (ll+n) (ll-n)/((ll+1) (2 ll+1));
c,{l,chunksize}],Method->"EvaluationsPerKernel"->16(*a power of 2 commensurate with processor strength*)];
s+=ctab.(xvals-1);
start+=chunksize;
st=SessionTime[]-T0;kc=k*chunksize;
ti=(st)/(kc+10^-4)*(n)/(3600)/(24);
If[kc>1,Print[kc," iterations done in ",N[st,3]," seconds."," Should take ",N[ti,2]," days or ",N[ti*24*3600,2],"s, finish ",DatePlus[ds,ti],"."]];,{k,0,end-1}];
N[-s/d,pr]];
t2=Timing[MRBtest2=expM[prec];];Print["Finished on ",DateString[],". Processor time was ",t2[[1]]," s. Actual time was ",SessionTime[]-T0,"."];
(*Print[*)MRBtest2(*]*)(*Remove (**) or enter MRBtest2 to print output*);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]]

Print["Start time is ",ds=DateString[],"."];
prec=50000;
(**Number of required decimals.*.*)ClearSystemCache[];
T0=SessionTime[];
expM[pre_]:=Block[{a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=32(*=4*number of physical cores*),tsize=2^7,chunksize,start=1,ll,ctab,pr=Floor[1.002 pre]},chunksize=cores*tsize;
n=Floor[1.32 pr];
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/108];
With[{$t=tsize-1,$c=cores-1,$ch=chunksize},Do[xvals=Flatten[ParallelTable[Table[ll=start+j*tsize+l;
x=N[ll^(1/ll),iprec];
pc=iprec;
While[pc<pr/4,pc=Min[3 pc,pr/4];
x=SetPrecision[x,pc];
SetPrecision[y=x^ll-ll;
x=x (1-2 y/((ll+1) y+2 ll ll));,pc]];(**N[Exp[Log[ll]/ll],pr/4]**)x=SetPrecision[x,pr];
SetPrecision[xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x*=(1+45/10 (ll-1)/t2+(ll+1) z/(2 ll t)-135/10 ll (ll-1) 1/(3 ll t2+t^3 z)),pr];(**N[Exp[Log[ll]/ll],pr]**)x,{l,0,$t}],{j,0,$c}]];
ctab=ParallelTable[Table[c=b-c;
ll=start+l-2;
b*=2 (ll+n) (ll-n)/((ll+1) (2 ll+1));
c,{l,$ch}],Method->"FinestGrained"];
s+=ctab.(xvals-1);
start+=chunksize;
st=SessionTime[]-T0;kc=k*chunksize;
ti=(st)/(kc+10^-10)*(n)/(3600)/(24);
If[kc>1,Print["Denominator and ",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],"."],Print["Denominator for acceleration method calculated in ",st," s."]];(*I want to keep all progress stats,but making them faster is fine!*),{k,0,end-1}](*End of Do*)];
N[-s/d,pr]];(*End of Block*)t2=Timing[MRBtest2=expM[prec];];Print["Finished on ",DateString[],". Proccessor time ant absolute time were ",t2[[1]]," and ",st,"s, respectively."];
(*Print[MRBtest2];*)Print["Enter MRBtest2 to print ",Floor[Precision[MRBtest2]]," digits"];Print["If you saved m30k, the difference between this and 30,000 known digits is ",N[MRBtest2-m3M,10]]

"Finished on ""Wed 23 Sep 2020 00:45:51"". Proccessor time ant absolute time were "181.203125`" and "215.4260315`9.483813178937526"s, respectively."

Print["Start time is ",ds=DateString[],"."];
prec=100000;
(**Number of required decimals.*.*)ClearSystemCache[];
T0=SessionTime[];
expM[pre_]:=Module[{a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=16(*=4*number of physical cores*),tsize=2^7,chunksize,start=1,ll,ctab,pr=Floor[1.005 pre]},chunksize=cores*tsize;
n=Floor[1.32 pr];
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[3 pc,pr/1024];
x=SetPrecision[x,pc];
y=x^ll-ll;
x=x (1-2 y/((ll+1) y+2 ll ll));];
(**N[Exp[Log[ll]/ll],pr/1024]**)


x=SetPrecision[x,pr/256];
xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x=x*(1+SetPrecision[4.5,pr/256] (ll-1)/t2+(ll+1) z/(2 ll t)-SetPrecision[13.5,pr/256] ll (ll-1) 1/(3 ll t2+t^3 z));(*N[Exp[Log[ll]/ll],pr/256]*)

x=SetPrecision[x,pr/64];
xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x=x*(1+SetPrecision[4.5,pr/64] (ll-1)/t2+(ll+1) z/(2 ll t)-SetPrecision[13.5,pr/64] ll (ll-1) 1/(3 ll t2+t^3 z));(**N[Exp[Log[ll]/ll],pr/64]**)

x=SetPrecision[x,pr/16];
xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x=x*(1+SetPrecision[4.5,pr/16] (ll-1)/t2+(ll+1) z/(2 ll t)-SetPrecision[13.5,pr/16] ll (ll-1) 1/(3 ll t2+t^3 z));(**N[Exp[Log[ll]/ll],pr/16]**)

x=SetPrecision[x,pr/4];
xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x=x*(1+SetPrecision[4.5,pr/4] (ll-1)/t2+(ll+1) z/(2 ll t)-SetPrecision[13.5,pr/4] ll (ll-1) 1/(3 ll t2+t^3 z));(**N[Exp[Log[ll]/ll],pr/4]**)


x=SetPrecision[x,pr];
xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x=x*(1+SetPrecision[4.5,pr] (ll-1)/t2+(ll+1) z/(2 ll t)-SetPrecision[13.5,pr] ll (ll-1) 1/(3 ll t2+t^3 z));(*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) (2 ll+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 (**) or enter MRBtest2 to print output*);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]]

Print["Start time is ",ds=DateString[],"."];
prec=300000;
(**Number of required decimals.*.*)ClearSystemCache[];
T0=SessionTime[];
expM[pre_]:=Module[{a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=16(*=4*number of physical cores*),tsize=2^7,chunksize,start=1,ll,ctab,pr=Floor[1.005 pre]},chunksize=cores*tsize;
n=Floor[1.32 pr];
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[3 pc,pr/1024];
x=SetPrecision[x,pc];
y=x^ll-ll;
x=x (1-2 y/((ll+1) y+2 ll ll));];
(**N[Exp[Log[ll]/ll],pr/1024]**)


x=SetPrecision[x,pr/256];
xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x=x*(1+SetPrecision[4.5,pr/256] (ll-1)/t2+(ll+1) z/(2 ll t)-SetPrecision[13.5,pr/256] ll (ll-1) 1/(3 ll t2+t^3 z));(*N[Exp[Log[ll]/ll],pr/256]*)

x=SetPrecision[x,pr/64];
xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x=x*(1+SetPrecision[4.5,pr/64] (ll-1)/t2+(ll+1) z/(2 ll t)-SetPrecision[13.5,pr/64] ll (ll-1) 1/(3 ll t2+t^3 z));(**N[Exp[Log[ll]/ll],pr/64]**)

x=SetPrecision[x,pr/16];
xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x=x*(1+SetPrecision[4.5,pr/16] (ll-1)/t2+(ll+1) z/(2 ll t)-SetPrecision[13.5,pr/16] ll (ll-1) 1/(3 ll t2+t^3 z));(**N[Exp[Log[ll]/ll],pr/16]**)

x=SetPrecision[x,pr/4];
xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x=x*(1+SetPrecision[4.5,pr/4] (ll-1)/t2+(ll+1) z/(2 ll t)-SetPrecision[13.5,pr/4] ll (ll-1) 1/(3 ll t2+t^3 z));(**N[Exp[Log[ll]/ll],pr/4]**)


x=SetPrecision[x,pr];
xll=x^ll;z=(ll-xll)/xll;
t=2 ll-1;t2=t^2;
x=x*(1+SetPrecision[4.5,pr] (ll-1)/t2+(ll+1) z/(2 ll t)-SetPrecision[13.5,pr] ll (ll-1) 1/(3 ll t2+t^3 z));(*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) (2 ll+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 (**) or enter MRBtest2 to print output*);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]]

N[MRBtest2-m3M,10]