罗伯特·史密斯(Robert Smith)发布了一种用于提取圆周率π特定十六进制位的新算法 1。该算法基于欧拉级数,通过利用四个二的幂次之间的关系以及共同分母 $M=2k+1$ 的结构特性,显著减少了计算过程中的除法及模幂运算次数 1。其核心创新在于通过模 $3M$ 的计算方式,使得相同的两次指数运算能够同时服务于 $M$ 和 $3M$ 两个分母 1。
与现有的 Bailey–Borwein–Plouffe (BBP)、Bellard 以及 Huvent 公式相比,新算法在处理大型偏移量时展现出明显的效率优势 1。数据显示,相较于 Huvent 公式,新算法节省了约 61% 的除法运算和 38% 的完整模幂运算 1。具体而言,每跳过一百万个十六进制位,该算法即可比 Huvent 算法减少约一百万次完整的指数运算 1。
在工程实现方面,作者展示了利用 AVX-512 IFMA 指令集进行的高性能实现细节 1。测试表明,在 Zen 5 处理器上运行该实现时,指数循环的执行速度提升了约 8% 1。
Robert Smith has introduced a new algorithm for extracting hexadecimal digits of π, which is based on the Euler series and utilizes shared denominators and modular arithmetic to significantly reduce the number of division and modular exponentiation operations 1. Compared to standard formulas such as Bailey–Borwein–Plouffe (BBP), Bellard, and Huvent, the new method demonstrates superior operational counts, particularly at large offsets 1.
The core idea involves leveraging the relationship between four powers of two and using a common denominator M = 2k + 1 1. By calculating modulo 3M, the algorithm allows two identical exponential operations to serve both the M and 3M denominators 1. This approach saves approximately 61% of divisions and 38% of full modular exponentiations compared to the Huvent formula 1. Specifically, for every one million hexadecimal digits skipped, the new algorithm saves roughly one million full exponential operations relative to the Huvent algorithm 1.
Smith also demonstrated high-performance implementation details using the AVX-512 IFMA instruction set 1. On Zen 5 processors, this implementation achieved an approximate 8% speedup in the exponential loop 1.
评论
还没有评论,欢迎留下第一条。