function c3 = poly_add ( c1, c2 )

%*****************************************************************************80
%
%% poly_add adds two polynomials.
%
%  Input:
%
%    real c1(d1+1), c2(d2+1): the coefficients of two polynomials.
%
%  Output:
%
%    real c3(d3+1): the coefficients of the sum.
%
  d1 = length ( c1 ) - 1;
  d2 = length ( c2 ) - 1;
  d3 = max ( d1, d2 );
  c3 = zeros ( d3+1, 1 );
  
  for i = 0 : d1
    c3(i+1) = c1(i+1);
  end
  for i = 0 : d2
    c3(i+1) = c3(i+1) + c2(i+1);
  end
  
  return
end   
