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/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[3pc,pr];x=SetPrecision[x,pc];y=x^ll-ll;x=x(1-2y/((ll+1)y+2llll));];(**N[Exp[Log[ll]/ll],pr]**)x,{l,0,tsize-1}],{j,0,cores-1},Method"EvaluationsPerKernel"16(*apowerof2commensuratewithprocessorstrength*)]];ctab=ParallelTable[Table[c=b-c;ll=start+l-2;b*=2(ll+n)(ll-n)/((ll+1)(2ll+1));c,{l,chunksize}],Method"EvaluationsPerKernel"16(*apowerof2commensuratewithprocessorstrength*)];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(**)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 Thu 10 May 2018 14:55:37.
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.
2048 iterations done in 2.08 seconds. Should take 0.00016 days or 13.s, finish Thu 10 May 2018 14:55:50.
4096 iterations done in 3.11 seconds. Should take 0.00012 days or 10.s, finish Thu 10 May 2018 14:55:47.
6144 iterations done in 4.14 seconds. Should take 0.00010 days or 8.9s, finish Thu 10 May 2018 14:55:45.
8192 iterations done in 5.19 seconds. Should take 0.000097 days or 8.4s, finish Thu 10 May 2018 14:55:45.
10240 iterations done in 6.25 seconds. Should take 0.000094 days or 8.1s, finish Thu 10 May 2018 14:55:45.
12288 iterations done in 7.28 seconds. Should take 0.000091 days or 7.9s, finish Thu 10 May 2018 14:55:44.
Finished on Thu 10 May 2018 14:55:44. Processor time was 6.20313 s. Actual time was 7.2795259.
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[]:=
Print["Start time is ",ds=DateString[],"."];prec=20000;(**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/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[3pc,pr];x=SetPrecision[x,pc];y=x^ll-ll;x=x(1-2y/((ll+1)y+2llll));];(**N[Exp[Log[ll]/ll],pr]**)x,{l,0,tsize-1}],{j,0,cores-1},Method"EvaluationsPerKernel"16(*apowerof2commensuratewithprocessorstrength*)]];ctab=ParallelTable[Table[c=b-c;ll=start+l-2;b*=2(ll+n)(ll-n)/((ll+1)(2ll+1));c,{l,chunksize}],Method"EvaluationsPerKernel"16(*apowerof2commensuratewithprocessorstrength*)];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(**)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 Thu 10 May 2018 14:56:11.
Iterations required: 26530
Will give 13 time estimates, each more accurate than the previous.
Will stop at 26624 iterations to ensure precsion of around 20099 decimal places.
2048 iterations done in 4.80 seconds. Should take 0.00072 days or 62.s, finish Thu 10 May 2018 14:57:13.
4096 iterations done in 7.28 seconds. Should take 0.00055 days or 47.s, finish Thu 10 May 2018 14:56:58.
6144 iterations done in 9.78 seconds. Should take 0.00049 days or 42.s, finish Thu 10 May 2018 14:56:53.
8192 iterations done in 12.3 seconds. Should take 0.00046 days or 40.s, finish Thu 10 May 2018 14:56:50.
10240 iterations done in 15.0 seconds. Should take 0.00045 days or 39.s, finish Thu 10 May 2018 14:56:49.
12288 iterations done in 17.6 seconds. Should take 0.00044 days or 38.s, finish Thu 10 May 2018 14:56:48.
14336 iterations done in 20.2 seconds. Should take 0.00043 days or 37.s, finish Thu 10 May 2018 14:56:48.
16384 iterations done in 22.7 seconds. Should take 0.00043 days or 37.s, finish Thu 10 May 2018 14:56:47.
18432 iterations done in 25.4 seconds. Should take 0.00042 days or 37.s, finish Thu 10 May 2018 14:56:47.
20480 iterations done in 28.0 seconds. Should take 0.00042 days or 36.s, finish Thu 10 May 2018 14:56:47.
22528 iterations done in 30.7 seconds. Should take 0.00042 days or 36.s, finish Thu 10 May 2018 14:56:47.
24576 iterations done in 33.2 seconds. Should take 0.00041 days or 36.s, finish Thu 10 May 2018 14:56:46.
Finished on Thu 10 May 2018 14:56:44. Processor time was 27.3125 s. Actual time was 33.2107787.
Enter MRBtest2 to print 20093 digits
If you saved m3M, the difference between this and 3,014,991 known digits is 0.1878596425-1.000000000m3M
In[]:=
Print["Start time is ",ds=DateString[],"."];prec=30000;(**Numberofrequireddecimals.*.*)ClearSystemCache[];T0=SessionTime[];expM[pre_]:=Module[{a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=32(*=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/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[3pc,pr];x=SetPrecision[x,pc];y=x^ll-ll;x=x(1-2y/((ll+1)y+2llll));];(**N[Exp[Log[ll]/ll],pr]**)x,{l,0,tsize-1}],{j,0,cores-1},Method"EvaluationsPerKernel"16(*apowerof2commensuratewithprocessorstrength*)]];ctab=ParallelTable[Table[c=b-c;ll=start+l-2;b*=2(ll+n)(ll-n)/((ll+1)(2ll+1));c,{l,chunksize}],Method"EvaluationsPerKernel"16(*apowerof2commensuratewithprocessorstrength*)];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(**)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]]