Elsevier

Journal of Symbolic Computation

Volume 105, July–August 2021, Pages 4-27
Journal of Symbolic Computation

Toward the best algorithm for approximate GCD of univariate polynomials

https://doi.org/10.1016/j.jsc.2019.08.004Get rights and content

Abstract

Approximate polynomial GCD (greatest common divisor) of polynomials with a priori errors on their coefficients, is one of interesting problems in Symbolic-Numeric Computations. In fact, there are many known algorithms: QRGCD, UVGCD, STLN based methods, Fastgcd and so on. The fundamental question of this paper is “which is the best?” from the practical point of view, and subsequently “is there any better way?” by any small extension, any effect by pivoting, and any combination of sub-routines along the algorithms. In this paper, we consider a framework that covers those algorithms and their sub-routines, and makes their sub-routines being interchangeable between the algorithms (i.e. disassembling the algorithms and reassembling their parts). By this framework along with/without small new extensions and a newly adapted refinement sub-routine, we have done many performance tests and found the current answer. In summary, 1) UVGCD is the best way to get smaller tolerance, 2) modified Fastgcd is better for GCD that has one or more clusters of zeros with large multiplicity, and 3) modified ExQRGCD is better for GCD that has no cluster of zeros.

Introduction

Finding the greatest common divisor (GCD) of the given two polynomials is one of essential computations in computer algebra. In fact, most of other algebraic computations (e.g. reduction of fraction, factorization and so on) rely on the polynomial GCD. In general, finding the GCD can be done by the Euclidean algorithm or other fast algorithms (e.g. halfGCD and its variants (Roy and Sedjelmaci, 2013)). However, in some empirical or practical situations, the coefficients of the given polynomials may have a priori errors, and any conventional algorithm can not compute their expected GCD since their perturbations arisen from the errors make the given polynomials being coprime even if they had some non-trivial common factor in nature. For example, for f(x)=0.999x2+1.999x+1.001(x+1)2 and g(x)=1.001x20.999(x+1)(x1), the Euclidean algorithm can not compute any non-trivial GCD, even if we would like to have their GCD like d(x)=1.00063x+0.999375.

To overcome this problem, for the couple of decades, several algorithms have been studies and the resulting quasi GCD is called “approximate polynomial GCD”. In the early stage of literatures, the first sight of the related problem is appeared in Dunaway (1974) where the Euclidean algorithm with numerical computations is proposed. In this stage, the other algorithms (Schönhage, 1985; Noda and Sasaki, 1991; Sasaki and Noda, 1989) follows the same approach hence their results can be considered as numerical variants of exact GCD. The turning point tending toward the modern definition (e.g. a non-trivial GCD of polynomials in the neighborhoods of the given polynomials over a number field without any numerical fashion) is given by Emiris et al., 1997, Emiris et al., 1996, and this definition or similar definitions are widely used after that.

In the present day, there are many algorithms for approximate GCD of univariate polynomials: QRGCD (Corless et al., 2004), UVGCD (Zeng, 2011), STLN based methods (Kaltofen et al., 2006, Kaltofen et al., 2007), Fastgcd (Bini and Boito, 2007), ExQRGCD (Nagasaka and Masui, 2013) and GPGCD (Terui, 2013) that are focused in this paper, and the others (Fazzi et al. (2019), Usevich and Markovsky (2017), Bourne et al. (2017), Christou et al. (2010) and so on). Therefore, one may have the very fundamental question “which is the best?” especially from the practical point of view. One of our contributions is answering to this question. One may think that each research paper has some comparison with known methods hence the question must exist in the papers. This is partially correct. However, in general, those comparisons are based on different programming languages, computer environments, implementors and code optimization levels, hence any well-considered comparison under an uniform treatment is required in addition to those comparisons.

Moreover, it is notable and important that most of these algorithms rely on matrix factorizations of some structured matrices and optimization techniques (for theoretical fundamentals and most of literatures can be found in Boito (2011)). This means that we can consider a framework that covers these algorithms and their sub-routines and makes their sub-routines being interchangeable between the algorithms. By this framework, we can disassemble the algorithms and reassemble their parts as new algorithms. Therefore, we have some answers to the subsequent open question “is there any better way?” along with/without small new extensions (including any effect by pivoting) and a newly adapted sub-routine (based on the approach in Giesbrecht et al. (2017)). This is also one of contributions of this paper and our result is given in Sections 4 and 5. In summary, 1) UVGCD is the best way to get smaller tolerance (a kind of radius of neighborhoods), 2) modified Fastgcd is better for GCD that has one or more clusters of zeros with large multiplicity, and 3) modified ExQRGCD is better for GCD that has no cluster of zeros.

After the preliminary subsection including some definitions and notations below, we start with the several brief reviews of known algorithms, and introduce some small new extensions and a newly adapted sub-routine in Section 2. Our framework is given in Section 3, and our result of some hard performance test is given in Section 4. Finally, in Section 5, we give our recommendation among the algorithms.

We assume that polynomials f(x)=i=0mfixiK[x] and g(x)=i=0ngixiK[x] are given with the assumption mn. The domain K[x] that f(x) and g(x) belong to is R[x] or C[x] depending on each problem setting. Each of these given polynomials has the unit Euclidean norm (2-norm) (i.e. f(x)2=g(x)2=1). We scale the polynomials if they do not have the unit norm at the input. Although there are several variants of definitions, we use the following two definitions of approximate GCD.

Definition 1 approximate polynomial GCD with the given tolerance

