Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bisection of atomic interval #26

Closed
dpsanders opened this issue Jun 30, 2017 · 7 comments
Closed

Bisection of atomic interval #26

dpsanders opened this issue Jun 30, 2017 · 7 comments

Comments

@dpsanders
Copy link
Member

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
Copy link
Member Author

Or an object of a new type

@eeshan9815
Copy link
Contributor

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

@lbenet
Copy link
Member

lbenet commented Mar 7, 2018

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.

@dpsanders
Copy link
Member Author

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.

@eeshan9815
Copy link
Contributor

eeshan9815 commented Mar 8, 2018

@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?

@dpsanders
Copy link
Member Author

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.)

@Kolaru
Copy link
Collaborator

Kolaru commented Apr 19, 2024

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

@Kolaru Kolaru closed this as completed Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants