Newzly.net

technology

Computer Scientist Discovers Faster Algorithm for Extracting Hexadecimal Digits of Pi

A newly published algorithm speeds up the extraction of arbitrary hexadecimal digits of pi, surpassing Fabrice Bellard's landmark 1997 formula through a faster-converging mathematical series discovered via automated search.

3 min readvia Hacker News
AI-generated news clip from this story — Diagram illustrating mathematical formulas and hexadecimal digits of pi on a computer screen

In this piece

Researcher Robert Smith has introduced a new formula for extracting hexadecimal digits of pi, achieving a 5 to 6 percent speedup over Fabrice Bellard's 1997…

A computer science researcher has published a new mathematical formula capable of extracting individual hexadecimal digits of pi faster than long-standing algorithmic benchmarks. Developed by researcher Robert Smith and detailed in a technical report on his site, the method improves upon the widely referenced formula introduced by French computer programmer Fabrice Bellard in 1997. The discovery represents a rare acceleration in a specialized branch of computational mathematics that has seen few major performance gains in recent decades.

For centuries, computing distant digits of irrational constants required calculating every single preceding digit in continuous sequence. That paradigm changed dramatically in the mid-1990s with the introduction of the Bailey-Borwein-Plouffe formula, which proved that arbitrary binary or hexadecimal digits of pi could be determined directly without retaining prior state. This spigot approach opened up new avenues for distributed verification and precision arithmetic.

Building on that milestone, Fabrice Bellard unveiled an optimized alternative in 1997 that delivered a roughly forty percent speed increase over the original Bailey-Borwein-Plouffe approach. Bellard accomplished this by engineering a series that converged at a rate of ten bits per term. For nearly three decades, his formulation remained the primary reference standard for high-performance direct extraction of pi's hexadecimal representation.

Smith developed the new breakthrough by constructing an automated, parallelized integer-relation search program to explore unexamined mathematical series. Rather than deriving the equation entirely through symbolic manipulation by hand, the search systematically evaluated candidate expressions to find high-convergence relationships. This computational search targeted structures that could deliver higher bit yields per step than existing mathematical literature documented.

The resulting series achieves an improved convergence rate of twelve bits per term, surpassing Bellard's rate by two bits per iteration. Because twelve bits correspond precisely to three hexadecimal characters, each evaluated term advances the computation by three full hex positions. This steeper rate of convergence drastically decreases the total number of terms an implementation must sum to isolate a targeted digit.

The increased bit yield does come with an operational cost, as each individual term requires roughly fourteen percent more arithmetic operations to evaluate. However, the substantial reduction in the overall number of required terms outweighs the per-term complexity. Experimental benchmarks documented by Smith demonstrate a net execution speedup of approximately five to six percent over Bellard's algorithm.

To demonstrate the practical viability of the formula, Smith shared a reference implementation written in Common Lisp detailing the necessary modular exponentiation and fractional summation routines. The code provides a concrete blueprint for how developers can execute the mathematics on standard desktop hardware without specialized coprocessors. It highlights how integer-relation discoveries can translate directly into production-ready algorithmic routines.

Direct digit extraction plays an indispensable role in contemporary high-performance computing, serving as an efficient tool for validating vast calculations. When research teams compute trillions of digits of pi using supercomputers, recalculating the entire dataset to check for memory errors is computationally prohibitive. Direct extraction allows engineers to verify isolated sections of digits at arbitrary positions with minimal overhead.

The discovery underscores how modern computing power and algorithmic search techniques can uncover analytical shortcuts that eluded mathematicians for decades. While further testing across different programming environments and hardware architectures will follow, the project demonstrates that foundational computational constants still harbor room for optimization. Future research may apply similar brute-force search strategies to optimize digit extraction formulas for other fundamental mathematical constants.

Primary source: Hacker News. Newzly rewrites and structures source reporting for clarity; verify critical details at the original.