function [S,G,H]=test17(x)
% Edgar & Himmelblau, 1988
% minimo local:
% x0 = [1, 1]'  ou  x0 = [-1, -1]'
% xo = [3.5355 3.5355]' ou  xo = [-3.5355 -3.5355]'
% S(xo) = 0
% minimo global:
% x0 = [-1, 1]'  ou  x0 = [1, -1]'
% xo = [-3.5355 3.5355]' ou  xo = [3.5355 -3.5355]'
% S(xo) = -12.5

%op=optimset('LargeScale','off','MaxFunEvals',inf,'MaxIter',200,'Display','iter',...
%   'TolFun',1e-6,'TolX',1e-6,'LineSearch','quadcubic','TolCon',1e-6);

%op=optimset('LargeScale','off','MaxFunEvals',inf,'MaxIter',200,'Display','iter',...
%   'TolFun',1e-6,'TolX',1e-6,'LineSearch','quadcubic','TolCon',1e-6,'GradObj','on', ...
%   'HessUpdate','bfgs');

%[x,S,ex,out,lambda,grad,hess]=fmincon('test17',[1 1],[],[],[],[],[],[],'restr17',op)

S=x(1).*x(2);

if nargout > 1
  G=[x(2); x(1)];  % gradiente
  if nargout > 2
    H = [0 1;1 0];
  end
end


