function fx = p08_fx ( n, x )

%*****************************************************************************80
%
%% P08_FX evaluates the function for problem 8.
%
%  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:n-1) = x(1:n-1) + sum ( x(1:n) ) - ( n + 1 );

  fx(n) = prod ( x(1:n) ) - 1.0;

  return
end
