function newton_rc_test03 ( )

%*****************************************************************************80
%
%% newton_rc_test03 tests newton_rc() on 4 nonlinear equations.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 April 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'newton_rc_test03\n' );
  fprintf ( 1, '  Use newton_rc() to solve 4 nonlinear equations.\n' );

  n = 4;
  ido = 0;
  x = zeros ( n, 1 );
  fx = f3 ( x );
  r8vec2_print ( x, fx, '  Initial X and F(X)' );

  while ( true )

    [ ido, x ] = newton_rc ( ido, x, fx );

    if ( ido == 0 )
      fprintf ( 1, '\n' );
      fprintf ( 1, '  Convergence:\n' );
      break
    elseif ( ido == 1 )
      fx = f3 ( x );
%     r8vec2_print ( x, fx, '  Check X and F(X)' );
    elseif ( ido == 2 )
      fx = f3 ( x );
%     r8vec2_print ( x, fx, '  Jacobian X and F(X)' );
    else
      fprintf ( 1, '\n' );
      fprintf ( 1, '  Convergence failure:\n' );
      break
    end

  end

  r8vec2_print ( x, fx, '  Final X and F(X)' );

  return
end

