3. With considering the following algorithm for computing pi:
I. Set a = 1, b = 1/sqrt(2), t = 1/4 and x = 1
II. Repeat the following commands until the difference between a and b is within some desired accuracy:
y = a
a = (a + b)/2
b = sqrt(b*y)
t = t - x*(y - a)^2
x = 2*x
III. From the resulting values of a, b and t, an estimate of pi is
Pi_est = ((a + b)^2)/(4*t)
How many repeats are needed to estimate pi to an accuracy of 1e-8? 1e-15?
1
Expert's answer
2012-11-12T06:07:53-0500
Unfortunately, your question requires a lot of work and cannot be done for free. Submit it with all requirements as an assignment to our control panel and we'll assist you.
Comments
Leave a comment