Question: Write a MATLAB program to estimate the sum of the in nite series:f ( N ) = PN n = 1 1 n 4 (

Write a MATLAB program to estimate the sum of the innite series:f (N )= PN
n=11
n4
(a) Use N =100; 000. The exact value of f (N )=4=90 as N !1. Compute the sum two ways.
First sum from 0 to N: Then repeat the calculation but in reverse order that is, from N to
1 in increments of 1. Find the true relative error for each case. Note: be sure to view your
results in format long.
(b) Do the same exercise as above but using single precision. You can convert MATLAB variables
to single precision as shown in the following example:
sum =0.;
sum1= single(sum);
This creates a single-precision variable, sum1, which has the same value as the double-precision
variable, sum, except that it is stored in 32 bits rather than in 64 bits. Operations done on
sum1 will automatically be carried out in single precision, and results of those calculations will
be stored in 32-bit format. So the trick is that you need to declare your variables as single
precision BEFORE you begin your calculations.
(c) Comment on your results, and see if you can explain them

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!