matrix Horner form - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


convert/mathorner

convert a polynomial to Matrix Horner form

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

convert( poly, mathorner )

convert( poly, mathorner, var )

Parameters

poly

-

polynomial

var

-

(optional) variable

Description

• 

convert/mathorner writes the polynomial poly in the name var in horner or ``nested'' form.

• 

If there is only one indeterminate in poly then it is not necessary to specify the third argument var.

• 

Horner form allows you to evaluate polynomials of Matrices in the most efficient manner. For a polynomial of degree n there will be n adds and n multiplications needed to evaluate the Horner form.

Examples

> 

p≔−56−7⁢x5+22⁢x4−55⁢x3−94⁢x2+87⁢x

p≔−7⁢x5+22⁢x4−55⁢x3−94⁢x2+87⁢x−56

(1)
> 

A≔Matrix⁡1,−3,4,7

A≔1−347

(2)
> 

convert⁡p,mathorner

−56+87+−94+−55+22−7⁢x&*x&*x&*x&*x

(3)
> 

subs⁡x=A,

−56+87+−94+−55+22−7⁢1−347&*1−347&*1−347&*1−347&*1−347

(4)
> 

eval⁡,`&*`=`.`

1471712681−16908−10645

(5)
> 

eval⁡,x=A,`&*`=`.`

1471712681−16908−10645

(6)
> 

P≔eval⁡p,x=%A

P≔−7⁢A5+22⁢A4−55⁢A3−94⁢A2+87⁢A−56

(7)
> 

eval⁡convert⁡P,mathorner,%A,`&*`=`.`

−56+87+−94+−55+22−7⁢A·A·A·A·A

(8)
> 

value⁡

1471712681−16908−10645

(9)

See Also

convert

convert[horner]