Find the minimum of a function using the Golded-section search algorithm

golden_search(x, a, b, tol = 1e-04)

Arguments

x

function with one argument

a

min value of search values

b

max value of search values

tol

tolerance level. Default is 1e-04

Examples

contfunc = function(x){ -exp(-x) * sin(x) } golden_search(contfunc, a = 0, b = 1.5)
#> [1] 0.7854079