function [ ndp, xdp, ydp ] = dif_deriv ( nd, xd, yd )

%*****************************************************************************80
%
%% dif_deriv() computes the derivative of a divided difference polynomial.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    28 October 2019
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Carl deBoor,
%    A Practical Guide to Splines,
%    Springer, 2001,
%    ISBN: 0387953663,
%    LC: QA1.A647.v27.
%
%  Input:
%
%    integer ND: the size of the input table.
%
%    real XD(ND): the abscissas for the divided
%    difference table.
%
%    real YD(ND): the divided difference table.
%
%  Output:
%
%    integer NDP: ND - 1.
%
%    real XDP(ND-1): the abscissas for the divided
%    difference table for the derivative.
%
%    real YDP(ND-1): the divided difference table for the derivative.
%

%
%  Shift the abscissas to zero.
%
  [ xd, yd ] = dif_shift_zero ( nd, xd, yd );
%
%  Construct the derivative.
%
  ndp = nd - 1;

  xdp = zeros ( ndp, 1 );
  ydp = zeros ( ndp, 1 );

  for i = 1 : nd - 1
    ydp(i) = i * yd(i+1);
  end

  return
end
