EvaluatePolynomial - Maple Help

RealBox

 EvaluatePolynomial
 evaluate a univariate polynomial at a RealBox object

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

Parameters

 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

Description

 • 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.

Examples

Consider the polynomial $49{x}^{4}-188{x}^{2}+72x+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.

 > $\mathrm{poly}≔292+72x-188{x}^{2}+49{x}^{4}$
 ${\mathrm{poly}}{≔}{49}{}{{x}}^{{4}}{-}{188}{}{{x}}^{{2}}{+}{72}{}{x}{+}{292}$ (1)
 > $\mathrm{rb}≔\mathrm{RealBox}\left(-1.47,0.01\right)$
 ${\mathrm{rb}}{≔}{⟨}{\text{RealBox:}}{-1.47}{±}{0.01}{⟩}$ (2)
 > $\mathrm{eval}\left(\mathrm{poly},x=\mathrm{rb}\right)$
 ${⟨}{\text{RealBox:}}{8.71575}{±}{12.5558}{⟩}$ (3)

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

 > $\mathrm{poly_horner}≔\mathrm{convert}\left(\mathrm{poly},'\mathrm{horner}'\right)$
 ${\mathrm{poly_horner}}{≔}{292}{+}\left({72}{+}\left({49}{}{{x}}^{{2}}{-}{188}\right){}{x}\right){}{x}$ (4)
 > $\mathrm{eval}\left(\mathrm{poly_horner},x=\mathrm{rb}\right)$
 ${⟨}{\text{RealBox:}}{8.71575}{±}{6.30864}{⟩}$ (5)

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.

 > $\mathrm{plot}\left(\mathrm{poly},x=-1.48..-1.46\right)$
 > $\mathrm{Optimization}:-\mathrm{Minimize}\left(\mathrm{poly},x=-1.48..-1.46\right)$
 $\left[{8.71324004901427}{,}\left[{x}{=}{-1.47236599608282}\right]\right]$ (6)
 > $\mathrm{eval}\left(\mathrm{poly},x=-1.46\right)$
 ${8.7814094}$ (7)

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.

 > $\mathrm{EvaluatePolynomial}\left(\mathrm{rb},\mathrm{PolynomialTools}:-\mathrm{CoefficientList}\left(\mathrm{poly},x\right)\right)$
 ${⟨}{\text{RealBox:}}{8.71575}{±}{0.0662341}{⟩}$ (8)

Compatibility

 • The RealBox:-EvaluatePolynomial command was introduced in Maple 2023.