Let s be a power series known to N = m + n + 1 terms. An [m/n] Padé
approximant of s is a pair of polynomials p of degree at most m and
q ≠ 0 of degree at most n with q s ≡ p modulo xᴺ. One always exists:
the congruence is N linear equations in the N + 1 coefficients of p and
q. The extended Euclidean algorithm applied to xᴺ and s finds one. Each
remainder it produces has the form u xᴺ + v s, so v s is congruent to the
remainder modulo xᴺ, and the first remainder of degree at most m gives
p and q = v. Hex.DensePoly.padeHomogeneous stops the half-gcd
algorithm at that remainder, and returns a
Hex.DensePoly.PadeApproximant, which carries proofs of the degree
bounds, of q ≠ 0 and of the congruence:
A homogeneous Padé approximant of numerator degree at most m and
denominator degree at most n. A nonzero denominator is stronger than the
nontrivial-pair condition and is what the half-gcd construction supplies.
The denominator times the input agrees with the numerator to the required order.
The pair need not have q(0) ≠ 0. When it does, q is invertible as a
power series and s ≡ p / q modulo xᴺ; this is the approximation of the
introduction. Hex.DensePoly.pade? scales the denominator to have constant term 1,
as in the introduction, and returns a Hex.DensePoly.NormalizedPade:
For the series x and m = 0, n = 1, the congruence q x ≡ p modulo x²
forces p = 0 and q to be a multiple of x. There is no approximant with
q(0) = 1, and pade? returns none. The homogeneous approximant is
p = 0, q = -x: