Intervals
There are several Julia packages for interval sets and interval arithmetic.
Overview
IntervalSets.jl and Intervals.jl both focus on working with interval sets, in a mathematical sense (as opposed to a numerical sense). While there have been discussions on merging the two (see IntervalSets.jl#67 and Intervals.jl#94), they currently still exist as separate packages.
IntervalArithmetic.jl on the other hand focuses on interval arithmetic, i.e. carrying out operations like where or (or both!) are intervals instead of numbers. There were issues to add an dependency on IntervalSets.jl, but this also has not yet been realized.
Packages
IntervalSets.jl
Intervals.jl
IntervalArithmetic.jl
Example of adding an interval and a number:julia> a = 1;
julia> b = interval(3, 4)
[3.0, 4.0]_com
julia> a+b
[4.0, 5.0]_com_NG
Examples of applying a function to an interval:
julia> f(interval(3, 4))
[9.0, 16.0]_com
julia> f(interval(-3, 4))
[0.0, 16.0]_com
To quote from the intro of the IntervalArithmetic.jl docs:
Since f(x) does not contain 0, the true range of the function over the interval is guaranteed not to contain 00, and hence we obtain the following property.
Theorem: has no root in the interval .
This theorem has been obtained using floating-point computations!
Star History
Last modified: May 03, 2024. Built with Franklin.jl