For the tolerance εR0, we compute the polynomial d(x)K[x] called “approximate polynomial GCD” of tolerance ε, which has the maximum degree and satisfiesf(x)+Δf(x)=f1(x)d(x),g(x)+Δg(x)=g1(x)d(x) for some polynomials Δf(x),Δg(x),f1(x),g1(x)K[x] such thatdeg(Δf)deg(f),deg(Δg)deg(g),Δf2<εf2,Δg2<εg2.

Definition 2 approximate polynomial GCD with the given degree

For the degree kN, we compute the polynomial d(x)K[x] called “approximate polynomial GCD” of degree k, which minimizes Δf22+Δg22 (called perturbation) and satisfiesf(x)+Δf(x)=f1(x)d(x),g(x)+Δg(x)=g1(x)d(x),deg(d)=k for some polynomials Δf(x),Δg(x),f1(x),g1(x)K[x] such thatdeg(Δf)deg(f),deg(Δg)deg(g).

Remark 1

Most of algorithms for Definition 1 do not guarantee the maximum degree but try to find a factor of nearly maximum degree by floating-point calculations (see Emiris et al. (1997) for a maximum degree condition). Also for Definition 2, most of algorithms do not guarantee the minimum perturbation but try to find a factor with a nearly minimum perturbation by floating-point calculations, and there are similar but different objective functions (e.g. max(Δf2,Δg2)). Moreover, there are algorithms for polynomials in Z[x] (hence by exact calculations), proposed by von zur Gathen et al. (2010) and Nagasaka (2011) for example.

Remark 2

In this paper, we seek the best algorithm among the algorithms we are interested in. The criteria of our evaluation is very simple. A larger detecting degree is better (and a smaller resulting tolerance is better if the same degree) for approximate polynomial GCD with the given tolerance (Definition 1), and a smaller resulting perturbation is better for approximate polynomial GCD with the given degree (Definition 2). However, too much elapsed time may not be a good behavior from the practical point of view. Therefore, we consider their elapsed time also.

For vectors and matrices, 2 and F denote the Euclidean norm (2-norm) and the Frobenius norm, respectively. AT, AH and A1 are the transpose, the conjugate transpose, and the inverse of matrix A, respectively. The coefficient vector (in the descending term order) of p(x) of degree k is denoted by pKk+1. The Sylvester matrix of f(x) and g(x) is denoted by Syl(f,g) defined asSyl(f,g)=(fmfm1f1f0fmfm1f1f0fmfm1f1f0gngn1g1g0gngn1g1g0gngn1g1g0)K(m+n)×(m+n). The subresultant matrix of order k of f(x) and g(x) (nk columns for f and mk columns for g) is denoted by Sk(f,g) defined asSk(f,g)=(fmgnfm1fmgn1gnfm1gn1f1g1f0f1g0g1f0g0f1g1f0g0)K(m+nk)×(m+n2k). Throughout this paper, the capital letters D, L, U, P, Q and R denote diagonal, lower triangular, upper triangular, permutation, unitary (orthogonal) and upper triangular matrices, respectively.

Section snippets

Known algorithms and our extensions

In this paper, we are interested in the algorithms: QRGCD, ExQRGCD, UVGCD, Fastgcd, STLN based methods and GPGCD, hence we give some brief reviews for these algorithms. Especially for the first 4 algorithms, we show some their backgrounds and give our extensions (e.g. pivoting). Moreover, we adapt a new refinement method based on the method for structured polynomial matrices.

Interchangeable framework and implementation

As described in the previous subsections, all the algorithms basically follow the steps as in Algorithm 5, and Table 2 shows their sub-routines used in each step. We give some short notes for “n/a” in the table. 1) QRGCD and ExQRGCD do not have any original refinement step, 2) the STLN based methods, GPGCD and GHLGCD are designed for Definition 2 and they do not need to find the degree of approximate GCD, and 3) the STLN based methods and GHLGCD do not have any original method to find the

Performance test and result

We have prepared the following tolerance sensitive problems where the 2-norm of perturbed polynomials (as noisy error) in each pair is 108. This performance test with the input tolerance ε=108 is not easy task since for each pair the expected tolerance of the expected degree of approximate GCD is mostly in [108,107].

    half

    For Z>0, we have generated 100 pairs of polynomials of degree 10, of unit 2-norm. Each pair has the GCD of degree 5 and each factor has integer coefficients randomly

Recommendation and concluding remarks

According to our experiments and theoretical backgrounds, we recommend our algorithm selection strategies for approximate GCD: Strategies 6 and 7. For choosing Loop Structure, the unidirectional degree search is the unique answer except for the case that the expected degree of approximate GCD is small. If it is small, we have two choices: the bidirectional degree search and the multi stage factor peeling. The result of Boito 8.6.1 indicates the multi stage factor peeling is weak for polynomials

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgements

The author wishes to thank Prof. Erich Kaltofen for his wide-range contributions to Symbolic-Numeric computations, including various constructive comments to younger researchers (including the author).

References (28)

  • D.A. Bini et al.

    Structured matrix-based methods for polynomial ϵ-gcd: analysis and comparisons

  • P. Boito

    Structured Matrix Based Methods for Approximate Polynomial GCD

    (2011)
  • R.M. Corless et al.

    QR factoring to compute the GCD of univariate approximate polynomials

    IEEE Trans. Signal Process.

    (2004)
  • A.J. Cox et al.

    Stability of Householder QR factorization for weighted least squares problems

  • Cited by (4)

    This work was supported by JSPS KAKENHI Grant Number 15K00016.

    View full text