The Nearest Polynomial With A Given Zero

ACM SIGSAM Bulletin, Vol. 39, No. 3, September 2005
Timely Communications
The Nearest Polynomial With A Given Zero, Revisited
Nargol Rezvani and Robert M. Corless
Ontario Research Centre for Computer Algebra
and The Department of Applied mathematics
The University of Western Ontario
London, Canada
Abstract
In his 1999 S IGSAM B ULLETIN paper [7], H. J. Stetter gave an explicit formula for finding the nearest polynomial with a
given zero. This present paper revisits the issue, correcting a minor omission from Stetter’s formula and explicitly extending
the results to different polynomial bases.
Experiments with our implementation demonstrate that the formula may not after all, fully solve the problem, and we
discuss some outstanding issues: first, that the nearest polynomial with the given zero may be identically zero (which might be
surprising), and, second, that the problem of finding the nearest polynomial of the same degree with a given zero may not, in
fact, have a solution. A third variant of the problem, namely to find the nearest monic polynomial (given a monic polynomial
initially) with a given zero, a problem that makes sense in some polynomial bases but not others, can also be solved with
Stetter’s formula, and this may be more satisfactory in some circumstances. This last can be generalized to the case where some
coefficients are intrinsic and not to be changed, whereas others are empiric and may safely be changed. Of course, this minor
generalization is implicit in [7]; This paper simply makes it explicit.
1
Introduction
Given a pair of polynomials f and g, the problem of finding the smallest perturbations ∆ f and ∆g such that f + ∆ f and g + ∆g
have a nontrivial GCD has been well-studied since [1].
Here we look at a related but much simpler problem, which was discussed in [7]. Earlier papers discussing special cases of
the result include [1], [3] and [2]. We state the problem in four forms. We suppose that we are given f ∈ P where
P∼
= Cn+1 [x] = span{φ0 (x), φ1 (x), . . . , φn (x)}
where the φk (x) form a basis for the set of polynomials with complex coefficients of degree less than n + 1. We also suppose
that we are given a metric d : P × P −→ R+ ∪ {0} measuring the distance between polynomials, and given a complex number r
that is the desired zero.
• Problem A. Find f˜ ∈ P with f˜(r) = 0 and d( f , f˜) minimal.
• Problem B. Find f˜ as above but also insist that deg( f ) = deg( f˜).
• Problem C. Given a monic f (in a basis for which this makes sense), find monic f˜ as above.
• Problem D. Given a polynomial with some intrinsic (i.e. fixed) coefficients, and some empiric (i.e. contaminated by data
error) coefficients, find the nearest f˜ with the same intrinsic coefficients and f˜(r) = 0. For example, sparse polynomials
fit into this category: the intrinsic coefficients are the zero coefficients.
The solution to Problem A was given in a lecture by E. Kaltofen in August 1999, based on work by M. Hitz. It was further
studied in [7] in the case φk (x) = xk , the monomial basis, and d( f1 , f2 ) = k f1 − f2 kq , the q-norm of the vector of coefficients,
v, of the difference between f1 and f2 :
½
(∑nk=0 |vk |q )1/q if 1 ≤ q < ∞
kvkq =
(1)
max0≤k≤n |vk | if q = ∞
73
The Nearest Polynomial With A Given Zero, Revisited
Timely Communications
The notion of the dual norm,
kvk∗ := max
u6=0
|v · u|
= max |v · u|
kuk
kuk=1
was used to great advantage in that paper, in a classical way. As is well-known, the dual norm of the q-norm is:

kvk∞
if q = 1

kvkq/(q−1) if 1 < q < ∞
kvk∗q =

