function data_to_newton_test ( )

%*****************************************************************************80
%
%% data_to_newton_test tests data_to_newton.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    15 November 2019
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'data_to_newton_test:\n' );
  fprintf ( 1, '  data_to_newton computes the Newton polynomial coefficients\n' );
  fprintf ( 1, '  for a divided difference interpolant, from data;\n' );
%
%  Sample exp().
%
  n = 4;
  x = 1:n;
  y = exp ( x );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  The data:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : n
    fprintf ( 1, '  %8f  %8f\n', x(i), y(i) );
  end

  [ c, z ] = data_to_newton ( x, y );

  newton_print ( c, z, '  The Newton polynomial:' );

  return
end

