So, you might have already seen @StudentFires 's attempt at a fast and accurate π approximation in C++...
So, here are two actually fast and accurate π approximations in C:
The repl linked to this post is the most accurate and is found at https://repl.it/@AmazingMech2418/p-in-C and the other is https://repl.it/@AmazingMech2418/p-in-C-2.
The first one uses trapezoidal sums while the other uses the Nilakantha Series.
Update: The second one was updated to make it faster. It gets to 16 places very quickly.
@Jakman Yes, but my Forth program can't be timed.
π Approximations in C
So, you might have already seen @StudentFires 's attempt at a fast and accurate π approximation in C++...
So, here are two actually fast and accurate π approximations in C:
The repl linked to this post is the most accurate and is found at https://repl.it/@AmazingMech2418/p-in-C and the other is https://repl.it/@AmazingMech2418/p-in-C-2.
The first one uses trapezoidal sums while the other uses the Nilakantha Series.
Update: The second one was updated to make it faster. It gets to 16 places very quickly.
@Jakman Yes, but my Forth program can't be timed.