function value = wood_f ( x, n )

%*****************************************************************************80
%
%% wood_f() evaluates the Wood function.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    31 July 2016
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real X(N), the evaluation point.
%
%    integer N, the number of variables.
%
%  Output:
%
%    real VALUE, the function value.
%
  f1 = x(2) - x(1) ^ 2;
  f2 = 1.0 - x(1);
  f3 = x(4) - x(3) ^ 2;
  f4 = 1.0 - x(3);
  f5 = x(2) + x(4) - 2.0;
  f6 = x(2) - x(4);

  value = ...
      100.0 * f1 ^ 2 ...
    +         f2 ^ 2 ...
    +  90.0 * f3 ^ 2 ...
    +         f4 ^ 2 ...
    +  10.0 * f5 ^ 2 ...
    +   0.1 * f6 ^ 2;

  return
end
