function value = r8poly_value ( d, c, x )

%*****************************************************************************80
%
%% r8poly_value() evaluates a polynomial naively.
%
%  Discussion:
%
%    The power sum form of a polynomial is:
%
%      p(x) = c(0) + c(1) * x + ... + c(n-1) * x^(n-1) + c(n) * x^(n)
%
%    Because MATLAB doesn't allow 0 indexing, we use an adjusted formula:
%
%      p(x) = c(1) + c(2) * x + ... + c(n) * x^(n-1) + c(n+1) * x^(n)
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    21 August 2017
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer D: the degree.
%
%    real C(D+1): the polynomial coefficients.  
%
%    real X: the evaluation point.
%
%  Output:
%
%    real VALUE: the polynomial value.
%
  value = c(1);
  xi = 1.0;
  for i = 1 : d
    xi = xi * x;
    value = value + c(i+1) * xi;
  end

  return
end
