The Rastrigin function is a nonconvex test function used in global optimization theory. In
dimensions, its usual form is
where
is conventional. It has global minimum
and many regularly spaced local minima produced by the
cosine terms.
The separability and large number of local minima make the function a common benchmark for comparing global optimization algorithms.
Benchmark domains are often restricted to a box such as , but the formula itself is defined on all of
.