JuliaMath / JuliaMath/Roots.jl

xtol not honored in fzero

Open
#67 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
413
Forks
61
Avg merge
57m
Merged PRs (30d)
5

Description

I cannot seem to be able to set some of `fzero`'s keyword parameters, e.g. `xtol` and `maxeval`
```
julia> f(x) = cos(x) - x
julia> fzero(f, 0; maxeval=20, verbose=true)
Results of univariate zero finding:

* iterations: 63
* function evaluations: 65
* stopped as x_n ≈ x_{n-1} using atol=xabstol, rtol=xreltol

julia> fzero(f, 0; xtol=0.2, verbose=true)
Results of univariate zero finding:
* Converged to: 0.7390851332151607
* iterations: 63
* function evaluations: 65
```
In both cases, there are 65 function evaluations and the root is found to full precision.

The same seems to hold for `find_zero`.

BTW, what functions are called? There is no line information with `@which`:
```
julia> @which find_zero(f, 0; xabstol=0.2, verbose=true)
(::Roots.#kw##find_zero){T<:Number}(::Array{Any,1}, ::Roots.#find_zero, f, x0::T)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.