Transcendental functions, such as the exponential, are central to scientific computing, yet they cannot be natively calculated by digital hardware. Instead, computers must approximate these functions by combining basic operations, such as $\{+, -, \times, ÷\}$, using methods like Taylor series. These methods were developed over centuries by mathematicians, who focused on approaches that could attain arbitrary accuracy. However, computers can handle most applications by using only finite-precision types, like float32, where any accuracy beyond the type's precision is effectively discarded. We explore, therefore, whether forgoing arbitrary accuracy can lead to the discovery of more efficient approximations. The evolutionary method of symbolic regression is particularly suitable, as it can search for arbitrary operation combinations and can optimize non-differentiable objectives, such as the number of operations used. Our results show that evolution can discover computer programs that outperform established methods in this setting, despite having no prior mathematical knowledge beyond the calculation of the basic operations. Starting from empty code, symbolic regression constructs programs representing novel mathematical expressions. In particular, we discovered a 10-operation program that approximates the exponential function to 14 significant figures, exceeding the accuracy of previously known approximations of this size by more than 6 orders of magnitude.
翻译:超越函数(如指数函数)是科学计算的核心,但数字硬件无法直接计算。因此,计算机需通过组合基本运算(如$\{+, -, \times, ÷\}$)并借助泰勒级数等方法对其进行近似。这些方法由数学家经数百年发展而来,其核心在于追求可达到任意精度的逼近方案。然而,大多数应用场景中,计算机仅需使用有限精度类型(如float32)即可处理,超出该类型精度的任意精度实际上被舍弃。为此,我们探索了放弃任意精度要求是否有助于发现更高效的近似方法。进化方法中的符号回归尤为适用,因其能搜索任意操作组合,并优化非可微目标(如运算次数)。结果表明,该进化方法虽在基本运算计算之外不具备先验数学知识,却可在该场景中发现超越传统方法的计算机程序。从空代码出发,符号回归逐步构建出代表新型数学表达式的程序。尤其值得关注的是,我们发现了仅含10个运算的程序,其近似指数函数的精度可达14位有效数字,比此前已知的同等规模近似方法的精度高出超过6个数量级。