function legendre_monomial_legendre_test ( )

%*****************************************************************************80
%
%% legendre_monomial_legendre_test() tests accuracy.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 February 2024
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'legendre_monomial_legendre_test ( )\n' );
  fprintf ( 1, '  Convert a polynomial from Legendre form\n' );
  fprintf ( 1, '  to monomial form and back.\n' );

  n = 10;
  lcoef = rand ( n + 1, 1 );
  mcoef = legendre_to_monomial ( n, lcoef );
  lcoef2 = monomial_to_legendre ( n, mcoef );

  e = norm ( lcoef - lcoef2 );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  L2 difference = %g\n', e );

  return
end
