Added some info about where I found the pi approximation

This commit is contained in:
Daniel Knüttel 2018-10-24 17:48:09 +02:00
parent 0376b823cf
commit 32f23dad4a

View File

@ -3,6 +3,9 @@
import math
def bailey_borwein_plouffe_pi(n):
"""
See https://en.wikipedia.org/wiki/Approximations_of_%CF%80#Efficient_methods
"""
result = 0
for k in range(n):
result += (1/16)**k * ( 4/(8*k + 1) - 2/(8*k + 4) - 1/(8*k + 5) - 1/(8*k + 6))