solves the scalar nonlinear equation such that F(X) == 0
[X, FX, INFO] = moc_fzero (FCN, APPROX, OPTIONS)
function name as string
absolute (error for Brent's or residual for fsolve) tolerance. Default = 1e-6.
relative error tolerance (only Brent's method). Default = 1e-6.
print level, how much diagnostics to print. Default = 0, no diagnostics output
Given Func, the name of a function of the form `F (X)', and an initial approximation APPROX, `fzero' solves the scalar nonlinear equation such that `F(X) == 0'. Depending on APPROX, `fzero' uses different algorithms to solve the problem: either the Brent's method or the Powell's method of `fsolve'. The computed approximation to the zero of FCN is returned in X. FX is then equal to FCN(X). If the iteration converged, INFO == 1. If Brent's method is used, and the function seems discontinuous, INFO is set to -5. If fsolve is used, INFO is determined by its convergence.