Approximate Polynomial Algebra - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim

Home : Support : Online Help : System : Information : Updates : Maple 2021 : Approximate Polynomial Algebra

Approximate Polynomial Algebra Package in Maple 2021


New PolynomialTools Subpackage

CoefficentVector and FromCoefficientVector

Divide and ConvolutionMatrix

GCD and SylvesterMatrix

Factor and RuppertMatrix


New PolynomialTools Subpackage


New in Maple 2021 is the PolynomialTools:-Approximate subpackage. It includes three main commands for computing approximate operations on polynomials in many variables: Factor, GCD, and Divide, as well as commands for computing the matrices used for these operations.


These new commands are useful for cases where no exact answer is possible, and a solution is instead found for a nearby problem which does have a solution. Typically, this assumes that some amount of error or noise was introduced into the coefficients of the input polynomial(s) that destroyed algebraic structure, and which these commands attempt to recover.


The SNAP package has provided the gcd and division with remainder operations for univariate polynomials but those commands typically require the user to provide a numerical tolerance.  These new commands do not take a tolerance as input, but instead always return an approximate solution, even if it has very large backward error following the model in the papers of Gao et al. and Kaltofen et al in the references below.


This new package supports univariate computations of quotients and gcd under that model (univariate inputs to Factor are just sent to the top-level command factor).

factor( x^4-3.0*x^2-4.0 );



factor( x^4-3.0*x^2-4.0*I );



SNAP:-QRGCD( x^4-3.0*x^2-4.0, x^2-4.0, x, 10e-10);



SNAP:-Quotient( x^4-3.0*x^2-4.0, x^2-4.0, x );



New functionality is described below.





CoefficentVector and FromCoefficientVector


The commands CoefficientVector and FromCoefficientVector in the main PolynomialTools package were both enhanced to work with multivariate polynomials.

v := CoefficientVector(y^3-y^2*x+(y-2)*x^2+x^3, [x,y]);



FromCoefficientVector( v, [a, b]);



Divide and ConvolutionMatrix


Approximate division using a LeastSquares computation on the matrix representing polynomial division.

f := x^2+y^2-1;



ConvolutionMatrix(f, [x,y], 2);


infolevel[PolynomialTools] := 1;



d := sqrt(2.0)*(x^2+y^2-1);



G := sort( (x^2-y^3+1), [x,y]); F := sort( expand( d*G ), [x,y]);




ad_8 := Divide( expand( F + 10^(-8)*x*y ), expand(G+10^(-8)*x^2*y), [x,y] );

Divide:   computed approximate quotient has backward error 2.291288e-08
Divide:   computed approximate quotient has backward error 2.291288e-08



ad_8 := sort( tcoeff(d)*fnormal(expand(ad_8)/(tcoeff(ad_8))), [x,y]);



ilog10(norm(expand(d-ad_8),2) / norm(d,2));



GCD and SylvesterMatrix


Approximate GCD computation using a low-rank approximation of a generalized Sylvester matrix.

d := sqrt(2.0)*(x^2+y^2-1);



F := sort( expand( d*(x^3-y^3+1) ), [x,y]);



G := sort( expand( d*(x^2-y^3+1) ), [x,y]);



S1 := SylvesterMatrix(F, G, [x,y], 3);


Maximal rank, means degree( gcd(F,G) ) < 3

min(upperbound(S1)) - LinearAlgebra:-Rank(S1);



ad_8 := GCD( expand( F + 10^(-8)*x*y ), expand(G+10^(-8)*x^2*y), [x,y] );

GCD:   approximate GCD inputs of total degrees 5 and 5 in [x, y]
GCD:   approximate GCD determined with an error of 7.484964e-10



ad_8 := sort( tcoeff(d)*fnormal(expand(ad_8)/(tcoeff(ad_8))), [x,y]);



ilog10(norm(expand(d-ad_8),2) / norm(d,2));



Factor and RuppertMatrix


Approximate factorization computation using a low-rank approximation of a Ruppert matrix.

F := sort( expand( (x^2+y^2-1)*(x^3-y^3+1) ), [x,y]);



R1 := RuppertMatrix( F, [x,y]);


The rank deficiency of the Ruppert matrix is equal to the number of factors.

min(upperbound(R1)) - LinearAlgebra:-Rank(R1);



aF_8 := Factor( expand( F + 10^(-8)*x*y ), [x,y] );

Factor:   approximate factorization input of degree [5, 5] in [x, y]
Factor:   factorization square-free input of degree [5, 5] in [x, y]
Factor:   polynomial has 2 approximate factors at numerical tolerance 10e-9



sort( fnormal( expand(aF_8) ), [x,y] );



ilog10( norm(expand(F-aF_8),2) / norm(F,2) );





Gao, S.; Kaltofen, E.; May, J.; Yang, Z.; and Zhi, L. "Approximate factorization of multivariate polynomials via differential equations." Proceedings of the 2004 International Symposium on Symbolic and Algebraic Computation (ISSAC 2004),  pp. 167-174. Ed. J. Gutierrez. ACM Press, 2004.


Kaltofen, E.; May, J.; Yang, Z.; and Zhi, L. "Approximate factorization of multivariate polynomials using singular value decomposition." Journal of Symbolic Computation Vol. 43(5), (2008): 359-376.