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

Extended interval arithmetic? #272

Closed
dlfivefifty opened this issue Mar 27, 2019 · 6 comments
Closed

Extended interval arithmetic? #272

dlfivefifty opened this issue Mar 27, 2019 · 6 comments

Comments

@dlfivefifty
Copy link
Contributor

I noticed that extended interval arithmetic is not implemented:

julia> 1/Interval(-1,1) # why {x : |x| > 1}?
[-∞, ∞]

instead it is done by hand in https://github.com/JuliaIntervals/IntervalRootFinding.jl/blob/99cc0e95885df8e4699f52ffc02df9b8ca748bc6/src/newton.jl#L77

Is there any fundamental limitation preventing this? I guess it is overkill for just Newton iteration, but I'm just curious.

@lbenet
Copy link
Member

lbenet commented Mar 27, 2019

Thanks for reporting.

We have some functionality on this: extended_div:

julia> extended_div(Interval(1,1), Interval(-1,1))
([-∞, -1], [1, ∞])

@dlfivefifty
Copy link
Contributor Author

dlfivefifty commented Mar 27, 2019

I guess I was thinking more a special type ExtendedInterval which lives on the compactified real line. So

d = ExtendedInterval(2,-1) # represents {x : x > 2 or x < -1}
d == 1/ExtendedInterval(-1,2)
3 in d
Inf in d
!(0 in d)

@dpsanders
Copy link
Member

I believe this is known as Kaucher arithmetic.

An alternative would be to have an IntervalUnion type representing a finite union of intervals, which has also been studied recently (and I have a start on that somewhere).

@dlfivefifty
Copy link
Contributor Author

I think there are use cases for each of these. But it's debatable that they all need to be in this package...

@dpsanders
Copy link
Member

I agree that this package is probably not the right place for these.

@lbenet
Copy link
Member

lbenet commented Aug 9, 2019

I agree that this package is probably not the right place for these.

I am not sure that I agree with this opinion; as @dlfivefifty says, it is debatable. For me, Julia is precisely the language to implement different flavors of interval arithmetic; see #271.

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

3 participants