Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 49c3583

Browse files
Update itp.jl
1 parent 6a1a40f commit 49c3583

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

src/itp.jl

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,47 @@
11
"""
22
```julia
3-
Itp(; k1 = Val{1}(), k2 = Val{2}(), n0 = Val{1}())
3+
Itp(; k1::Real = 0.007, k2::Real = 1.5, n0::Int = 10)
44
```
5+
56
ITP (Interpolate Truncate & Project)
67
8+
Use the [ITP method](https://en.wikipedia.org/wiki/ITP_method) to find
9+
a root of a bracketed function, with a convergence rate between 1 and 1.62.
710
8-
"""
11+
This method was introduced in the paper "An Enhancement of the Bisection Method
12+
Average Performance Preserving Minmax Optimality"
13+
(https://doi.org/10.1145/3423597) by I. F. D. Oliveira and R. H. C. Takahashi.
14+
15+
# Tuning Parameters
16+
17+
The following keyword parameters are accepted.
18+
19+
- `n₀::Int = 1`, the 'slack'. Must not be negative.\n
20+
When n₀ = 0 the worst-case is identical to that of bisection,
21+
but increacing n₀ provides greater oppotunity for superlinearity.
22+
- `κ₁::Float64 = 0.1`. Must not be negative.\n
23+
The recomended value is `0.2/(x₂ - x₁)`.
24+
Lower values produce tighter asymptotic behaviour, while higher values
25+
improve the steady-state behaviour when truncation is not helpful.
26+
- `κ₂::Real = 2`. Must lie in [1, 1+ϕ ≈ 2.62).\n
27+
Higher values allow for a greater convergence rate,
28+
but also make the method more succeptable to worst-case performance.
29+
In practice, κ=1,2 seems to work well due to the computational simplicity,
30+
as κ₂ is used as an exponent in the method.
931
10-
struct Itp <: AbstractBracketingAlgorithm
11-
k1::Real
12-
k2::Real
32+
### Worst Case Performance
33+
34+
n½ + `n₀` iterations, where n½ is the number of iterations using bisection
35+
(n½ = ⌈log2(Δx)/2`tol`⌉).
36+
37+
### Asymptotic Performance
38+
39+
If `f` is twice differentiable and the root is simple,
40+
then with `n₀` > 0 the convergence rate is √`κ₂`.
41+
"""
42+
struct Itp <: AbstractBracketingAlgorithm{T}
43+
k1::T
44+
k2::T
1345
n0::Int
1446
function Itp(; k1::Real = 0.007, k2::Real = 1.5, n0::Int = 10)
1547
if k1 < 0

0 commit comments

Comments
 (0)