Open kaber2 opened 1 year ago
Both are correct, the conditions are turned around because in Optim.jl the code path with the condition you mention stops if true and in NLSolvers.jl the code paths continues if true, hence the swapped inequality. The reference implementation in Brent's book has it the same way NLSolvers.jl does
So if that condition is true (no convergence) it continues.
As per the second part, that is true, it should be copysign(tol, d)
as per brent's book
Please provide the simple functions you're referring to.
Hello,
I was comparing the implementations of:
And notices a few differences. I was wondering if someone can shed some light on which of the two is correct.
First, while brent.jl uses:
As stopping criterium, brentmin.hl has the second condition turned around:
(b-a instead of a-b). A quick test in my own implementation shows that brentmin.jl seems to be incorrect as even simple functions don't converge anymore.
Then, when selecting the new step, brent.jl does:
while brentmin.jl dies:
So it treats the case of d == 0 differently.