Algorithm Search⌘K

Proofs: Graeffe's method

These are the human proofs of Graeffe's method, at full length.

Correctness of Graeffe's method full

This proof shows: correctness, termination, convergence-rate.

Let p(x)=a0xn+⋯+an=a0∏i=1n(x−ri)p(x) = a_0x^n + \cdots + a_n = a_0\prod_{i=1}^n(x - r_i) with real aja_j, a0≠0a_0 \ne 0, an≠0a_n \ne 0 (after line L1) and ∣r1∣≥⋯≥∣rn∣>0|r_1| \ge \cdots \ge |r_n| > 0. Statements are in exact arithmetic; the remark at the end discusses rounding.

Lemma 1 (the squaring step)

If bb are the coefficients of a polynomial P(x)=b0∏(x−ρi)P(x) = b_0\prod(x - \rho_i) of degree nn, the coefficients cc of line L4 are those of Q(y)=b02∏(y−ρi2)Q(y) = b_0^2\prod(y - \rho_i^2).

Proof. P(−x)=b0∏(−x−ρi)=(−1)nb0∏(x+ρi)P(-x) = b_0\prod(-x - \rho_i) = (-1)^nb_0\prod(x + \rho_i), so (−1)nP(x)P(−x)=b02∏(x2−ρi2)=Q(x2)(-1)^nP(x)P(-x) = b_0^2\prod(x^2 - \rho_i^2) = Q(x^2). Write P(x)=∑jbjxn−jP(x) = \sum_j b_jx^{n-j} and P(−x)=∑l(−1)n−lblxn−lP(-x) = \sum_l (-1)^{n-l}b_lx^{n-l}. The coefficient of x2n−2jx^{2n-2j} in (−1)nP(x)P(−x)(-1)^nP(x)P(-x) is ∑s+l=2j(−1)lbsbl\sum_{s + l = 2j}(-1)^{l}b_sb_l. Pairing the term (s,l)=(j−i,j+i)(s, l) = (j - i, j + i) with (j+i,j−i)(j + i, j - i) for each i≥1i \ge 1 gives (−1)j(bj2+2∑i≥1(−1)ibj−ibj+i)(-1)^j\bigl(b_j^2 + 2\sum_{i \ge 1}(-1)^ib_{j-i}b_{j+i}\bigr), since (−1)j+i=(−1)j−i(-1)^{j+i} = (-1)^{j-i}. Odd powers of xx cancel because the product is even. □\square

By induction, after kk steps the coefficients are those of a0N∏(y−riN)a_0^{N}\prod(y - r_i^N) with N=2kN = 2^k. By Vieta, bj=(−1)ja0Nej(r1N,…,rnN)b_j = (-1)^ja_0^Ne_j(r_1^N, \dots, r_n^N), where eje_j is the jj-th elementary symmetric function and e0=1e_0 = 1.

Lemma 2 (regular indices)

Fix jj with 1≤j≤n−11 \le j \le n - 1 and ∣rj∣>∣rj+1∣|r_j| > |r_{j+1}|, and let λj=∣rj+1/rj∣<1\lambda_j = |r_{j+1}/r_j| < 1. Then

ej(r1N,…,rnN)=(r1⋯rj)N(1+ηj),∣ηj∣≤((nj)−1)λjN.e_j(r_1^N, \dots, r_n^N) = (r_1 \cdots r_j)^N(1 + \eta_j), \qquad |\eta_j| \le \Bigl(\binom{n}{j} - 1\Bigr)\lambda_j^N.

The same holds trivially with ηj=0\eta_j = 0 for j=0j = 0 and j=nj = n.

Proof. eje_j is the sum over jj-element subsets SS of ∏i∈SriN\prod_{i \in S}r_i^N. Any S≠{1,…,j}S \ne \{1, \dots, j\} contains some t>jt > j and misses some s≤js \le j. Then ∏S∣ri∣≤∣r1⋯rj∣⋅∣rt/rs∣≤∣r1⋯rj∣λj\prod_{S}|r_i| \le |r_1 \cdots r_j| \cdot |r_t/r_s| \le |r_1 \cdots r_j|\lambda_j, because the moduli are ordered: swap the indices one at a time and each swap does not increase the product. There are (nj)−1\binom{n}{j} - 1 such subsets. □\square

Theorem 1 (the moduli)

Let 0=j0<j1<⋯<jt=n0 = j_0 < j_1 < \cdots < j_t = n be the indices jj with ∣rj∣>∣rj+1∣|r_j| > |r_{j+1}|, together with 0 and nn. For consecutive i=js−1i = j_{s-1}, l=jsl = j_s, the roots ri+1,…,rlr_{i+1}, \dots, r_l have one common modulus ρ\rho, and

∣blbi∣1/(N(l−i))=ρ ∣1+ηl1+ηi∣1/(N(l−i))=ρ(1+O(λN/N)),\Bigl|\frac{b_l}{b_i}\Bigr|^{1/(N(l - i))} = \rho\,\Bigl|\frac{1 + \eta_l}{1 + \eta_i}\Bigr|^{1/(N(l - i))} = \rho\Bigl(1 + O\bigl(\lambda^N/N\bigr)\Bigr),

with λ=max⁡sλjs<1\lambda = \max_s\lambda_{j_s} < 1. So the formula of L10 converges to the common modulus, and the relative error decreases like λ2k/2k\lambda^{2^k}/2^k.

