package optimization1d

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

One dimensional maximization routines.

val brent : ?tol:float -> (float -> float) -> float -> float -> float * float

brent f a b uses Brent's method to return (x, f x) where x is the best approximation to a maximum point of f on the interval [a,b].

  • parameter tol

    Default: sqrt epsilon_float. The algorithm reduces the interval [a,b] containing an approximation x of the minimum until |x - (a+b)/2| + |b-a|/2 <= 2 sqrt epsilon_float |x| + tol / 3.

    Algorithm: G.Forsythe, M.Malcolm, C.Moler, Computer methods for mathematical computations. M., Mir, 1980.

golden_search f a b c returns (x, f x) where x is an approximaion of a maximum point of f inside the interval [a,c]. The point b must be between a and c and such that f(b) is greater than f(a) and f(c).

  • parameter tol

    Default: sqrt epsilon_float. The algorithm reduces the interval [a,c] until |a - c| <= tol (|a| + |c|).

OCaml

Innovation. Community. Security.