← All stories
● Covered by 1 source · 1 reportLow impact1 neutral

New Algorithm Extracts Hexadecimal Digits of Pi Faster Than BBP and Bellard Formulas

🔄 Updated 1d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • New algorithm extracts pi's hex digits without prior computation.
  • Beats BBP, Bellard, and Huvent formulas in operation count.
  • Reduces divisions by 61% and modular exponentiations by 38%.
  • Achieves nearly 40% faster wall-clock time in implementations.

Algorithm Overview

A new algorithm has been introduced for extracting hexadecimal digits of pi. This method allows for the computation of specific digits without needing to calculate all preceding digits, a common requirement in such computations. The algorithm's efficiency stems from a rearranged Euler series identity that exploits shared arithmetic.

Efficiency Improvements

The new algorithm significantly reduces the computational load compared to established methods. When benchmarked against Huvent’s eight-term formula, it achieves approximately 61% fewer divisions and 38% fewer full modular exponentiations. These savings translate to about a million fewer full exponentiations per million hexadecimal places skipped.

In practical implementations, these operational efficiencies result in a nearly 40% reduction in wall-clock execution time. The core improvements come from collecting terms by odd denominators to share arithmetic and using two full exponentiations modulo 3M to serve both M and 3M denominators, providing up to eight powers of two with a single division.

Comparison to Existing Methods

The algorithm surpasses the performance of standard term-by-term evaluations used in the Bailey–Borwein–Plouffe (BBP), Bellard, and Huvent formulas. These formulas have been the basis for digit extraction algorithms for three decades, relying on the BBP trick to compute remainders of powers of two modulo N without constructing large numerators.

Underlying Principles

The key insights for the new algorithm derive from an identity based on an Euler series. By rearranging this series and collecting terms by odd denominators, arithmetic operations can be shared. For instance, a common denominator M=2k+1 allows for the addition of four remainders and a single division. Additionally, the small gaps between exponents enable reaching various powers through multiplication from a starting power and a step value.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~4 min · 3 stories · Nov 26

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Primary sources

GitHub ncw/euler_bbp

Reporting from

A new algorithm has been developed to extract hexadecimal digits of pi without computing preceding digits, outperforming existing methods like BBP, Bellard, and Huvent formulas in operation count. This algorithm reduces divisions by 61% and full modular exponentiations by 38% compared to Huvent's eight-term formula, leading to nearly 40% less wall-clock time in practice.