Proof. By Lemma 1, ∣bl/bi∣=∣el/ei∣|b_l/b_i| = |e_l/e_i|, and by Lemma 2, ∣el/ei∣=∣ri+1⋯rl∣N∣1+ηl∣/∣1+ηi∣=ρN(l−i)∣1+ηl∣/∣1+ηi∣|e_l/e_i| = |r_{i+1}\cdots r_l|^N|1 + \eta_l|/|1 + \eta_i| = \rho^{N(l - i)}|1 + \eta_l|/|1 + \eta_i|. Since ∣η∣=O(λN)|\eta| = O(\lambda^N), the N(l−i)N(l - i)-th root of the last factor is 1+O(λN/N)1 + O(\lambda^N/N). □\square

Theorem 2 (the deviations and the order)

At a regular index jj (one of the jsj_s), with ηj(k)\eta_j^{(k)} the remainder after kk steps,

(−1)jcjbj2=1+ηj(k+1)(1+ηj(k))2,dj(k)=∣2ηj(k)∣+O(λ2N).(-1)^j\frac{c_j}{b_j^2} = \frac{1 + \eta_j^{(k+1)}}{(1 + \eta_j^{(k)})^2}, \qquad d_j^{(k)} = \bigl|2\eta_j^{(k)}\bigr| + O(\lambda^{2N}).

If moreover ηj(k)=cλjN(1+o(1))\eta_j^{(k)} = c\lambda_j^N(1 + o(1)) for a constant c>0c > 0, which holds for instance when all roots are real, with cc the number of subsets SS attaining ∏S∣ri∣=λj∣r1⋯rj∣\prod_S|r_i| = \lambda_j|r_1\cdots r_j|, then d(k+1)≈(d(k))2/(2c)d^{(k+1)} \approx (d^{(k)})^2/(2c). So the deviations converge with order q=2q = 2 in the step number kk, and the moduli error of Theorem 1 is about d(k)/(2N)d^{(k)}/(2N).

At an index jj strictly inside a group, the deviation does not tend to 0. For the simplest case, a group that is a single complex pair ρe±iθ\rho e^{\pm i\theta}, 0<θ<π0 < \theta < \pi, sitting at positions j,j+1j, j + 1, the dominant part of eje_j is PNρN⋅2cos⁡(Nθ)P^N\rho^N\cdot 2\cos(N\theta), where PP is the product of the moduli above the pair. So asymptotically (−1)jcj/bj2→2cos⁡(2Nθ)/(4cos⁡2(Nθ))=1−1/(2cos⁡2(Nθ))(-1)^jc_j/b_j^2 \to 2\cos(2N\theta)/(4\cos^2(N\theta)) = 1 - 1/(2\cos^2(N\theta)), and dj≥1/2d_j \ge 1/2 in the limit. A real double root gives dj→1/2d_j \to 1/2. A pair ±r\pm r gives bj=0b_j = 0 exactly after one step, which L6 treats as irregular.

Proof. The first display follows from bj(k)=(−1)ja0N(r1⋯rj)N(1+ηj(k))b_j^{(k)} = (-1)^ja_0^N(r_1\cdots r_j)^N(1 + \eta_j^{(k)}) and Lemma 1, which gives cj=bj(k+1)c_j = b_j^{(k+1)}. Expanding (1+η′)/(1+η)2=1−2η+η′+O(η2)(1 + \eta')/(1 + \eta)^2 = 1 - 2\eta + \eta' + O(\eta^2) and using η′=O(λ2N)\eta' = O(\lambda^{2N}) gives the second. If η(k)≈cλN\eta^{(k)} \approx c\lambda^N, then η(k+1)≈cλ2N=(η(k))2/c\eta^{(k+1)} \approx c\lambda^{2N} = (\eta^{(k)})^2/c and d(k+1)≈2(η(k))2/c=(d(k))2/(2c)d^{(k+1)} \approx 2(\eta^{(k)})^2/c = (d^{(k)})^2/(2c). The pair computation is the same expansion with the two dominant subsets carrying the conjugate factors e±iNθe^{\pm iN\theta}. □\square

Termination and what the output means

Each pass of the loop L3 increases kk, so the loop ends after at most KK steps; L8 may end it earlier. If it ends with status "separated", every dj≤d_j \le tol. By Theorem 2 this happens for all large kk exactly when all the moduli are distinct, and then the error of each modulus is asymptotically at most about tol/2k+1/2^{k+1}. This bound is asymptotic, not a guaranteed bound at the stopping step. If the loop ends at the cap, the set RR of L9 contains 0, nn and the indices that look regular. When KK is large enough that λ2K≪\lambda^{2^K} \ll tol, these are exactly the jsj_s of Theorem 1, so the groups are the true groups of equal moduli. When it is not, two close moduli may be merged into one group, and the reported value is then the geometric mean of the moduli in the group, which is exact by the same formula with the merged indices. Line L11 is correct because the conjugate of a non-real root of a real polynomial is a root of the same modulus, so a modulus carried by one root belongs to a real root, which is ρ\rho or −ρ-\rho.

Rounding

The reference code stores the bjb_j as 40-digit decimals with an exponent range of about 101810^{18}, so nothing overflows for K≤30K \le 30 and moduli in the double range. At a regular index the computed cjc_j is dominated by bj2b_j^2, so each step adds a relative error of a few units of the 40-digit precision. After the NN-th root this error is divided by NN. The moduli are then those of the polynomial with the given floating point coefficients, to the accuracy observed in the tests (2×10−162 \times 10^{-16} relative on the Wilkinson polynomial of degree 20). Inside a group, cancellation can amplify the relative error of the irregular coefficients, but these coefficients are not used in L10. This rounding analysis is stated, not proved in detail.

Back to Graeffe's method