function value = newton_value ( c, z, x )

%*****************************************************************************80
%
%% newton_value evaluates a polynomial in Newton form.
%
%  Input:
%
%    real c(d+1): the coefficients of the Newton form.
%
%    real z(d): the base points of the Newton form.
%
%    real x: the evaluation point.
%
%  Output:
%
%    real value: the value of the polynomial at x.
%
  d = length ( c ) - 1;
  value = c(d+1) * ones ( size ( x ) );
  for i = d : -1 : 1
    value = value .* ( x - z(i) ) + c(i);
  end
  return
end
