SNAP
QRGCD
compute GCD for a pair of univariate numeric polynomials by using QR factoring
Calling Sequence
Parameters
Description
Examples
References
QRGCD(f, g, x, eps)
f, g
-
univariate numeric polynomials
x
name; indeterminate for f and g
eps
type numeric and non-negative; stability parameter
The QRGCD(f, g, x, eps) function returns univariate numeric polynomials u,v,d such that d is an approximate-GCD for the input polynomials (f, g). (See [1] for the definition of an approximate-GCD.)
With high probability, the output polynomials satisfy || u * f + v * g - d || < ||(f,g,u,v,d)|| * eps, || f - d * f1 || < ||f|| * eps, and || g - d * g1 || < ||g|| * eps, where the polynomials f1 and f2 are cofactors of f and g with respect to the divisor d.
The output polynomials u and v satisfy deg(u) < deg(g) - deg(d) and deg(v) < deg(f) - deg(d).
with⁡SNAP:
f≔expand⁡x−5⁢x−12⁢56⁢x8+83⁢x7+91⁢x4−92⁢x2+93⁢x−91
f≔56⁢x10−225⁢x9+91⁢x6+2712⁢x4+599⁢x3−16652⁢x2−6332⁢x8−10012⁢x5+733⁢x+4152⁢x7−4552
g≔expand⁡x−5⁢x−12⁢32⁢x8−37⁢x6+93⁢x5+58⁢x4+90⁢x2+53
g≔32⁢x10+43⁢x8+5932⁢x7−546⁢x6+235⁢x4+278⁢x2−176⁢x9−1732⁢x5−495⁢x3−5832⁢x+2652
eps≔1.0⁢10−4
eps≔0.0001000000000
u,v,d≔QRGCD⁡f,g,x,eps
u,v,d≔−0.00239210066773749+0.000685923025428402⁢x7−4.53097031259547×10−6⁢x6−0.00164801014632735⁢x5+0.00111190210893584⁢x4+0.00232049175102822⁢x3−0.000814821101997623⁢x2−0.00159767495032097⁢x,−0.000797538808884276−0.00120036529451162⁢x7−0.00177118364917765⁢x6+0.00150784758762043⁢x5+0.00376932816808507⁢x4+0.000171163088689703⁢x3−0.00139357959466412⁢x2+0.00145428191862992⁢x,−0.964763821204428⁢x+0.438529009807886+0.175411603893664⁢x2
evalb⁡evalf⁡norm⁡expand⁡u⁢f+v⁢g−d,2<evalf⁡max⁡norm⁡f,2,norm⁡g,2,norm⁡u,2,norm⁡v,2,norm⁡d,2⁢eps
true
f1≔Quotient⁡f,d,x
f1≔319.249118969049⁢x8+473.172800945610⁢x7−2.81194552442132×10−6⁢x6−0.0000147057859844261⁢x5+518.779744472746⁢x4−0.000370044520443826⁢x3−524.482546282163⁢x2+530.172318733405⁢x−518.826087779702
evalb⁡evalf⁡norm⁡expand⁡f−f1⁢d,2<evalf⁡norm⁡f,2⁢eps
g1≔Quotient⁡g,d,x
g1≔182.428067982314⁢x8−2.19151851293330×10−7⁢x7−210.932454886560⁢x6+530.181566323818⁢x5+330.650841500917⁢x4−0.000159439241270405⁢x3+513.078143438022⁢x2−0.00398971055377326⁢x+302.126538377605
evalb⁡evalf⁡norm⁡expand⁡g−g1⁢d,2<evalf⁡norm⁡g,2⁢eps
Corless, R. M.; Watt, S. M.; and Zhi, L. "QR Factoring to compute the GCD of Univariate Approximate Polynomials." IEEE Transactions on Signal Processing. Vol. 52(12), (2004): 3394-3402.
See Also
SNAP[DistanceToCommonDivisors]
SNAP[EpsilonGCD]
SNAP[QuasiGCD]
Download Help Document
What kind of issue would you like to report? (Optional)