I am trying to find optimal NIntegrate settings for time intensive orthogonal expansions. See the short table of results:
Why using machine precision converged but setting precision to 22 fails? I know increasing precision doesn't necessarily make answer more accurate, but I can't understand why it would fail. Sample code is as follows:
mlocal = 0; nlocal = 50; a = 1;
Jm[m_, n_, a_] := BesselJ[m, (BesselJZero[m, n]/a) r];
f1Polar =
Exp[ (-r^2 + (4/10)*
r*(Cos[theta] + Sin[theta]) - (8/100))/(2*(4/10)^2) ];
alpha = f1Polar - (f1Polar /. {r^2 -> a^2, r -> a});
expr = Jm[mlocal, nlocal, a];
value = NIntegrate[
alpha Cos[mlocal theta] expr r, {theta, 0, 2 Pi}, {r, 0, a},
WorkingPrecision -> 22,
AccuracyGoal -> 10,
Method -> {"LocalAdaptive"},
Method -> {"EvenOddSubdivision", "VerifyConvergence" -> False},
MinRecursion -> 0,
MaxRecursion -> 3] // Timing