Tue 24 Apr 2018
Here are some timings from version 11.3 and my first custom built computer with it's two separate processors:
[41]
Sat 28 Apr 2018
Chapter 3 in the paper at https://www.sciencedirect.com/science/article/pii/0898122189900242 , gives a 4th degree convergence rate algorithm for the nth root of x, which I used to add a new interior to my version of Crandall's MRB constant computation program, making it a hybrid. As the paper describes the algorithm, it is best used for getting many digits from a sufficiently precise initial term. (I used Crandall's 3rd degree convergence interior to get the sufficiently precise term.) This algorithm better optimizes my program for large calculations a little according to the following:
Here is a table of the results so far, which also show that RAM speed is the most important factor in a computer for computing the MRB constant!:
Here are a timing table with All MRB method, Crandall's method and a hybrid of the two on this 4 core ASUS Intel Core i7 7700 Desktop computer K31CD-DS71, 32 GB ram DDR4, 2TB SATA in Windows 10 Pro:
Here are the 3 programs referenced in the above table:
All MRB:
Print["Start time is " "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 = 16(*=4*
number of physical cores*), tsize = 2^7, chunksize, start = 1, ll,
ctab, pr = Floor[1.0002 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 = pr/2^6;
Do[xvals = Flatten[ParallelTable[Table[ll = start + j*tsize + l;
x = N[E^(Log[ll]/(ll)), iprec];
pc = iprec;
While[pc < pr, pc = Min[4 pc, pr];
x = SetPrecision[x, pc];
xll = x^ll; z = (ll - xll)/xll;
t = 2 ll - 1; t2 = t^2;
x = x*(1 + SetPrecision[4.5, pc] (ll - 1)/
t2 + (ll + 1) z/(2 ll t) -
SetPrecision[13.5,
2 pc] ll (ll - 1)/ (3 ll t2 + t^3 z))];(**N[Exp[Log[
ll]/ll],pr]**)
x, {l, 0, tsize - 1}], {j, 0, cores - 1},
Method ->
"EvaluationsPerKernel" ->
16(*a power of 2 commensurate with available RAM*)]];
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^-10)*(n)/(3600)/(24);
If[kc > 1,
Print[kc, " iterations done in ", N[st - stt, 4], " seconds.",
" Should take ", N[ti, 4], " days or ", ti*3600*24,
"s, finish ", DatePlus[ds, ti], "."],
Print["Denominator computed in " , stt = st, "s."]];, {k, 0,
end - 1}];
N[-s/d, pr]];
t2 = Timing[MRBtest2 = expM[prec];]; Print["Finished on ",
DateString[], ". Processor and total time were ",
t2[[1]], " and ", st, " s respectively."];
(*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]]
Crandall
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 = 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]]
Hybrid
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/27];
Do[xvals = Flatten[ParallelTable[Table[ll = start + j*tsize + l;
x = N[E^(Log[ll]/(ll)), iprec];
pc = iprec;
While[pc < pr/4, pc = Min[3 pc, pr/4];
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/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},
Method ->
"EvaluationsPerKernel" ->
32(*a power of 2 commensurate with available RAM*)]];
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, 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[*)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]]
Aug 8 2018
I've been having great success with the Wolfram Lightweight Grid and "threadpriority," like in the following:
In[23]:= Needs["SubKernels`LocalKernels`"]
Block[{$mathkernel = $mathkernel <> " -threadpriority=2"},
LaunchKernels[]]
Out[24]= {"KernelObject"[43, "burns"], "KernelObject"[44, "burns"],
"KernelObject"[45, "burns"], "KernelObject"[46, "burns"],
"KernelObject"[47, "burns"], "KernelObject"[48, "burns"],
"KernelObject"[49, "burns"], "KernelObject"[50, "burns"],
"KernelObject"[51, "local"], "KernelObject"[52, "local"],
"KernelObject"[53, "local"], "KernelObject"[54, "local"],
"KernelObject"[55, "local"], "KernelObject"[56, "local"]}
.
I just now computed 1,004,754 digits of the MRB constant in 58 hours of absolute time!
I think that worked because my computer with the local kernels is the faster one.
See attached "58 hour million."
Aug 9, 2018, I just now computed 1,004,993 digits of the MRB constant in 53.5 hours of absolute time! Summarized below.
Print["Start time is ", ds = DateString[], "."];
prec = 1000000;
(**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]]
Start time is Wed 8 Aug 2018 14:09:15.
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 259.9 seconds. Should take 3.991*10^7 days or 3.448*10^12s, finish Fri 24 Dec 111294 02:34:55.
2048 iterations done in 523.6 seconds. Should take 3.926 days or 3.392*10^5s, finish Sun 12 Aug 2018 12:22:00.
4096 iterations done in 790.2 seconds. Should take 2.962 days or 2.559*10^5s, finish Sat 11 Aug 2018 13:14:46.
6144 iterations done in 1058. seconds. Should take 2.645 days or 2.285*10^5s, finish Sat 11 Aug 2018 05:38:01.
8192 iterations done in 1329. seconds. Should take 2.490 days or 2.152*10^5s, finish Sat 11 Aug 2018 01:55:27.
10240 iterations done in 1602. seconds. Should take 2.402 days or 2.075*10^5s, finish Fri 10 Aug 2018 23:47:32.
12288 iterations done in 1875. seconds. Should take 2.343 days or 2.024*10^5s, finish Fri 10 Aug 2018 22:22:49.
14336 iterations done in 2151. seconds. Should take 2.304 days or 1.990*10^5s, finish Fri 10 Aug 2018 21:26:34.
16384 iterations done in 2424. seconds. Should take 2.272 days or 1.963*10^5s, finish Fri 10 Aug 2018 20:41:04.
18432 iterations done in 2700. seconds. Should take 2.250 days or 1.944*10^5s, finish Fri 10 Aug 2018 20:08:36.
20480 iterations done in 2977. seconds. Should take 2.232 days or 1.928*10^5s, finish Fri 10 Aug 2018 19:42:40.
22528 iterations done in 3256. seconds. Should take 2.219 days or 1.917*10^5s, finish Fri 10 Aug 2018 19:24:31.
24576 iterations done in 3533. seconds. Should take 2.207 days or 1.907*10^5s, finish Fri 10 Aug 2018 19:07:43.
26624 iterations done in 3811. seconds. Should take 2.198 days or 1.899*10^5s, finish Fri 10 Aug 2018 18:53:53.
...
1320960 iterations done in 1.921*10^5 seconds. Should take 2.232 days or 1.929*10^5s, finish Fri 10 Aug 2018 19:43:46.
1323008 iterations done in 1.923*10^5 seconds. Should take 2.232 days or 1.929*10^5s, finish Fri 10 Aug 2018 19:43:28.
1325056 iterations done in 1.926*10^5 seconds. Should take 2.232 days or 1.928*10^5s, finish Fri 10 Aug 2018 19:43:08.
Finished on Fri 10 Aug 2018 19:39:26. Proccessor time was 122579. s.
Actual time was 192609.7247443
Enter MRBtest2 to print 1004992 digits
If you saved m3M, the difference between this and 3,014,991 known digits is 0.*10^-1004993
Sept 21, 2018, I just now computed 1,004,993 digits of the MRB constant in 50.37 hours of absolute time (35.4 hours processor time)! See attached "50 hour million."
Here is a table of my speed progress in computing the MRB constant since 2012:
See attached "kernel priority 2 computers.nb" and "3 fastest computers together.nb" for some documentation of the timings in the last 2 columns, respectively. See "3million 2 computers" for the estimated time of 24 days for computing 3,000,000 digits.
01/08/2019
Here is an update of 100k digits (in seconds):
Notice, I broke the 1,000 second mark!!!!!
Attachments: