Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Horner Calculator

Horner

Function: horner (<expr>, <x>)

Function: horner (<expr>) Returns a rearranged representation of <expr> as in Horners rule, using <x> as the main variable if it is specified. x may be omitted in which case the main variable of the canonical rational expression form of <expr> is used.

horner sometimes improves stability if expr is to be numerically evaluated. It is also useful if Maxima is used to generate programs to be run in Fortran. See also stringout.

          (%i1) expr: 1e-155*x^2 - 5.5*x + 5.2e155;
                                     2
          (%o1)            1.0E-155 x  - 5.5 x + 5.2E+155
          (%i2) expr2: horner (%, x), keepfloat: true;
          (%o2)            (1.0E-155 x - 5.5) x + 5.2E+155
          (%i3) ev (expr, x=1e155);
          Maxima encountered a Lisp error:

floating point overflow

Automatically continuing. To reenable the Lisp debugger set *debugger-hook* to nil.

          (%i4) ev (expr2, x=1e155);
          (%o4)                       7.0E+154

(%o1)                                true
(%i2) 

Horner Example

Related Examples

horner-keepfloat-true

expr: x^2 + 1;

expr2: horner (%, x)...

Calculate

horner-keepfloat-true

expr: 1e-155*x^2 - 5....

expr2: horner (%, x)...

Calculate

horner-keepfloat-true

expr: x^2 + 1;

expr2: horner (%, x)...

Calculate

horner-keepfloat-true

expr: 1e-155*x^2 - 5....

expr2: horner (%, x)...

Calculate