function f = trigonometric1(x)
  %
  % The trigonometric function. See More, Garbow, and Hillstrom,
  % function #26.
  %
  % This function has a minimum with f(x) == 0. The suggested
  % starting point is x0=(1/n, 1/n,...).
  %
  n = length(x);
  f = 0;

  cos_sum = sum(cos(x));

  for k = [ 1 : n ]
    f_k = n - cos_sum + k*(1 - cos(x(k))) - sin(x(k));
    f = f + (f_k)^2;
  end
end
