Open dpsanders opened 5 years ago
Why can't the roots be guaranteed here ?
My bad, they apparently can. There are some functions for which it is not possible to exclude "roots at infinity".
julia> roots(x -> 1/x, 1..∞)
1-element Array{Root{Interval{Float64}},1}:
Root(∅, :unique)
Like that one I guess ?
Ouch. Exactly!
Even with bisection this fails. I think this is because we keep bisecting intervals even when they are atomic. This needs to be fixed.
Currently we get
julia> roots(x -> 1/x, 1..∞)
Root([1.79769e+308, ∞], :unique)
The unique
here is wrong -- maybe Newton is not checking strict inclusion?
Krawczyk just hangs.
An example of not being able to guarantee roots is
julia> roots(x -> x^2 - 2x, -Inf..Inf)
When x
is a semi-infinite interval, x^2 - 2x
always gives -Inf..Inf
and nothing can be done,
even though for any finite, large interval it can immediately prove that there is no 0.
e.g. for f(x) = (x-1)x(x+1) on (-Inf..Inf).