Dichotomy.Dichotomy
— ModuleBasic methods for solving f(x) = 0
equations and finding argmin f(x)
See bisection
and goldensection
.
Dichotomy.bisection
— Methodbisection(f, (a, b); [tol=eps()])
Finds root of equation f(x) = 0
on a < x < b
.
Method works only if f(a) * f(b) < 0
.
Examples
julia> bisection(sin, (2, 4))
3.141592653589793
Dichotomy.goldensection
— Methodgoldensection(f, (a, b); [tol=eps()])
Finds argmin of function f(x)
on a < x < b
.
Examples
julia> goldensection(x-> (x-2)^2, (-4, 4))
2.0