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.
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.
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.
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 →
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.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
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.