Navigation

Operators and Keywords

Function List:

C++ API

: q = polygcd (b, a)
: q = polygcd (b, a, tol)

Find the greatest common divisor of two polynomials.

This is equivalent to the polynomial found by multiplying together all the common roots. Together with deconv, you can reduce a ratio of two polynomials.

The tolerance tol defaults to sqrt (eps).

Caution: This is a numerically unstable algorithm and should not be used on large polynomials.

Example code:

polygcd (poly (1:8), poly (3:12)) - poly (3:8)
⇒ [ 0, 0, 0, 0, 0, 0, 0 ]
deconv (poly (1:8), polygcd (poly (1:8), poly (3:12))) - poly (1:2)
⇒ [ 0, 0, 0 ]

See also: poly, roots, conv, deconv, residue.

Package: octave