Numerical Methods c2/10
Numerical Methods c2/10
THE EVALUATION OF THE FUNCTIONS The way of writing certain formulae is essential because equivalent mathematic expressions may stay at the basis of certain algorithmic representations which lead to different numeric results. That is why, it has to be held under control the situation of the propagation of errors, which may lead to inacceptable results. 1. The evaluation of the polynominals. Horners scheme As given the polynominal P ( X ) = a 0 X n + a1 X n 1 + ... + a n 1 X + a n , ai R, i = 0, n . Giving common factor for many times the polynominal may be brought under another form, for example: P ( X ) = a0 X n + a1 X n 1 + ... + an 1 X + an =
a0 b0
2. The evaluation of the analytic functions Definition 1: We may say that a function f is analytic at the point if it can be developed in Taylor series around this point, meaning: f ( ) f ( ) f ( n ) ( ) f ( x) = f ( ) + ( x ) + ( x )2 + ... + ( x ) n + ... = ti ( x) 1! 2! n! i =0 () x so that x < R . We have: t0 ( x) = f ( ) , t1 ( x) = ( x ) f ' ( ) f '' ( ) f ( n ) ( ) , t2 ( x) = ( x ) 2 ,...., tn ( x) = ( x ) n , 1! 2! n!
n i =0 i = n +1
so f ( x) = Tn ( x ) + Rn ( x) , where Tn ( x) = ti ( x) and Rn ( x ) =
t ( x) .
i
The partial sum of degree n of Taylor series is called Taylor polynominal of degree n , Tn ( x) , and Rn ( x) = f ( x) Tn ( x) is called the rest of degree n. The rest of degree n, Rn ( x) = f ( x) Tn ( x) , represents the error resulted by the replacement of function f(x) with the Taylor polynominal of degree n, Tn ( x) . Having in mind that for a convergent series the distortion error does not exceed the absolute value the last term taken into consideration , meaning Rn ( x) t n ( x ) , then t n ( x ) gives practical estimations for the absolute error and for the relative error:
(n)
= tn ( x ) , r
(n)
t ( x) (n) = = n . Tn ( x) Tn ( x )
Example: The development in Taylor series of the function f ( x) = e x is: x0 ' ( x 0) 2 '' ( x 0) n ( n ) f ( x) = e x = f (0) + f (0) + f (0) + ... + f (0) + ... 1! 2! n! x x2 xn x f ( x) = e = 1 + + + ... + + ... 1! 2! n! i x f ( x) = e x = i =0 i !
xi The convergent for ( ) x R , where Tn ( x ) = ti ( x) , for which t i ( x) = .
i =0 n
i!
Having in mind the relation between the two succesive terms, it is convenient to be made the calculus of the Taylor polynominal using the recurrent scheme:
t0 = f (0) = e0 = 1 t = x = x 1 1! 1 2 2 t2 = x = x = x x = x t1 2! 1 2 1 2 2 3 3 2 t = x = x = x x = x t2 3 3! 1 2 3 2! 3 3 ... x ti = ti 1 i
T0 = t0 = 1 T1 = t0 + t1 = T0 + t1 T2 = t0 + t1 + t2 = T1 + t2 T3 = t0 + t1 + t2 + t3 = T2 + t3 ... Ti = Ti 1 + ti
with i=1,2,...n,... The iterative process continues until the relative error becomes smaller than a precise value , that means tn Tn .