Question: 1 Problem 1 Write a program to evaluate e 9 . 3 , in single precision float arithmetic, using each of the two alternative methods:

1 Problem 1
Write a program to evaluate e9.3, in single precision float arithmetic, using each of the two alternative
methods:
ex =1 x +
x2
2
x3
3!
+(1)
and
ex =
1
ex =
1
1+ x + x2
2+ x3
3!+
(2)
For (1), use the first k terms in the right-hand side; and for (2), use the first k terms in the denominator of
the right-hand side. Use the matlab built-in function exp() to find the true value of e9.3.
Approximate e9.3 by the above two evaluated results based on the sums of the first k terms; compute the
two approximation errors e1(k) and e2(k); generate and compare the two error curves (or/and table(s))
for k =2,3,,35.
Which method has a higher numerical precision? Which method converges faster? Explain your observations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!