ComplexBox/EvaluatePolynomial - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : ComplexBox/EvaluatePolynomial

ComplexBox

  

EvaluatePolynomial

  

evaluate a univariate polynomial at a ComplexBox object

 

Calling Sequence

Parameters

Description

Compatibility

Calling Sequence

EvaluatePolynomial(a, [c0, c1, ..., cn])

EvaluatePolynomial(a, [c0, c1, ..., cn], precopt)

Parameters

a

-

a ComplexBox object

c0, c1, ..., cn

-

complex constants or ComplexBox objects

precopt

-

(optional) equation of the form precision = n, where n is a positive integer

Description

• 

The EvaluatePolynomial command evaluates a dense univariate polynomial at a ComplexBox object. It does this in a manner that sometimes produces a smaller radius than simple evaluation using the standard arithmetic operations.

• 

The first argument is a ComplexBox object, representing the value at which the polynomial is to be evaluated.

• 

The second argument is a list of n+1 coefficients of the polynomial to be evaluated, where n is the degree of the polynomial. The first entry is the constant coefficient, the second the linear coefficient, and so on. Each coefficient can be a ComplexBox object or a complex constant.

• 

Consider the polynomial 49x4188x2+72x+292. Evaluate it at the ComplexBox object with center −1.47 and radius 0.01 in the imaginary direction. We first use simple evaluation using the regular arithmetic operators.

poly := 292 + 72*x - 188*x^2 + 49*x^4;

poly49x4188x2+72x+292

(1)

cb := ComplexBox(RealBox(-1.47), RealBox(0, 0.01));

cbComplexBox: [-1.47 +/- 1.16415e-10]+[0 +/- 0.01]I

(2)

eval(poly, x = cb);

ComplexBox: [8.71575 +/- 0.0823313]+[0 +/- 12.4735]I

(3)
• 

The radius of the result is smaller if we first convert the polynomial to Horner form.

poly_horner := convert(poly, 'horner');

poly_horner292+72+49x2188xx

(4)

eval(poly_horner, x = cb);

ComplexBox: [8.71575 +/- 0.0611543]+[0 +/- 6.24749]I

(5)
• 

However, this is still a severe overestimation of the radius. We write x=1.47+Iε and expand poly as a polynomial in ε:

poly_eps := evalc(eval(poly, x = -1.47 + epsilon * I));

poly_eps8.7157517447.3046ε2+49ε4+I2.121492ε+288.12ε3

(6)
• 

We now plot the real and imaginary parts of the resulting polynomial as ε varies between −0.01 and 0.01.

poly_im, poly_re := selectremove(has, poly_eps, I);

poly_im,poly_reI2.121492ε+288.12ε3,8.7157517447.3046ε2+49ε4

(7)

plot(poly_re, epsilon=-0.01 .. 0.01);

plot(poly_im/I, epsilon=-0.01 .. 0.01);

• 

We see that the real part achieves its maximum at ε=0 and its minimum at ε=0.01, and the imaginary part achieves its maximum at ε=0.01 and its minimum at ε=−0.01.

eval(poly_re, epsilon=0), eval(poly_re, epsilon=0.01);

8.7157517,8.67102173

(8)

eval(poly_im/I, epsilon=0.01), eval(poly_im/I, epsilon=-0.01);

0.02150304,−0.02150304

(9)
• 

So ideally we would like the result to have a center of about 8.694, the real part should have a radius of about 0.023, and the imaginary part should have a radius of about 0.022. We don't quite achieve that with EvaluatePolynomial, but we get much closer than with the other options above.

EvaluatePolynomial(cb, PolynomialTools:-CoefficientList(poly, x));

ComplexBox: [8.71575 +/- 0.044731]+[0 +/- 0.021503]I

(10)

Compatibility

• 

The ComplexBox:-EvaluatePolynomial command was introduced in Maple 2024.

• 

For more information on Maple 2024 changes, see Updates in Maple 2024.

See Also

RealBox:-EvaluatePolynomial