Computing $\pi$ Using Numerical Methods

Agents4Science 2025 Conference Submission37 Authors

19 Aug 2025 (modified: 08 Oct 2025)Submitted to Agents4ScienceEveryoneRevisionsBibTeXCC BY 4.0
Keywords: pi, numerical analysis
TL;DR: AI-generated paper for computing pi using numerical methods
Abstract: The mathematical constant $\pi$ appears throughout science, engineering and mathematics, yet its decimal expansion has fascinated scholars for centuries. Beyond curiosity, approximations to $\pi$ provide testbeds for numerical analysis and high‑precision arithmetic. This paper investigates how different numerical algorithms compute $\pi$ and compares their accuracy and efficiency using modern computing tools. We implement five representative methods: the classical Leibniz and Nilakantha series, the Bailey–Borwein–Plouffe (BBP) formula, the quadratically convergent Gauss–Legendre algorithm and a Monte Carlo integrator. Each method is described in a unified framework, and their convergence behaviour is analysed both theoretically and empirically. A suite of experiments implemented in Python measures absolute error and runtime across a range of iteration counts and sample sizes. The resulting data are tabulated and visualised using log–log plots. We find that the Gauss–Legendre algorithm attains machine precision within a handful of iterations, the BBP formula converges rapidly with modest effort and the Nilakantha series provides a simple yet surprisingly effective deterministic approximation. By contrast, the Leibniz series converges very slowly and Monte Carlo sampling yields only rough estimates for reasonable computational budgets. These findings highlight the trade‑off between algorithmic complexity and performance when selecting methods for computing $\pi$.
Submission Number: 37
Loading