function bernstein_monomial_bernstein_test ( )

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

  n = 10;
  bcoef = rand ( n + 1, 1 );
  mcoef = bernstein_to_monomial ( n, bcoef );
  bcoef2 = monomial_to_bernstein ( n, mcoef );

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

  return
end
