You will add a series of inverse tangents term by term, write its telescoped closed form, and then use the same idea to compute with Machin's formula. The checker compares your functions on several values of .
The idea. The terms add up to . Machin's formula is . It comes from the sum rule for inverse tangents, and it was used to compute by hand to many digits.
Your tasks.
partial_sum(n). Add the terms for r from 1 to n, using a loop.telescoped(n). Return the closed form atan(n + 1) - pi / 4.machin_pi(). Return .Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…