QRGCD - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


SNAP

  

QRGCD

  

compute GCD for a pair of univariate numeric polynomials by using QR factoring

 

Calling Sequence

Parameters

Description

Examples

References

Calling Sequence

QRGCD(f, g, x, eps)

Parameters

f, g

-

univariate numeric polynomials

x

-

name; indeterminate for f and g

eps

-

type numeric and non-negative; stability parameter

Description

• 

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).

Examples

> 

with⁡SNAP&colon;

> 

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

(1)
> 

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

(2)
> 

eps≔1.0⁢10−4

eps≔0.0001000000000

(3)
> 

u,v,d≔QRGCD⁡f&comma;g&comma;x&comma;eps

u,v,d≔−0.00239210066773749+0.000685923025428401⁢x7−4.53097031259133×10−6⁢x6−0.00164801014632735⁢x5+0.00111190210893583⁢x4+0.00232049175102823⁢x3−0.000814821101997611⁢x2−0.00159767495032097⁢x,−0.000797538808884264−0.00120036529451162⁢x7−0.00177118364917765⁢x6+0.00150784758762042⁢x5+0.00376932816808507⁢x4+0.000171163088689713⁢x3−0.00139357959466413⁢x2+0.00145428191862992⁢x,−0.964763821204428⁢x+0.438529009807886+0.175411603893664⁢x2

(4)
> 

evalb⁡evalf⁡norm⁡expand⁡u⁢f+v⁢g−d&comma;2<evalf⁡max⁡norm⁡f&comma;2&comma;norm⁡g&comma;2&comma;norm⁡u&comma;2&comma;norm⁡v&comma;2&comma;norm⁡d&comma;2⁢eps

true

(5)
> 

f1≔Quotient⁡f&comma;d&comma;x

f1≔319.249118969049⁢x8+473.172800945610⁢x7−2.81194595280338×10−6⁢x6−0.0000147057886330958⁢x5+518.779744472732⁢x4−0.000370044593017768⁢x3−524.482546282526⁢x2+530.172318731588⁢x−518.826087788793

(6)
> 

evalb⁡evalf⁡norm⁡expand⁡f−f1⁢d&comma;2<evalf⁡norm⁡f&comma;2⁢eps

true

(7)
> 

g1≔Quotient⁡g&comma;d&comma;x

g1≔182.428067982314⁢x8−2.19151327159655×10−7⁢x7−210.932454886558⁢x6+530.181566323828⁢x5+330.650841500969⁢x4−0.000159438983892106⁢x3+513.078143439310⁢x2−0.00398970411187071⁢x+302.126538409815

(8)
> 

evalb⁡evalf⁡norm⁡expand⁡g−g1⁢d&comma;2<evalf⁡norm⁡g&comma;2⁢eps

true

(9)

References

  

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]