convert/mathorner - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Conversion : convert/mathorner

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

p567x5+22x455x394x2+87x

p7x5+22x455x394x2+87x56

(1)

AMatrix1,3,4,7

A1−347

(2)

convertp,mathorner

56+87+94+55+227x&*x&*x&*x&*x

(3)

subsx=A,

56+87+94+55+2271−347&*1−347&*1−347&*1−347&*1−347

(4)

`&*`=`.`|`&*`=`.`

1471712681−16908−10645

(5)

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

1471712681−16908−10645

(6)

Ppx=%A|px=%A

P7?5+22?455?394?2+87?56

(7)

convertP,mathorner,%A`&*`=`.`|convertP,mathorner,%A`&*`=`.`

56+87+94+55+227?·?·?·?·?

(8)

value

1471712681−16908−10645

(9)

See Also

convert

convert[horner]