I'm trying to integrate a large function like this
func[ξ_] = 1/(1167598657575 π Sqrt[1 - ξ]) 4 Sqrt[2/143] ξ Sqrt[(1 - ξ)/(1 + ξ)] (1 + 72 (-2 + 2 ξ^2) + 1197 (-2 + 2 ξ^2)^2 + 7980 (-2 + 2 ξ^2)^3 + 209475/8 (-2 + 2 ξ^2)^4 + 92169/2 (-2 + 2 ξ^2)^5 + 706629/16 (-2 + 2 ξ^2)^6 + 43263/2 (-2 + 2 ξ^2)^7 + 1081575/256 (-2 + 2 ξ^2)^8) ((8957659658839916544 - 38598804293820612608 ξ^2 + 69110375109906923520 ξ^4 - 66520053962590126080 ξ^6 + 37182509594538147840 ξ^8 - 12158541247606161408 ξ^10 + 2222643299988013056 ξ^12 - 202385520787169280 ξ^14 + 7047164723274720 ξ^16 - 40061762318655 ξ^18) ((1 + ξ) EllipticE[(2 ξ)/(1 + ξ)] - EllipticK[(2 ξ)/(1 + ξ)]) + 8 ξ^2 (279926864338747392 - 1127483203586621440 ξ^2 + 1863097027060039680 ξ^4 - 1626763404855214080 ξ^6 + 805078969740165120 ξ^8 - 224757138041339904 ξ^10 + 33055899621212160 ξ^12 - 2165655547777920 ξ^14 + 40988123520795 ξ^16) EllipticK[(2 ξ)/(1 + ξ)]);
in the following modes (error estimate extraction is from this answer):
arb16 = NIntegrate[func[x], {x, 0, 1}, WorkingPrecision -> 16,
IntegrationMonitor :> ((errors = Through[#@"Error"]) &)]
arb200 = NIntegrate[func[x], {x, 0, 1}, WorkingPrecision -> 200]
I get the numbers, and now try to get the precision of arb16
. Here's what I have:
Row[{"arb16 precision: ", -Log10@Abs[arb200 - arb16],
", precision by error estimator: ", -Log10@Total@errors,
"\nreturned precision ", Precision@arb16,
", accuracy ", Accuracy@arb16}]
arb16 precision: 10.3694098, precision by error estimator: 8.9544353783245526
returned precision 16., accuracy 17.7955803201903
So, the error estimate by NIntegrate
appears correct, but Precision
and Accuracy
of the number are still way too optimistic. Why is it so? Is there a way to force the correct precision numbers to be given out by NIntegrate
?
PrecisionGoal
. $\endgroup$