A unimodal test function that returns the maximum absolute value in the input vector, also known as the Schwefel 2.21 function.

F04(x)

Arguments

x

Numeric vector of input values.

Value

Numeric scalar representing the function value.

Details

Formula: $$f(x) = \max_i |x_i|$$

Global minimum: \(f(0, 0, ..., 0) = 0\)

Characteristics:

  • Type: Unimodal

  • Separable: No

  • Differentiable: No

  • Convex: Yes

  • Default bounds: \([-100, 100]^n\)

  • Default dimensions: 50

This function is particularly challenging because it only depends on the single variable with the largest absolute value, making gradient-based information less useful.

See also

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

Examples

F04(c(0, 0, 0))    # Returns 0 (global minimum)
#> [1] 0
F04(c(-1, 2, -3))  # Returns 3
#> [1] 3
F04(c(5, -5, 5))   # Returns 5
#> [1] 5