function fx = p17_fx ( n, x )

%*****************************************************************************80
%
%% P17_FX evaluates the function for problem 17.
%
%  Discussion:
%
%    The equations are:
%
%      F1(X) = X(1) + X(2) - 3
%      F2(X) = X(1)^2 + X(2)^2 - 9
%
%    with roots (3,0) and (0,3).
%
%    Using a starting point of (1,5), here are the iterates for Broyden's
%    method and Newton's method:
%
%    Broyden's Method
%
%    0   1.0              5.0
%    1  -0.625            3.625
%    2  -0.0757575757575  3.0757575757575
%    3  -0.0127942681679  3.0127942681679
%    4  -0.0003138243387  3.0003138243387
%    5  -0.0000013325618  3.0000013325618
%    6  -0.0000000001394  3.0000000001394
%    7   0.0              3.0
%
%    Newton's Method
%
%    0   1.0              5.0
%    1  -0.625            3.625
%    2  -0.0919117647059  3.0919117647059
%    3  -0.0026533419372  3.0026533419372
%    4  -0.0000023425973  3.0000023425973
%    5  -0.0000000000018  3.0000000000018
%    6   0.0              3.0
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 December 1998
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    John Dennis, Robert Schnabel,
%    Numerical Methods for Unconstrained Optimization
%    and Nonlinear Equations,
%    SIAM, 1996,
%    ISBN13: 978-0-898713-64-0,
%    LC: QA402.5.D44.
%
%  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) + x(2) - 3.0;
  fx(2) = x(1)^2 + x(2)^2 - 9.0;

  return
end

