function fx = p02_fx ( n, x )

%*****************************************************************************80
%
%% p02_fx() evaluates the function for problem 2.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 October 2020
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of variables and equations.
%
%    real X(N), the evaluation point.
%
%  Output:
%
%    real FX(N), the function value.
%
  fx = zeros ( n, 1 );

  fx(1) = x(1) + 10.0 * x(2);
  fx(2) = sqrt ( 5.0 ) * ( x(3) - x(4) );
  fx(3) = ( x(2) - 2.0 * x(3) )^2;
  fx(4) = sqrt ( 10.0 ) * ( x(1) - x(4) ) * ( x(1) - x(4) );

  return
end

