Mathematical Definition

\[f(\textbf{x}) = f(x_1, ..., x_n)= \frac{1}{2}\sum_{i=1}^{n} (x_i^4 -16x_i^2+5x_i)\]

Plots

Styblinski-Tank Function

Styblinski-Tank Function

The contour of the function is as presented below:

Styblinski-Tank Function

Description and Features

  • The function is continuous.
  • The function is not convex.
  • The function is defined on n-dimensional space.
  • The function is multimodal.

Input Domain

The function can be defined on any input domain but it is usually evaluated on $x \in [-5, 5]$ for all $i = 1,…,n$.

Global Minima

The function has one global minimum at: $f(x^*)=-39.16599\textbf{n}$ at $\textbf{x}^{\ast} = (-2.903534, …, -2.903534)$.

Implementation

Python

For Python, the function is implemented in the benchmarkfcns package, which can be installed from command line with pip install benchmarkfcns.

from benchmarkfcns import styblinskitank

print(styblinskitank([[0, 0, 0],
              [1, 1, 1]]))

MATLAB

An implementation of the Styblinski-Tank Function with MATLAB is provided below.

% Computes the value of the Styblinski-Tank benchmark function.
% SCORES = STYBLINSKITANKFCN(X) computes the value of the Styblinski-Tank  
% function at point X. STYBLINSKITANKFCN accepts a matrix of size M-by-2 
% and returns a vetor SCORES of size M-by-1 in which each row contains the 
% function value for the corresponding row of X.
% For more information please visit: 
% https://en.wikipedia.org/wiki/Test_functions_for_optimization
% 
% Author: Mazhar Ansari Ardeh
% Please forward any comments or bug reports to mazhar.ansari.ardeh at
% Google's e-mail service or feel free to kindly modify the repository.
function scores = styblinskitankfcn(x)
    n = size(x, 2);
    scores = 0;
    for i = 1:n
        scores = scores + ((x(:, i) .^4) - (16 * x(:, i) .^ 2) + (5 * x(:, i)));
    end
    scores = 0.5 * scores;
end

The function can be represented in Latex as follows:

f(\textbf{x}) = f(x_1, ..., x_n)= \frac{1}{2}\sum_{i=1}^{n} (x_i^4 -16x_i^2+5x_i)

References: