Skip to content

Latest commit

 

History

History
29 lines (29 loc) · 1.59 KB

README.md

File metadata and controls

29 lines (29 loc) · 1.59 KB

Calculating π using various fast-converging series

List of used algorithms

Machin-like formula

Machin-like formula
  • Hwang Chien-Lih's arctangent sum
  • F. C. M. Störmer's arctangent sum
  • Kikuo Takano's arctangent sum

Leibniz based formulas

Nilakantha's accelerated series for pi
  • Leibniz formula
  • Nilakantha's formula 1
  • Nilakantha's formula 2
  • Nilakantha's formula 3

Disclaimer: last few digits are wrong, so if you're going to use this program somewhere, make sure to throw away the last 10 or so digits

Brief description

This is my last day of calculating pi, so I put some effort on implementing multiple fast-converging series.
I implemented a small extension to the existing BigInt JavaScript feature to accomodate fraction arithmetics.
And for the arc-tangents I simply decomposed them into taylor-series and re-factored them as a sum

Demo
Github
Fork me on Github