Polynomial GCD Derived through Monic Polynomial Subtractions
Feng Cheng Chang1
Academic Editor: E. Kita, F. Lebon
Received10 Mar 2011
Accepted19 Apr 2011
Published13 Jun 2011
Abstract
A simple and efficient algorithm for finding the GCD of a pair of univariate polynomials is derived. The process requires only successive subtraction of two monic polynomials. Amazingly, this approach gives the desired GCD for a pair of test polynomials of very high degree, such as
and its derivative.
1. Introduction
The computation of the greatest common divisor (GCD) of a pair of polynomials is an important issue in computational mathematics and also plays a crucial role in many science and engineering fields. Several numerical methods have been proposed for the derivation of polynomial GCD [1β5]. Some are based on the classical Euclidean algorithm and the others are based on the procedures involving Sylvester resultant matrix. Most of them require algorithm of some advanced mathematics, such as the singular value decomposition and the least square iteration process.
In this paper a simple and effective method to find the GCD of a pair of given polynomials is presented. The process requires only the successive subtraction of two monic polynomials. It is modified purposely from the longhand polynomial divisions employed in the classical Euclidean GCD computation. The entire computations require only simple elementary arithmetic operations, such as division and subtraction.
A MATLAB code is provided, along with a typical numerical example. Amazingly, this routine gives the GCD for a pair of test polynomials of very high degree.
2. Mathematical Formulation
From the classical Euclidean algorithm for computing polynomial GCD, the longhand polynomial division is consecutively employed:where quotient and remainder are obtained from dividing dividend by divisor . If the quotient in every recurrent process can be converted into a numerical constant or even equal to 1, , by making both and equal degree and monic, then the longhand polynomial division becomes simply a pair of βmonic polynomials subtractionβ:
The recurrent process of this approach may therefore be summarized as follows.
Given a pair of polynomials and of degrees and , where and have and βzero trailing coefficients, respectively, and and represent the polynomials without zero trailing coefficients, assuming that , where and.
Before finding our desired , we first consider by setting
Both polynomials and are now in the same degree and monic. Applying the monic polynomial subtraction consecutively starting from until , such that
we get
Finally our desired polynomial GCD is found
It is noted that the complete set of , referred to as βpolynomial remainder sequenceβ [3, 4], may also be computed during the recurrent process. The entire computations involve only elementary arithmetic operations without any advanced mathematics. The total numbers of recurrent process for computing GCD of the two given polynomials and are amazingly fewer than .
3. Computer Routine in MATLAB
The computer code polygcd.m in MATLAB is presented. The inputs p and q are coefficient vectors of two given polynomials and , and the output g is the desired greatest common divisor . The input data can be either real or complex numbers. See Algorithm 1.
If one test polynomial is derived from
that is,
and the another polynomial is the derivative of ,
then, applying the routine polygcd.m, the desired GCD of and is readily computed:
β« p = [1ββββ5βββ2ββββ6βββ76βββ140ββββ802 954ββββ4251βββ13663ββββ18740βββ28472ββββ53504βββ45776βββ5212β―
One of the most important applications of polynomial GCD is to find the roots with multiplicities of high-degree multiple-root polynomials [3].
Let a univariate polynomial of degree be given, and then the roots with multiplicities are to be sought, such that
We are now to find the rational function or its related polynomials and , such that
where
and is the polynomial GCD of and :
Then, and are simply the poles and residues of the rational function . Therefore, instead of directly solving for and from the original -degree multiple-root polynomial, we may now easily find the roots from the -degree simple-root polynomial,
and the corresponding multiplicities by the partial fraction expansion coefficients of the rational function ,
A short program code poly_roots.m for solving multiple-root polynomials is presented. It uses only basic built-in MATLAB routines except the function polygcd.m for computing polynomial GCD. See Algorithm 3.
function Z = poly_roots(p)
%β*** Solve multiple-root polymonials ***
%
ββmz = length(p)-max(find(p));
ββp0 = p(min(find(p)):max(find(p)));
ββq0 = polyder(p0);
if length(p0) < 2, Z = [0,mz]; return, end;
ββg = polygcd(p,q);
ββu0 = deconv(p0,g0);
ββv0 = deconv(q0,g0);
ββw0 = polyder(u0);
ββz0 = roots(u0);
ββm0 = polyval(v0,z0)./polyval(w0,z0);
ββZ = [z0,round(abs(m0))];
if mz > 0, Z = [Z; 0,mz]; end;
6. Conclusion
The very simple and efficient algorithm for the calculation of GCD of a pair of given polynomials is developed. The entire computations involve only simple elementary arithmetic operations. Amazingly, the derived routine gives the desired results for the test polynomials of very high degrees, such as , and , and their respective derivatives.
One of the most important applications for polynomial GCD is to find the roots with multiplicities of polynomials with high degrees [1β3]. It reveals that the higher the root multiplicities of the given polynomial are, the more efficient this approach becomes. This is contrary to the usual experience that the most difficult part of solving for the roots of a polynomial is calculating those that have high multiplicities [1].
References
Z. Zeng, βComputing multiple roots of inexact polynomials,β Mathematics of Computation, vol. 74, no. 250, pp. 869β903, 2005.
C. D. Yan and W. H. Chieng, βMethod for finding multiple roots of polynomials,β Computers & Mathematics with Applications, vol. 51, no. 3-4, pp. 605β620, 2006.