I found out how to verify my MKB constant calculations beyond any shadow of a doubt.
Use one iteration of partial integration, because for g(x)=x^(1/x),
.
The following computation will show that the calculation was right by leaving a small error.
g[x_] = x^(1/x); t = (Timing[
test = -(I NIntegrate[(g[(1 + t I)]) ( Exp[-Pi t]), {t, 0,
Infinity}, WorkingPrecision -> 2410,
Method -> "Trapezoidal", MaxRecursion -> 10] + I/Pi)])[[
1]]; Print["Timing for calculation=", t]; t = (Timing[
test2 = (1/Pi NIntegrate[
g'[1 + I t] Exp[-Pi t], {t, 0, Infinity},
WorkingPrecision -> 2410, Method -> "Trapezoidal",
MaxRecursion -> 10] - 2 I/Pi)])[[
1]]; Print["Timing for verification=", t]; err =
test - test2; Print["Error=", N[err, 20]]
(*Timing for calculation=48.0927
Timing for verification=69.4713
Error=-1.*10^-2410-1.03*10^-2408 I*)
The following will show that the calculation was wrong by leaving a large error.
g[x_] = x^(1/x); t = (Timing[
test = -(I NIntegrate[(g[(1 + t I)]) ( Exp[-Pi t]), {t, 0,
Infinity}, WorkingPrecision -> 2410,
Method -> "Trapezoidal", MaxRecursion -> 9] + I/Pi)])[[
1]]; Print["Timing for calculation=", t]; t = (Timing[
test2 = (1/Pi NIntegrate[
g'[1 + I t] Exp[-Pi t], {t, 0, Infinity},
WorkingPrecision -> 2410, Method -> "Trapezoidal",
MaxRecursion -> 9] - 2 I/Pi)])[[
1]]; Print["Timing for verification=", t]; err =
test - test2; Print["Error=", N[err, 20]]
(* Timing for calculation=14.375
Timing for verification=18.7344
Error=-1.21910183828457949*10^-1311-1.6392815749781077289*10^-1309 I*)
The following proves that MaxRecursion -> 12 is good for calculating and verifying at least 8192 digits.
Compute 8192 with MaxRecursion -> 12
g[x_] = x^(1/x); t = (Timing[
test = -(I NIntegrate[(g[(1 + t I)]) ( Exp[-Pi t]), {t, 0,
Infinity}, WorkingPrecision -> 8192,
Method -> "Trapezoidal", MaxRecursion -> 12] + I/Pi)])[[
1]]; Print["Timing for calculation=", t]
(*Timing for calculation=1111.69*)
Verify 8192 with MaxRecursion -> 12
g[x_] = x^(1/x); t = (Timing[
test2 = (1/Pi NIntegrate[g'[1 + I t] Exp[-Pi t], {t, 0, Infinity},
WorkingPrecision -> 8192, Method -> "Trapezoidal",
MaxRecursion -> 12] - 2 I/Pi)])[[
1]]; Print["Timing for verification=", t]; err =
test - test2; Print["Error=", N[err, 20]]
(*Timing for verification=1419.66
Error=0.*10^-8193+0.*10^-8193 I*)
As time allows, I will post what all this parity-check has to say to confirm or unconfirm my latest table of recommended MaxRecursions (M.R.).
digits M.R.
1309 default
2410 10
4453 11
8182 12
19734 13
31286 14
54390 15
65942 16
77494 17
89046 18
We see that
4453 11
is confirmed, although the real part converges to a slightly higher magnitude:
g[x_] = x^(1/x); t = (Timing[
test = -(I NIntegrate[(g[(1 + t I)]) (Exp[-Pi t]), {t, 0,
Infinity}, WorkingPrecision -> 5000,
Method -> "Trapezoidal", MaxRecursion -> 11] +
I/Pi)])[[1]]; Print["Timing for calculation=", t]; t = \
(Timing[test2 = (1/Pi NIntegrate[
g'[1 + I t] Exp[-Pi t], {t, 0, Infinity},
WorkingPrecision -> 5000, Method -> "Trapezoidal",
MaxRecursion -> 11] -
2 I/Pi)])[[1]]; Print["Timing for verification=", t]; err =
test - test2; Print["Error=", N[err, 20]]
Timing for calculation=230.391
Timing for verification=299.469
Error=2.8146045128793867*10^-4456+1.6474663184374133246*10^-4453 I
As for MaxRecursion -> 12 where the R.M. table shows up to 8182 digits, r.e.
8182 12.
Actual inspection from this method shows it is possible to get all the way up to 8278 accurate digits of the real part and 8275 of the imaginary. That is the same difference that exists from it and 35,000 digits computed by a totally different method.
So
8182 12.
should say
8275 12.
Here is the work for the verification:
g[x_] = x^(1/x); t = (Timing[
test = -(I NIntegrate[(g[(1 + t I)]) (Exp[-Pi t]), {t, 0,
Infinity}, WorkingPrecision -> 10000,
Method -> "Trapezoidal", MaxRecursion -> 12] +
I/Pi)])[[1]]; Print["Timing for calculation=", t]; t = \
(Timing[test2 = (1/Pi NIntegrate[
g'[1 + I t] Exp[-Pi t], {t, 0, Infinity},
WorkingPrecision -> 10000, Method -> "Trapezoidal",
MaxRecursion -> 12] -
2 I/Pi)])[[1]]; Print["Timing for verification=", t]; err =
test - test2; Print["Error=", N[err, 20]]
Timing for calculation=1764.03
Timing for verification=2247.2
Error=-7.2028204961753149*10^-8278-8.0907462882284574618*10^-8275 I
As for MaxRecursion -> 13 where the R.M. table shows up to 8182 digits, r.e.
19734 12.
Actual inspection from this method shows it is possible to get all the way up to 15444 accurate digits of the real part and 15442 of the imaginary. That is the same difference that exists from it and 35,000 digits computed by a totally different method.
So
19734 13
should say
15442 13.
Here is the work for the verification:
g[x_] = x^(1/x); t = (Timing[
test = -(I NIntegrate[(g[(1 + t I)]) (Exp[-Pi t]), {t, 0,
Infinity}, WorkingPrecision -> 20000,
Method -> "Trapezoidal", MaxRecursion -> 13] +
I/Pi)])[[1]]; Print["Timing for calculation=", t]; t = \
(Timing[test2 = (1/Pi NIntegrate[
g'[1 + I t] Exp[-Pi t], {t, 0, Infinity},
WorkingPrecision -> 20000, Method -> "Trapezoidal",
MaxRecursion -> 13] -
2 I/Pi)])[[1]]; Print["Timing for verification=", t]; err =
test - test2; Print["Error=", N[err, 20]]
Timing for calculation=11440.4
Timing for verification=14435.1
Error=1.269166151550935283*10^-15444-1.34038091454473637998*10^-15442 I
Through actual inspection the next row is
28932 14.
More to come. But so far through actual inspection, we have the following.
digits M.R.
1309 default
2410 10
4453 11
8275 12
15442 13
28932 14
So far, the table gives a clear-cut pattern:
digits M.R.
1309*1.84 ~=2410 10
2410*1.85~=4453 11
4453*1.86~=8275 12
8275*1.87~=15442 13
15442*1.875~= 28932 14
Following the growth with an eye on our experience were we proved the next row is
54286 15
we get
digits M.R.
28932*1.88~=54286 15
54286*1.89~=102600 16