function r8poly_multiply_test ( )

%*****************************************************************************80
%
%% r8poly_multiply_test() tests r8poly_multiply_test().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 October 2019
%
%  Author:
%
%    John Burkardt
%
  ntest = 2;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8poly_multiply_test\n' );
  fprintf ( 1, '  r8poly_multiply() multiplies two polynomials.\n' );
  fprintf ( 1, '\n' );
%
%  1: Multiply (1+X) times (1-X).  Answer is 1-X^2.
%  2: Multiply (1+2*X+3*X^2) by (1-2*X). Answer is 1 + 0*X - X^2 - 6*X^3
%
  for itest = 1 : ntest

    if ( itest == 1 )
      na = 1;
      a(1:na+1) = [ 1.0; 1.0 ];
      nb = 1;
      b(1:nb+1) = [ -1.0; 1.0 ];
    elseif ( itest == 2 )
      na = 2;
      a(1:na+1) = [ 3.0; 2.0; 1.0 ];
      nb = 1;
      b(1:nb+1) = [ -2.0; 1.0 ];
    end

    c = r8poly_multiply ( na, a, nb, b );

    r8poly_print ( a, '  The factor A:' );

    r8poly_print ( b, '  The factor B:' );

    r8poly_print ( c, '  The product C = A*B:' );

  end

  return
end
