function bernstein_legendre01_bernstein_test ( )

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

  n = 10;
  bcoef = rand ( n + 1, 1 );
  lcoef = bernstein_to_legendre01 ( n, bcoef );
  bcoef2 = legendre01_to_bernstein ( n, lcoef );

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

  return
end
