ftol seems to be ignored, or incorrectly computed
ChrisRackauckas opened this issue · comments
Christopher Rackauckas commented
using NLsolve
function g(resid,u)
resid[1] = u[1] < 0 ? -u[1] : 0
end
nlsolve(g,[-1.2354],ftol=1e-18)
Results of Nonlinear Solver Algorithm
* Algorithm: Trust-region with dogleg and autoscaling
* Starting Point: [-1.2354]
* Zero: [2.46247e-12]
* Inf-norm of residuals: 0.000000
* Iterations: 2
* Convergence: true
* |x - x'| < 0.0e+00: false
* |f(x)| < 1.0e-18: true
* Function Calls (f): 3
* Jacobian Calls (df/dx): 3
It's clear that the root that is found does not satisfy the ftol
, but it reports true.
Patrick Kofod Mogensen commented
It doesn't? g(2.4647e-12)
is 0.0
so f(x) < 1e-18. What am I missing? :)
Christopher Rackauckas commented
Oh I read it was negative. Dang, I need to find a better MWE then.
Christopher Rackauckas commented
Tracked it down to something else.
Patrick Kofod Mogensen commented
If the rabbit hole ends up here in NLsolve, you know where the button is to make a complaint :)