function chebyshev_monomial_chebyshev_test ( )

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

  n = 10;
  ccoef = rand ( n + 1, 1 );
  mcoef = chebyshev_to_monomial ( n, ccoef );
  ccoef2 = monomial_to_chebyshev ( n, mcoef );

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

  return
end
