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.00239210066773748+0.000685923025428412⁢x7−4.53097031258087×10−6⁢x6−0.00164801014632734⁢x5+0.00111190210893585⁢x4+0.00232049175102826⁢x3−0.000814821101997568⁢x2−0.00159767495032094⁢x,−0.000797538808884249−0.00120036529451165⁢x7−0.00177118364917771⁢x6+0.00150784758762038⁢x5+0.00376932816808507⁢x4+0.000171163088689716⁢x3−0.00139357959466411⁢x2+0.00145428191862992⁢x,−0.964763821204430⁢x+0.438529009807885+0.175411603893669⁢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.249118969040⁢x8+473.172800945553⁢x7−2.81222933045108×10−6⁢x6−0.0000147072040345022⁢x5+518.779744465642⁢x4−0.000370080042164914⁢x3−524.482546459755⁢x2+530.172317845435⁢x−518.826092219543
evalb⁡evalf⁡norm⁡expand⁡f−f1⁢d,2<evalf⁡norm⁡f,2⁢eps
g1≔Quotient⁡g,d,x
g1≔182.428067982309⁢x8−2.19177590934416×10−7⁢x7−210.932454886683⁢x6+530.181566323192⁢x5+330.650841497779⁢x4−0.000159454935234903⁢x3+513.078143359541⁢x2−0.00399010296101806⁢x+302.126536415563
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