Professional Documents
Culture Documents
Homework 1 - 2020
Homework 1 - 2020
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.