IntervalRootFinding.jl icon indicating copy to clipboard operation
IntervalRootFinding.jl copied to clipboard

Bisection of atomic interval

Open dpsanders opened this issue 8 years ago • 6 comments

One solution for the bisection of an atomic interval [l, h] would be to return three intervals:

  • the point l
  • the interval [l, h]
  • the point h

Probably the easiest solution is not to bisect it. Note that this will cause problems since currently it is expected that bisect returns two intervals. Could return the same interval twice, together with an :atomic flag.

dpsanders avatar Jun 30 '17 17:06 dpsanders

Or an object of a new type

dpsanders avatar Jul 26 '17 22:07 dpsanders

How is an interval decided to be atomic? If diam(X) < tolerance?

eeshan9815 avatar Mar 07 '18 14:03 eeshan9815

A thin interval is an interval such that its lower bound and its upper one are the same. I think the notion of an atomic interval is the generalization of a thin interval for real numbers which are not exactly representable as floating points. (@dpsanders , please correct me if I'm wrong.)

So we have

julia> using IntervalArithmetic

julia> Interval(1.0,1.0)
Interval(1.0, 1.0)

julia> isthin(ans)
true

julia> a = @interval(sqrt(2))
[1.41421, 1.41422]

julia> @format full
6

julia> a
Interval(1.414213562373095, 1.4142135623730951)

julia> isthin(a)
false

julia> diam(a) ≤ eps(a) # `a` has the smallest diam that contains the true answer
true

At the end, I have compared diam(a) with eps(a) , where eps(a) acts on intervals. I am not considering any tolerance parameter, as you wrote above, but the interval whose with contains the true number and has smallest width.

lbenet avatar Mar 07 '18 17:03 lbenet

An atomic interval is literally one that cannot be split up, in other words it's either thin or consists of two adjacent floating point numbers. There is an exported isatomic function to check this.

dpsanders avatar Mar 07 '18 21:03 dpsanders

@dpsanders @lbenet Thanks a lot for the clarification! So for fixing the issue, what would be the preferred action? Same interval twice with an :atomic flag?

eeshan9815 avatar Mar 08 '18 03:03 eeshan9815

That is probably a good solution, but that information would have to be used in the functions that call bisect, presumably so that they realise that they can just return and that a root has not been found. (Or both of the floating point numbers in the atomic interval should be checked in case they are in fact exact roots, although this case seems very rare.)

dpsanders avatar Mar 08 '18 04:03 dpsanders

Atomic interval are special cased in bisect and related function to avoid problems.

Kolaru avatar Apr 19 '24 16:04 Kolaru