Problem

Write a routine in double or long double precision to implement the following algorithm...

Write a routine in double or long double precision to implement the following algorithm for computing π.

Which converges faster, f or g? How accurate are the final values? Also compare with the double- or long-double precision computation of 4.0 arctan(1.0).

Hint: The value of π correct to 36 digits is

3.14159 26535 89793 23846 26433 83279 50288

Note: A new formula for computing π was discovered in the early 1970s. This algorithm is based on that formula, which is a direct consequence of a method developed by Gauss for calculating elliptic integrals and of Legendre’s elliptic integral relation, both known for over 150 years! The error analysis shows that rapid convergence occurs in the computation of π, and the number of significant digits doubles after each step. (The interested reader should consult Brent [1976], Borwein and Borwein [1987], and Salamin [1976].)

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT