Sponsored links: Algebra eBooks
 

Related

horner-keepfloat-true

expr: 1 * x^4 +2 *x^2...

expr2: horner (%, x),...

Calculate

horner-keepfloat-true

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

expr2: horner (%, x),...

Calculate

horner

a00:(x2-x1)*(x2-x1)+(...

a11:(x3-x4)*(x3-x4)+(...

a01:(x2-x1)*(x3-x4)+(...

Calculate

horner-keepfloat-true

expr: x^3 + 2*x^2 + 5...

expr2: horner (%, x)...

Calculate

horner-keepfloat-true

expr: 5 * x^2 - 3 * x...

expr2: horner (%, x+2...

Calculate

horner

a00:(x2-x1)*(x2-x1)+(...

a11:(x3-x4)*(x3-x4)+(...

a01:(x2-x1)*(x3-x4)+(...

Calculate

horner-keepfloat-true

expr: 4-x^2+x^4;

expr2: horner (%, x)...

Calculate

horner-keepfloat-true

expr: 5 * x^2 - 5 * x...

expr2: horner (%, x),...

Calculate

horner

a00:(x2-x1)*(x2-x1)+(...

a11:(x3-x4)*(x3-x4)+(...

a01:(x2-x1)*(x3-x4)+(...

Calculate

horner

a00:(x2-x1)*(x2-x1)+(...

a11:(x3-x4)*(x3-x4)+(...

a01:(x2-x1)*(x3-x4)+(...

Calculate

horner

Run Example
(%i1)f(x) := x^(1/12);
                                          1/12
(%o1)                            f(x) := x
(%i2) k : 5;
(%o2)                                  5
(%i3) n : 2*k;
(%o3)                                 10
(%i4) g(x) := taylor(f(x), x, 1, n);
(%o4)                    g(x) := taylor(f(x), x, 1, n)
(%i5) g(x);
                               2              3               4
             x - 1   11 (x - 1)    253 (x - 1)    8855 (x - 1)
(%o5)/T/ 1 + ----- - ----------- + ------------ - -------------
              12         288          10368          497664
                5                  6                   7                     8
   83237 (x - 1)    4910983 (x - 1)    49811399 (x - 1)    4134346117 (x - 1)
 + -------------- - ---------------- + ----------------- - -------------------
      5971968          429981696          5159780352          495338913792
                       9                        10
   392762881115 (x - 1)    8405125655861 (x - 1)
 + --------------------- - ----------------------- + . . .
      53496602689536          1283918464548864
(%i6) bfloat(g(x));
                                        10                                   9
(%o6) - 6.546463726428567b-3 (x - 1.0b0)   + 7.341828478237645b-3 (x - 1.0b0)
                                   8                                   7
 - 8.346499743680691b-3 (x - 1.0b0)  + 9.653782836064414b-3 (x - 1.0b0)
                                   6                                   5
 - 1.142137687647057b-2 (x - 1.0b0)  + 1.393795144247257b-2 (x - 1.0b0)
                                   4                                   3
 - 1.779312950102881b-2 (x - 1.0b0)  + 2.440200617283951b-2 (x - 1.0b0)
                                   2
 - 3.819444444444444b-2 (x - 1.0b0)  + 8.333333333333333b-2 (x - 1.0b0) + 1.0b0
(%i7) p(x) := pade(g(x), n/2, n/2)[1];
                                              n  n
(%o7)                      p(x) := pade(g(x), -, -)
                                              2  2
                                                   1
(%i8) horner(p(x));
(%o8) 
 x (x (x (x (1026935 x + 23303525) + 87621254) + 82884970) + 19452595) + 701569
 ------------------------------------------------------------------------------
 x (x (x (x (701569 x + 19452595) + 82884970) + 87621254) + 23303525) + 1026935
(%i9) l : 1-1/8;
                                       7
(%o9)                                  -
                                       8
(%i10) r : 1+1/8;
                                       9
(%o10)                                 -
                                       8
(%i11) plot2d([(f(x) - bfloat(g(x)))/f(x)], [x, l, r]);
plotplot2d([(f(x) - bfloat(g(x)))/f(x)], [x, l, r]);plot2d([(f(x) - bfloat(p(x)))/f(x)], [x, l, r]);
plotplot2d([(f(x) - bfloat(p(x)))/f(x)], [x, l, r]);plot2d([f(x), bfloat(g(x))], [x, l, r]);
plotplot2d([f(x), bfloat(g(x))], [x, l, r]);
Run Example
expr: 5*x^4 -6*x^2 +4;
                                   4      2
(%o1)                           5 x  - 6 x  + 4
(%i2) expr2: horner (%, x), keepfloat: true;
(%o2)             (%i3) 
Run Example
expr: -970*x^3 + 60*x^2 + 60*x + 1110;
                               3       2
(%o1)                   - 970 x  + 60 x  + 60 x + 1110
(%i2)  expr2: horner (%, x), keepfloat: true;
(%o2)              ev (expr, x=x);
 ev (expr2, x=x);
                               3       2
(%o3)                   - 970 x  + 60 x  + 60 x + 1110
(%i4) 

Related Help

Help for Horner