The following gives compile warnings and returns unevaluated, any idea why?
obj2[a_] :=
NIntegrate[(
E^(1/2 (-x[1]^2 - x[2]^2))
Log[Abs[1 - a (x[1]^2 + x[2]^2)]] x[
1]^2)/(\[Pi] (x[1]^2 + x[2]^2)), {x[
1], -\[Infinity], \[Infinity]}, {x[
2], -\[Infinity], \[Infinity]}] + Log[2]/2;
obj2[.915] (* -0.00319086 + 5.42344*10^-18 I *)
FindRoot[obj2[a], {a, 0.92}] (* compile errors + returns unevaluated *)
Also, I'm curious why the result of NIntegrate
is complex, the only suspect part is Log[Abs[x]]
, but it should be real for all x.
(it's the objective from here)
obj2[a_?NumericQ]
and forcingWorkingPrecision -> 15
with NIntegrate works fine for me. May be due to Log and Abs and the singularity atAbs[1 - 183/200 (x[1]^2 + x[2]^2)] == 0
there is loss of workingPrecision below machinePrecision. $\endgroup$