Skip to content

Commit d5ab93b

Browse files
eeshan9815dpsanders
authored andcommitted
1 parent 33b119b commit d5ab93b

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ makedocs(
66
sitename = "IntervalArithmetic",
77
pages = [
88
"Package" => "index.md",
9+
"Interval Arithmetic" => "intro.md",
910
"Basic usage" => "usage.md",
1011
"Decorations" => "decorations.md",
1112
"Multi-dimensional boxes" => "multidim.md",

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ julia> Pkg.add("IntervalArithmetic")
2828

2929
```@contents
3030
Pages = ["usage.md",
31+
"intro.md",
3132
"decorations.md",
3233
"multidim.md",
3334
"rounding.md",

docs/src/intro.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Introduction to Interval Arithmetic
2+
3+
The basic idea in Interval Arithmetic is to calculate with entire *sets* of real numbers, of which the simplest type are closed intervals
4+
$[a,b] := \{x \in \mathbb{R}: a \le x \le b \}$.
5+
6+
We define arithmetic operations and functions to act on intervals, in such a way that the result of the calculation is a new interval that is guaranteed to contain the true range of the function.
7+
8+
For example, for monotone functions like `exp`, we define
9+
```
10+
exp([a, b]) := [exp(a), exp(b)]
11+
```
12+
For non-monotone functions, like the squaring function, it is more complicated:
13+
```
14+
[a, b]^2 := [a^2, b^2] if 0 < a < b
15+
= [0, max(a^2, b^2)] if a < 0 < b
16+
= [b^2, a^2] if a < b < 0
17+
```
18+
We also have to round the lower endpoint down and the upper endpoint up to get guaranteed containment of the true result, since we are using floating-point arithmetic.
19+
20+
For more information on how different functions behave in Interval Arithmetic, refer to [Interval Arithmetic](https://en.wikipedia.org/wiki/Interval_arithmetic)
21+
22+
Once we have done this for all basic functions, we can define a complicated Julia function like
23+
```
24+
f(x) = sin(3x^2 - 2 cos(1/x))
25+
```
26+
and feed an interval in. Since at each step of the process, the result is an interval that is guaranteed to contain the range, the whole function has the same property.
27+
28+
For example,
29+
```
30+
using IntervalArithmetic
31+
32+
julia> using IntervalArithmetic
33+
34+
julia> f(x) = x^2 - 2
35+
f (generic function with 1 method)
36+
37+
julia> X = 3..4
38+
[3, 4]
39+
40+
julia> f(X)
41+
[7, 14]
42+
```
43+
Since `f(X)` does not contain 0, the true range of the function $f$ over the set $X$ is guaranteed not to contain 0, and hence we have
44+
45+
**Theorem:** The function $f$ has no root in the interval $[3,4]$.
46+
47+
This theorem has been obtained using *just floating-point calculations*!
48+
49+
Further, we can even extend this to semi-infinite intervals:
50+
```
51+
julia> f(3..∞)
52+
[7, ∞]
53+
```
54+
Thus we have *excluded the entire domain [3, ∞) from possibly containing roots of $f$.*
55+
56+
To move beyond just excluding regions and to actually guaranteeing existence and uniqueness for smooth functions, we use an interval version of the Newton method, which is described a bit [here](https://juliaintervals.github.io/IntervalRootFinding.jl/latest/).

0 commit comments

Comments
 (0)