function polynomial_resultant_sylvester_test ( )

%*****************************************************************************80
%
%% polynomial_resultant_sylvester_test() tests polynomial_resultant_sylvester().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    30 January 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'polynomial_resultant_sylvester_test():\n' );
  fprintf ( 1, '  polynomial_resultant_sylvester() computes \n' );
  fprintf ( 1, '  the resultant R of polynomials P and Q\n' );
  fprintf ( 1, '  based on the determinant of the Sylvester matrix.\n' );

  n_data = 0;

  while ( true )

    [ n_data, p, q, r1 ] = polynomial_resultant_values ( n_data );

    if ( n_data == 0 )
      break
    end

    fprintf ( 1, '\n' );
    r8poly_print ( p, 'P(x):' );
    r8poly_print ( q, 'Q(x):' );
    fprintf ( 1, '   R (tabulated):   %g\n', r1 );

    r2 = polynomial_resultant_sylvester ( p, q );

    fprintf ( 1, '   R (calculated):  %g\n', r2 );

  end

  return
end

