We describe an algorithm for arbitrary-precision computation of the elementary functions (exp, log, sin, atan, etc.) which, after a cheap precomputation, gives roughly a factor-two speedup over previous state-of-the-art algorithms at precision from a few thousand bits up to millions of bits. Following an idea of Sch{\"o}nhage, we perform argument reduction using Diophantine combinations of logarithms of primes; our contribution is to use a large set of primes instead of a single pair, aided by a fast algorithm to solve the associated integer relation problem. We also list new, optimized Machin-like formulas for the necessary logarithm and arctangent precomputations.
翻译:我们描述一种任意精确计算基本功能(计算、日志、罪恶、阿坦等)的算法,这种算法在经过廉价的预估后,从几千位位到百万位精确地提供了比先前最先进的算法大约2倍的加速率。在采用Sch#'o'o}nhage的构想后,我们使用质数对数对数的对数组合来减少争论;我们的贡献是使用一大批质数,而不是单对数,用快速算法帮助解决相关的整数关系问题。我们还列出新的、最优化的Machin类公式,用于必要的对数和重度预估。