function dif_append_test ( )

%*****************************************************************************80
%
%% dif_append_test() tests dif_append().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    16 November 2019
%
%  Author:
%
%    John Burkardt
%
  maxtab = 10;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'dif_append_test():\n' );
  fprintf ( 1, '  dif_append() updates a divided difference polynomial;\n' );
  fprintf ( 1, '  to include a new data item;\n' );
%
%  Set XTAB, YTAB to X, exp(x).
%
  ntab = 4;
  xtab = 1:ntab;
  ytab(1:ntab) = exp(xtab);

  diftab = data_to_dif ( ntab, xtab, ytab );

  dif_print ( ntab, xtab, diftab, '  The divided difference polynomial:' );
%
%  Append (5,25) to the table.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Append the data (5,exp(5)) to the table.\n' );
  fprintf ( 1, '\n' );

  xval = ntab + 1;
  yval = exp(xval);

  [ xtab, diftab ] = dif_append ( xtab, diftab, xval, yval );
  ntab = ntab + 1;

  dif_print ( ntab, xtab, diftab, ...
    '  The augmented divided difference polynomial:' );

  return
end
