Find a root of a scalar function by damped Newton iteration. Each step is halved until its magnitude is at most half the current iterate’s magnitude. This is a step-size safeguard, not a residual line search.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| procedure(f_1d) | :: | f |
Function and derivative callback. |
|||
| real(kind=pr), | intent(inout) | :: | x |
Initial guess, replaced by the root estimate. |
||
| real(kind=pr), | intent(in) | :: | tol |
Absolute tolerance for residual and step size. |
||
| integer, | intent(in) | :: | max_iters |
Maximum Newton iterations. |
||
| logical, | intent(out) | :: | failed |
True when the iteration limit is exhausted. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public | :: | df | ||||
| real(kind=pr), | public | :: | fval | ||||
| integer, | public | :: | i |
Loop/index variable. |
|||
| real(kind=pr), | public | :: | step |