Uses Brent’s method to find the root of a function f
| Type | Intent | Optional | Attributes | Name | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
private function f(x) result(y)Arguments
Return Value real(kind=DP) |
||||||||||||||||||||
| real(kind=DP), | intent(inout) | :: | x | Initial guess and also the final answer |
||||||||||||||||
| real(kind=DP), | intent(in), | optional | :: | tol | The relative tolerance on the solution |
|||||||||||||||
| logical, | intent(out), | optional | :: | lerr | Returns .true. if a root was found, otherwise returns .false. |
|||||||||||||||