Mathematical Definition


Gramacy & Lee Function

Description and Features

  • The function is continuous.
  • The function is not convex.
  • The function is defined on 1-dimensional space.
  • The function is unimodal.

Input Domain

The function can be defined on any input domain but it is usually evaluated on $x \in [-0.5, 2.5]$.

Global Minima

The function has one local minimum at: $f(x^*)=-0.869011134989500$ at $\textbf{x}^{\ast} = 0.548563444114526$.


An implementation of the Gramacy & Lee Function with MATLAB is provided below.

% Computes the value of the Gramacy & Lee benchmark function.
% SCORES = GRAMACYLEEFCN(X) computes the value of the Gramacy & Lee 
% function at point X. GRAMACYLEEFCN 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: 
% 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 = gramacyleefcn(x)
    n = size(x, 2);
    assert(n == 1, 'Gramacy & Lee function is only defined on a 1-D space.')

    scores = (sin(10 .* pi .* x) ./ (2 * x) ) + ((x - 1) .^ 4);

The function can be represented in Latex as follows:

f(x) = \frac{sin(10\pi x)}{2x} + (x-1)^4