function f = p03_f ( n, x )

%*****************************************************************************80
%
%% p03_f evaluates the objective function for problem 3.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    16 October 2011
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of variables.
%
%    real X(N), the argument of the objective function.
%
%  Output:
%
%    real F, the value of the objective function.
%
  y = p03_yvec ( );

  f = 0.0;

  for i = 1 : 15

    t = x(1) * exp ( - 0.5 * x(2) * ...
      ( 3.5 - 0.5 * ( i - 1 ) - x(3) )^2 ) - y(i);

    f = f + t * t;

  end

  return
end
