function roots_to_dif_test ( )

%*****************************************************************************80
%
%% roots_to_dif_test() tests roots_to_dif().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 November 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'roots_to_dif_test():\n' );
  fprintf ( 1, '  roots_to_dif() computes the divided difference polynomial\n' );
  fprintf ( 1, '  from the set of roots.\n' );
  fprintf ( 1, '\n' );

  nroots = 1;
  r = 3.0;
  r8vec_print ( nroots, r, '  The roots:' );
  [ nc, xtab, diftab ] = roots_to_dif ( nroots, r );
  dif_print ( nc, xtab, diftab, '  The polynomial:' );

  nroots = 2;
  r = [ 3.0, 1.0 ];
  r8vec_print ( nroots, r, '  The roots:' );
  [ nc, xtab, diftab ] = roots_to_dif ( nroots, r );
  dif_print ( nc, xtab, diftab, '  The polynomial:' );

  nroots = 3;
  r = [ 3.0, 1.0, 2.0 ];
  r8vec_print ( nroots, r, '  The roots:' );
  [ nc, xtab, diftab ] = roots_to_dif ( nroots, r );
  dif_print ( nc, xtab, diftab, '  The polynomial:' );

  nroots = 4;
  r = [ 3.0, 1.0, 2.0, 4.0 ];
  r8vec_print ( nroots, r, '  The roots:' );
  [ nc, xtab, diftab ] = roots_to_dif ( nroots, r );
  dif_print ( nc, xtab, diftab, '  The polynomial:' );

  return
end
