A multimodal test function with three global minima, commonly used for testing optimization algorithms. Fixed dimension of 2.

F17(x)

Arguments

x

Numeric vector of length 2 (2-dimensional input).

Value

Numeric scalar representing the function value.

Details

Formula: $$f(x) = \left(x_2 - \frac{5.1}{4\pi^2}x_1^2 + \frac{5}{\pi}x_1 - 6\right)^2 + 10\left(1 - \frac{1}{8\pi}\right)\cos(x_1) + 10$$

Global minimum: \(f^* \approx 0.397887\) at three locations:

  • \((-\pi, 12.275)\)

  • \((\pi, 2.275)\)

  • \((9.42478, 2.475)\)

Characteristics:

  • Type: Multimodal

  • Separable: No

  • Differentiable: Yes

  • Fixed dimension: 2

  • Number of global minima: 3

  • Default bounds: \(x_1 \in [-5, 10]\), \(x_2 \in [0, 15]\)

The Branin function is often used as a benchmark because it has three global minima that are well-separated.

See also

test-functions for an overview of all test functions, get_function_details to retrieve function parameters.

Examples

F17(c(-pi, 12.275))      # Returns approximately 0.398 (global minimum)
#> [1] 0.3978874
F17(c(pi, 2.275))        # Returns approximately 0.398 (global minimum)
#> [1] 0.3978874
F17(c(9.42478, 2.475))   # Returns approximately 0.398 (global minimum)
#> [1] 0.3978874