JuliaIntervals / IntervalRootFinding.jl

Library for finding the roots of a function using interval arithmetic
https://juliaintervals.github.io/IntervalRootFinding.jl/
Other
127 stars 26 forks source link

Make Newton work with infinite intervals #56

Closed dpsanders closed 6 years ago

dpsanders commented 6 years ago
julia> roots(x->x^2 - 2, -Inf..Inf)
1-element Array{IntervalRootFinding.Root{IntervalArithmetic.Interval{Float64}},1}:
 Root([-∞, ∞], :unique)

This seems to be because N(X) = X

dpsanders commented 6 years ago

The problem is

julia> (-∞..∞) ⪽(-∞..∞)
true
Kolaru commented 6 years ago

The problem is

julia> (-∞..∞) ⪽(-∞..∞)
true

It looks like has been specifically implemented (in IntervalArithmetic) to have this behavior. Do you know why ? If there is no specific reason, it could be changed there.

lbenet commented 6 years ago

I think this is a requirement of the interval standard, but I would need to check that.

dpsanders commented 6 years ago

Yes, it seems to be; one of the ITF1788 tests tests exactly this.

In that case, in Newton itself we'll simply have to exclude that case.

lbenet commented 6 years ago

What happens if, instead of testing X=(-∞..∞), you test the interval X = interval( -prevfloat(∞), prevfloat(∞))?

dpsanders commented 6 years ago

Fixed by #55.