numapprox - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Numerical Computations : Approximations : numapprox Package : numapprox/hornerform

numapprox

  

hornerform

  

convert a polynomial to Horner form

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

hornerform(r)

hornerform(r, x)

Parameters

r

-

procedure or expression representing a polynomial or rational function

x

-

(optional) variable name appearing in r, if r is an expression

Description

• 

This procedure converts a given polynomial r into Horner form, also known as nested multiplication form. This is a form which minimizes the number of arithmetic operations required to evaluate the polynomial.

• 

If r is a rational function (i.e. a quotient of polynomials) then the numerator and denominator are each converted into Horner form.

• 

If the second argument x is present then the first argument must be a polynomial (or rational expression) in the variable x. If the second argument is omitted then either r is an operator such that ry yields a polynomial (or rational expression) in y, or else r is an expression with exactly one indeterminate (determined via indets).

• 

Note that for the purpose of evaluating a polynomial efficiently, the Horner form minimizes the number of arithmetic operations for a general polynomial. Specifically, the cost of evaluating a polynomial of degree n in Horner form is: n multiplications and n additions.

• 

The command with(numapprox,hornerform) allows the use of the abbreviated form of this command.

Examples

withnumapprox:

ft→at4+bt3+ct2+dt+e

f:=t→at4+bt3+ct2+dt+e

(1)

hornerformf

t→e+d+c+at+bttt

(2)

staylorⅇx,x

s:=1+x+12x2+16x3+124x4+1120x5+Ox6

(3)

hornerforms

1+1+12+16+124+1120xxxxx

(4)

rpadeⅇax,x,3,3

r:=a3x3+12a2x2+60ax+120a3x3+12a2x260ax+120

(5)

hornerformr,x

120+60a+a3x+12a2xx120+60a+a3x+12a2xx

(6)

See Also

convert[horner]

numapprox[confracform]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam