RealBox
EvaluatePolynomial
evaluate a univariate polynomial at a RealBox object
Calling Sequence
Parameters
Description
Examples
Compatibility
EvaluatePolynomial(a, [c0, c1, ..., cn])
EvaluatePolynomial(a, [c0, c1, ..., cn], precopt)
a
-
a RealBox object
c0, c1, ..., cn
real constants or RealBox objects
precopt
(optional) equation of the form precision = n, where n is a positive integer
The EvaluatePolynomial command evaluates a dense univariate polynomial at a RealBox 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 RealBox 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 RealBox object or a real constant.
Consider the polynomial 49⁢x4−188⁢x2+72⁢x+292. Evaluate it at the RealBox object with center −1.47 and radius 0.01. We first use simple evaluation using the regular arithmetic operators.
poly≔292+72⁢x−188⁢x2+49⁢x4
poly≔49⁢x4−188⁢x2+72⁢x+292
rb≔RealBox⁡−1.47,0.01
rb≔⟨RealBox: -1.47±0.01⟩
eval⁡poly,x=rb
⟨RealBox: 8.71575±12.5558⟩
The radius of the result is smaller if we first convert the polynomial to Horner form.
poly_horner≔convert⁡poly,horner
poly_horner≔292+72+49⁢x2−188⁢x⁢x
eval⁡poly_horner,x=rb
⟨RealBox: 8.71575±6.30864⟩
However, this is still a severe overestimation of the radius: the minimal value on this interval is about 8.713 and the maximal value of about 8.781 is achieved at x=−1.46. We verify these values numerically and graphically below.
plot⁡poly,x=−1.48..−1.46
Optimization:-Minimize⁡poly,x=−1.48..−1.46
8.71324004901427,x=−1.47236599608282
eval⁡poly,x=−1.46
8.7814094
So ideally we would like the result to have a center of about 8.747 and a radius of about 0.034. We don't quite achieve that with EvaluatePolynomial, but we get much closer than with the other options above.
EvaluatePolynomial⁡rb,PolynomialTools:-CoefficientList⁡poly,x
⟨RealBox: 8.71575±0.0662341⟩
The RealBox:-EvaluatePolynomial command was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
See Also
ComplexBox:-EvaluatePolynomial
Download Help Document