Finance.Solver.Newton (finance v1.6.1)

Copy Markdown View Source

The default Finance.Solver: a safeguarded Newton-Raphson (the classic rtsafe).

It brackets the root first, then each iteration takes a Newton step when that step lands inside the bracket and is shrinking the interval fast enough, and a bisection step otherwise. This keeps Newton's quadratic speed on well-behaved flows while retaining bisection's guaranteed convergence — in one pass, rather than running Newton to exhaustion and then bisecting separately.

Because the maintained bracket always encloses a sign change, the result is a genuine root rather than a stalled non-root, and a Newton step that would leave the bracket simply becomes a bisection step instead.

Bracketing scans the interior of the rate domain rather than only its extremes, so it finds a root even when the NPV crosses zero an even number of times (a series with more than one IRR). When several roots exist it brackets the one nearest :guess, matching what a guess-driven spreadsheet XIRR returns.