function [f] = Nesterov_Chebysev(x)
%
% INPUT
%%%%%%%%%
% x: n * 1 vector in [-1,1]^n
%%%%%%%%%
% OUTPUT
%%%%%%%%%
% f = ( x(1) - 1 )^2 * (( x(2) - T_3(x(1)) )^2+1)
%              * ... * (( x(n) - T_3(x(n-1)) )^2+1),
%     where T_3(x) = 4x^3-x is the third Chebysev polynomial of the first
%     kind. 

n = size(x,1); 
Chebysev = zeros(n-1,1); 
factors = zeros(n,1);
factors(1,1) = ( x(1,1) - 1 )^2; 
for i = 2:n
    Chebysev(i-1,1) = 4 * x(i-1,1)^3 - 3 * x(i-1,1);
    factors(i,1) = factors(i-1,1) * ((x(i,1) - Chebysev(i-1,1))^2+1);
end 
f = factors(n,1);
