Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Department of Mechanical Engineering

National Central University

ME 6000 Numerical Analysis

Due Oct. 5, 13:00

The Taylor series of ex is

N
xk x 2 x3
ex    1 x    ..., N  
k 0 k ! 2! 3!

Write a short program using MATLAB to carry out the following computations for x  7 , with N =
35.

1. Using floating numbers of double precision, perform the summation with increasing k. That is k
= 0 first, then k = 1, 2, 3, …, N.

2. Using floating numbers of double precision, perform the summation with decreasing k. That is k
= N first, and then k = N-1, N-2, N-3,…, 0.

3. Perform the summation using floating numbers of single precision with an increasing sequence
of k.

4. Perform the summation using floating numbers of single precision with a decreasing sequence
of k.

5. Compare above answers to the exact solution of e x .

6. Repeat all calculations above for x  7 .

You might also like