function value = zakharov_f ( m, n, x )

%*****************************************************************************80
%
%% ZAKHAROV_F returns the function in the zakharov problem.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    26 January 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Sashwati Ray, PSV Nataraj,
%    An efficient algorithm for range computation of polynomials using the
%    Bernstein form,
%    Journal of Global Optimization,
%    Volume 45, 2009, pages 403-426.
%
%  Parameters:
%
%    Input, integer M, the number of variables.
%
%    Input, integer N, the number of points.
%
%    Input, real X(M,N), the points.
%
%    Output, real VALUE(N), the value of the function at X.
%
  s1 = zeros ( 1, n );
  s2 = zeros ( 1, n );

  for i = 1 : m
    s1 = s1 +           x(i,1:n) .^ 2;
    s2 = s2 + 0.5 * i * x(i,1:n);
  end

  value = s1 + s2 .^ 2 + s2 .^ 4;

  value = value';

  return
end


