function [ x, dp2, p1 ] = laguerre_root ( x, order, b, c )

%*****************************************************************************80
%
%% laguerre_root() improves an approximate root of a Laguerre polynomial.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 February 2008
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Arthur Stroud, Don Secrest,
%    Gaussian Quadrature Formulas,
%    Prentice Hall, 1966,
%    LC: QA299.4G3S7.
%
%  Input:
%
%    Input, real X, the approximate root, which
%    should be improved on output.
%
%    Input, integer ORDER, the order of the polynomial to be computed.
%
%    Input, real B(ORDER), C(ORDER), the recursion coefficients.
%
%  Output:
%
%    real X, the approximate root, which
%    should be improved on output.
%
%    real DP2, the value of L'(ORDER)(X).
%
%    real P1, the value of L(ORDER-1)(X).
%
  maxstep = 10;

  for i = 1 : maxstep

    [ p2, dp2, p1 ] = laguerre_recur ( x, order, b, c );

    d = p2 / dp2;
    x = x - d;

    if ( abs ( d ) <= eps * ( abs ( x ) + 1.0 ) )
      return;
    end

  end

  return
end