kvk1
if q = ∞
a fact written shorthand as
where
1
p
(2)
(3)
kvk∗q = kvk p
+ 1q = 1.
2 Hölder’s inequality
This duality is a consequence of Hölder’s inequality and its converse. See e.g. [6, p. 135] for an excellent discussion including
historical material; we take the statement of the complex-valued version of this inequality from p. 149, and from the solution of
problem 9.5 on p. 262:
¯ Ã
¯
!1/q
!1/p Ã
¯
¯ n
n
n
¯
¯
q
p
¯ ∑ ak bk ¯ ≤ ∑ |ak |
∑ |bk |
¯
¯k=0
k=0
k=0
with equality if and only if there exist constants λ and C such that
λ|ak |1/q = |bk |1/p
(note there is a typographical erroneous interchange of p and q in [6, p. 262]) and
arg ak bk = C
whenever this argument is defined (i.e. when both of ak and bk are nonzero).
The converse of this inequality states that if there exists K such that
¯
¯
¯ n
¯
¯
¯
¯ ∑ ak bk ¯ ≤ Kkbk p
¯k=0
¯
for all b, then kakq ≤ K. Together these imply the statement of duality above, which will prove useful below. The witness
vector for equality (that occurs when λ|ak |1/q = |bk |1/p , together with the condition on the argument) will provide the vector of
coefficients for our globally nearest polynomial, as we will detail below.
3 Correction to Propositions 1 and 2
Proposition 1 and 2 of [7] omit a specialization necessary if q < 2 and any |vk | = 0, and we correct this below. We discovered this
omission only after implementing the formulae of those propositions. Further, the proofs conceal a subtlety that distinguishes
problem A from B, and we explore this at length. Finally, this theory does not cover all metrics in use. For example, Victor
Pan’s theory of approximate GCD by matching roots [5], uses a complicated metric that in our context becomes
d( f1 , f2 ) = minimax |ri − ρ j |
where the ri are the roots of f1 , the ρ j are the roots of f2 , and we first find the “best match” between all ri and ρ j so that the
maximum distance between roots is minimized.
The theory of this paper needs a norm, not just a metric. [But note that the nearest polynomial with a given zero is easily
solved in Victor Pan’s metric: replace rk with r, where |rk − r| is minimum.]
We now state and prove the “Revised Proposition”.
74
Nargol Rezvani and Robert M. Corless
Proposition 1 If 1 ≤ p < ∞ and u is such that kuk p = 1, define v so that
½
γ|uk | p−2 ūk if uk 6= 0
vk =
0
if uk = 0
where γ is an arbitrary constant with |γ| = 1.
If p = ∞, take instead
½
0
γūk0
vk =
(4)
if k 6= k0
if k = k0
(5)
where k0 is any, say the least, index with |uk0 | = 1; there must be at least one such, because kuk∞ = 1. [The ambiguity if there
are more than one such k0 was not discussed in [7].] Then
kvk∗ = kvkq = 1
and v · u = γ so |v · u| = 1.
Remark: The last condition in formula (4) corrects the omission in [7]. If 1 < p < 2 and uk = 0, then without this additional
case a division by zero occurs.
Proof. If p = ∞, then
kvkq = kvk1 = |γuk0 | = 1
and
v · u = γūk0 uk0 = γ|uk0 |2 = γ .
If p = 1 then |vk | = 1 if uk 6= 0 and |vk | = 0 if uk = 0, and hence
1 = max |vk | := kvk∞ = kvk∗1 .
0≤k≤n
As is true also in the 1 < p < ∞ case,
n
v·u =
∑
n
γ|uk | p−2 ūk uk =
k=0,uk 6=0
n
γ|uk | p = γ
∑
k=0,uk 6=0
∑
|uk | p = γkuk pp = γ
k=0,uk 6=0
Finally, in the 1 < p < ∞ case, we need to show kvkq = 1, but this is an easy calculation:
Ã
kvkq
!1/q
n
q
∑ |vk |
=
k=0
Ã
¯
¯
¯ γ |uk | p−2 ūk ¯q
n
∑
=
!1/q
k=0,uk 6=0
Ã
!1/q
n
∑
=
(|uk |
k=0,uk 6=0
Ã
=
n
∑ |uk |
p−1 p/(p−1)
)
!q
p
k=0
because zero terms do not contribute to the last sum, and therefore,
kvkq = (kuk pp )1/q = 11/q = 1 .
75
—\
The Nearest Polynomial With A Given Zero, Revisited
Timely Communications
4 Solution of Problem A
We now give the details of the solution of Problem A. This presentation fills in some details from [7] but is otherwise identical.
Take
u = µΦ := µ[φ0 (r), φ1 (r), . . . , φn (r)] ,
where µ = 1/kφ(r)k p , so kuk p = 1. Remember, r is our desired polynomial zero. If f (r) = 0, then we are done already and the
(r)
answer is just f itself. Assume now that f (r) 6= 0. Note that f (r) may be complex. Choose γ = −signum( f (r)) = − | ff (r)|
. We
suppose
n
f (x) =
∑ ak φk (x)
k=0
and the ak ∈ C are known. From this u, compute v by the revised proposition. Now put
∆a = µ| f (r)|v.
We claim that
(a + ∆a) · Φ(r) = 0
and that, if
(a + b) · Φ(r) = 0 ,
then
kbkq ≥ k∆akq .
The proof of this is simple, but we include it for clarity.
∆a · Φ(r) = µ| f (r)|v · Φ(r) = | f (r)|v · u = | f (r)|γ = − f (r) = −a · Φ(r)
establishing the first part, and
kbkq = max |b · w| ≥ |b · w|
kwk=1
for any unit vector w, and in particular for w = u. Therefore kbkq ≥ |b · u|, but this is |∆a · u| by hypothesis, and this is k∆akq
by construction. Hence kbkq ≥ k∆akq .
—\
This gives a complete and detailed recipe for solving problem A. This may not solve problem B, because nowhere have we
enforced (for example) ∆an 6= −an , if φk (x) is a degree-graded basis. We will see examples where the degree does, in fact, drop.
Remarks: The ambiguity of more than one k0 with uk0 = 1 was not discussed in [7] and here leads to possibly multiple
solutions. Again, we will see an example.
5 Examples
We give some examples of the solution of Problem A in different bases.
5.1 A Monomial Basis Example
Let f (x) = 1 + x + x2 , and r = 1/2. Then our routine NPGZ (for Nearest Polynomial with a Given Zero) gives the results in
Table 1.
5.2 A Lagrange Basis Example
Let f be the polynomial taking on the values [−1, 1, −1, 1] at the four equally spaced nodes x = [−1, −1/3, 1/3, 1]. We ask for
the polynomial with a zero at x = 1/2 that has values at these nodes that differ as little as possible from the given values. That
is, we choose as basis for the polynomials of degree three the Lagrange basis on these distinct nodes, and apply the algorithm
of this paper. The results are printed in Table 2.
5.3
A Chebyshev Basis Example
Let f = T0 (x) + T1 (x) + T2 (x) + T3 (x) and r = −1/2. The routine NPGZ gives us Table 3. Since r = 1/2 is already a root of f ,
we use instead r = −1/2, which is different from the previous examples, in order that the results be nontrivial.
76
Nargol Rezvani and Robert M. Corless
Table 1: Nearest polynomials to 1 + x + x2 with a zero at x = 1/2, in different norms. For each polynomial,
we report k∆ f kk for k = 1, k = 2, and k = ∞, to allow a simple comparison of q-norm changes to other
polynomials with a zero at x = 1/2. The diagonal entries should be the smallest in each column.
f˜
q
1
−3/4 + x + x2
2 −1/3 + 1/3 x + 2/3 x2
∞
0
k∆ f k1
7/4
7/3
3
k∆ f k2
√7/4
21/3
√
3
k∆ f k∞
7/4
4/3
1
Table 2: Values of the nearest polynomials to f with f = [−1, 1, −1, 1] at x = [−1, −1/3, 1/3, 1] with a zero
at x = 1/2, in different norms. For each polynomial, we report k∆ f kk for k = 1, k = 2, and k = ∞, to allow
a simple comparison of q-norm changes to other polynomials with a zero at x = 1/2. The diagonal entries
should be the smallest in each column.
q
f˜
1
[−1, 1, 17/135, 1]
2 [−4611, 3775, 329, 5371]/4801
[−15, 15, −15, 167]/91
∞
5.4
k∆ f k1
k∆ f k2
k∆ f k∞
1.1259 . . . 1.1259 . . . 1.1259 . . .
1.3218 . . . 1.0904 . . . 1.0685 . . .
2.505 . . . 1.4465 . . . 0.83516 . . .
A Bernstein Basis Example
Let f = B50 (x) + B51 (x) + B52 (x) + B53 (x) + B54 (x) + B55 (x) and r = −1/2. The routine NPGZ gives us Table 3. Here Bnk (x) =
Ckn (1 − x)n−k xk are the unscaled Bernstein basis polynomials of degree n on [0, 1], and Ckn is the binomial coefficient. If we
used r = 1/2, and the scaled Bernstein polynomials (i.e. absorb the Ckn into the coefficients), NPGZ leads us to f˜ = 0, in all
norms except the q = 1 norm, where the difference between f (x) and −5B50 (x) + B51 (x) + B52 (x) + B53 (x) + B54 (x) + B55 (x) is 6 in
the 1-norm, which is exactly the same as the 1-norm distance to the zero polynomial. This is an example of multiple solutions
of minimal distance. This shows by example that such nongeneric behaviour can indeed occur; this example was found by
accident and not contrived.
More typically, Table 4 shows the results for r = −1/2.
5.5
An Example with a Multiple Root
In this example we will consider a polynomial which has simple roots that are symmetric with respect to the origin. If we
then insist that our polynomial have a root at the origin, it turns out that by virtue of symmetry, all roots are moved to the
origin, which is the center of symmetry of the roots. This generates a multiple root in the new polynomial. To be concrete, let
f = x4 − 1 and r = 0. We find that the nearest polynomial with a root at x = 0 is x4 , in all norms; in all norms, the distance is 1.
6
The algorithm does not solve Problem B
Already in Table 1 we see that the final row has f˜ = 0, the zero polynomial. This result is correct: the zero polynomial is the
polynomial in P nearest to 1 + x + x2 that is zero at x = 1/2.
Moreover, by directly examining all possible degree two candidates g(x) = c(x − r)(x − 1/2) (they are degree two exactly
when c 6= 0) we see that the (nonlinear in this formulation) minimization problem we have to solve is
min k∆ f k∞ = minimax [|c − 1|, |1 + cr + c/2|, |cr/2 − 1|]
and that this minimum is achieved if and only if c = 0 (which of course is to be expected from the solution of Problem A). This
implies that by taking c arbitrarily small, and choosing r arbitrarily finite (say r = 0), then we can approach the minimum norm
of the perturbation (k∆ f k∞ = 1) arbitrarily closely.
Therefore Problem B may not have a solution. Our given algorithm will return a solution for Problem B in the usual (lucky)
case; but there is no guarantee.
77
The Nearest Polynomial With A Given Zero, Revisited
Timely Communications
Table 3: Nearest polynomials to T0 (x)+T1 (x)+T2 (x)+T3 (x) of degree 3 with a zero at x = −1/2, in different
norms. For each polynomial, we report k∆ f kk for k = 1, k = 2, and k = ∞, to allow a simple comparison of
q-norm changes to other polynomials with a zero at x = −1/2. The diagonal entries should be the smallest in
each column.
q
1
2
∞
f˜
k∆ f k1
k∆ f k2
k∆ f k∞
T1 (x) + T2 (x) + T3 (x)
1
1
1
3
6
6
3
1.200
.
.
.
0.6324
.
.
.
0.4000
...
T
(x)
+
T
(x)
+
T
(x)
+
T
(x)
0
1
2
3
5
5
5
5
2
4
4
2
1.333
.
.
.
0.6666
.
.
.
0.3333
...
T
(x)
+
T
(x)
+
T
(x)
+
T
(x)
0
1
2
3
3
3
3
3
Table 4: Nearest polynomials to f (x) = B50 (x) + B51 (x) + B52 (x) + B53 (x) + B54 (x) + B55 (x) with a zero at
x = −1/2, in different norms. For each polynomial, we report k∆ f kk for k = 1, k = 2, and k = ∞, to allow
a simple comparison of q-norm changes to other polynomials with a zero at x = −1/2. The diagonal entries
should be the smallest in each column. To save space we report only the vector of coefficients for f˜.
q
1
2
∞
7
k∆ f k1
k∆ f k2
k∆ f k∞
f˜
[1, 437/405, 1, 1, 1, 1]
0.0790 . . . 0.0790 . . . 0.0790 . . .
[.974, 1.04, .972, 1.01, .998, 1.00] 0.1076 . . . 0.0580 . . . 0.0425 . . .
[31, 33, 31, 33, 31]/32
0.1875 . . . 0.0765 . . . 0.0312 . . .
Solution of Problem C
Problem C, however, can be solved. If we start with a monic polynomial, and insist that no change be allowed to the leading
coefficient, then because the problem is still linear in the remaining coefficients, the same argument that we have carried out
above gives the same answer, with the only change needed being
u = µ [φ0 (r), φ1 (r), . . . , φn−1 (r)]
omitting the final basis entry (and modifying µ so that kuk p = 1, as before).
For the example above, 1 + x + x2 , the nearest monic polynomial with a zero at x = 1/2 is x2 − x/6 − 1/6, which is distance
7/6 away from the original polynomial; the zero polynomial is closer, but disallowed.
8
Solution of Problem D
The same analysis as for Problems A and C works, here. So long as the empiric coefficients appear linearly, we may find a
globally nearest (or possibly more than one globally nearest) polynomial with the same intrinsic coefficients—usually zero,
in the sparse polynomial case—that has the desired given zero. Writing a general-purpose code to handle an intrinsic/empiric
distinction in all possible different bases is perhaps more ‘heavy’ than is warranted, but we have done this anyway. In any given
case, it is relatively easy to apply the algorithm of this paper in a ‘one-off’ fashion.
For example, consider the sparse polynomial f (x) = 1 + 5x − 2x30 , in the monomial basis, with q = 2 and r = 1/2. Applying
NPGZ, we compute a polynomial containing 31 nonzero coefficients that is approximately 2-norm distance 3.03 from f (x).
If we insist on sparsity, we find a polynomial very close to −9/5 + 18/5x − 2x30 (within 3.0 · 10−9 , but we use this simpler
polynomial for clarity) that has the minimum sparse 2-norm distance of approximately 3.1305, that has a zero at x = r = 1/2.
Notice that the minimum sparse distance is not much more than the minimum dense distance. Experimental exploration of the
distribution of just how much extra distance is needed in general, on average or in the worst case, would be interesting.
9
Concluding Remarks
This paper shows that there is something more of interest to this problem than was apparent when first the explicit solution
was given. It was a surprise to us (initially) that the nearest polynomial to the given polynomial might be identically zero. It
78
Nargol Rezvani and Robert M. Corless
was a surprise to us that insisting that the polynomial have the same degree makes the problem (in some cases) fail to have a
solution at all. Insisting that the initial polynomial be monic allows a solution, but potentially changes the problem (the metric
is different); and moreover this does not always make sense in the case of the Lagrange basis or the Bernstein basis. Finally,
we note that the ambiguity of the choice of k0 in the happenstance that more than one uk has unit magnitude allows for the
possibility of multiple optima, in the ∞-norm case.
The results of this paper are implicit in those of [7], and perhaps will not surprise the author of that paper. Moreover, the
difficulty with degree drops was noted in [3, Sec. 6.3]. However, we feel that a wider audience may benefit from seeing these
results made explicit.
As part of NR’s Master’s thesis, we now plan to implement (some of) the work of [4], using NPGZ as a step in the degree-1
case; and of course that paper also discusses the solution of the problem in different bases, and for constrained coefficients.
Acknowledgements
We thank E. Kaltofen for pointing out the references [3, 2], and his talk (no. 147 on http:// www4.ncsu.edu/ ekaltofen/ bibliography/ lectures/ lectures.html). Discussions with Dhavide Aruliah were very helpful. An early version of this paper was
presented as a poster at an ORCCA joint lab meeting, Friday September 9, 2005.
References
[1] Robert M. Corless, Patrizia M. Gianni, Barry M. Trager, and Stephen M. Watt. The Singular Value Decomposition for
polynomial systems. In A.H.M. Levelt, editor, International Symposium on Symbolic and Algebraic Computation, pages
195–207, Montréal, Canada, 1995. ACM.
[2] M. A. Hitz, E. Kaltofen, and Lakshman Y. N. Efficient algorithms for computing the nearest polynomial with a real root
and related problems. In S. Dooley, editor, Proc. 1999 Internat. Symp. Symbolic Algebraic Comput. (ISSAC’99), pages
205–212, New York, N. Y., 1999. ACM Press.
[3] Markus A. Hitz and Erich Kaltofen. Efficient algorithms for computing the nearest polynomial with constrained roots.
In Oliver Gloor, editor, International Symposium on Symbolic and Algebraic Computation, pages 236–243, Rostock, Germany, 1998. ACM.
[4] N. K. Karmarkar and Lakshman Y. N. On approximate GCDs of univariate polynomials. Journal of Symbolic Computation,
26(6):653–666, 1998. Special issue of the JSC on Symbolic Numeric Algebra for Polynomials S. M. Watt and H. J. Stetter,
editors.
[5] Victor Y. Pan. Approximate polynomial Gcds, Padé approximation, polynomial zeros and bipartite graphs. In Proceedings of the ninth annual ACM-SIAM symposium on Discrete algorithms, pages 68–77. Society for Industrial and Applied
Mathematics, 1998.
[6] J. Michael Steele. The Cauchy-Schwartz Master Class. Cambridge University Press, Cambridge, 2004.
[7] Hans J. Stetter. The nearest polynomial with a given zero, and similar problems. S IGSAM B ULLETIN, 33(4):2–4, 1999.
79