Question: Here, we will look at numerical errors that occur due to the addition of small numbers and the subtraction of similar numbers. Start with x

Here, we will look at numerical errors that occur due to the addition of small numbers and the subtraction
of similar numbers. Start with x =1010 and calculate R according to
R =
x +
1
j=1
x
for the values of =0.01,0.001,...,1010. To compute the term in brackets, first compute x + and then
add again to yield x +2 until you reach the final addition in the sum. Note: Do not attempt to store all
intermediate values!
(a) Analytically, what should the value of R be in each case?
(b) Implement this in Julia and plot R as a function of with the x-axis on a logarithmic scale.
(c) What happens as decreases? W

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 Programming Questions!