A highly multimodal test function with many local minima arranged in a regular lattice pattern. The global minimum is at the origin.
F09(x)Numeric scalar representing the function value.
Formula: $$f(x) = 10n + \sum_{i=1}^{n} \left[x_i^2 - 10\cos(2\pi x_i)\right]$$
Global minimum: \(f(0, 0, ..., 0) = 0\)
Characteristics:
Type: Multimodal
Separable: Yes
Differentiable: Yes
Number of local minima: \(\approx 10^n\)
Default bounds: \([-5.12, 5.12]^n\)
Default dimensions: 50
The Rastrigin function is a typical example of non-linear multimodal function. The large number of local minima makes it difficult for optimization algorithms to find the global minimum.
test-functions for an overview of all test functions,
get_function_details to retrieve function parameters.