Some functions (such as Erf
) appear to use NIntegrate
internally. In such cases, is there a way to control such options of NIntegrate
as PrecisionGoal
and AccuracyGoal
?
Edit in response to the comment by J.M.: I did use such a command for numerical evaluation. The function of interest was f[x_] = (x/((2 + x^2) Sqrt[1 + x^2]))InverseFunction[Erf][ArcTan[1/Sqrt[1 + x^2]] ]
. A calculation involving the values of f[x]
and some of its derivatives of order <=24
at x
about 3.5 10^9
produced this message:
NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in i near {i} = {150.979}. NIntegrate obtained 0.0019560456659259958
and 7.756174544177548
*^-8 for the integral and error estimates.
I thought that message probably concerned the function Erf
, which is defined as a certain integral. If not Erf
, it must then be ArcTan
that triggered the NIntegrate::ncvb: message.
In any case, the essence of my question was as follows: Some built-in functions appear to use NIntegrate
internally. In such cases, is there a way to control such options of NIntegrate
as PrecisionGoal
and AccuracyGoal
?
Erf[]
does not useNIntegrate[]
. Just doN[Erf[z], {prec, acc}]
if you must. $\endgroup$NIntegrate
. Consider the messageSolve::nint
. My guess is that it'sInverseFunction
. Without code to reproduce the error, it might be impossible to say definitively. I'm up to something like the 20th derivative off[x]
and still no errors. $\endgroup$SetOptions
is the standard way. Sometimes they are set explicitly by the built-in function, and unfortunately you might not have a way to change it. Two examples in which I overrode behavior: mathematica.stackexchange.com/a/63676/4999, mathematica.stackexchange.com/a/120650/4999. A case where I failed, because the option setting is hard-coded internally: mathematica.stackexchange.com/a/95106/4999 $\endgroup$Reduce
is an allowable value forMethod ->
. In general, is there a way to get the list of all such values for a given option? (Trying to learn more from you.) $\endgroup$Reduce
), check the "Details and Options" section, as well as the "Options" subsection of the "Examples", in the documentation for the function (such asSolve
). For undocumented options & settings, some are listed here. $\endgroup$