Evaluating real-valued expressions to high precision is a key building block in computational mathematics, physics, and numerics. A typical implementation uses a uniform precision for each operation, and doubles that precision until the real result can be bounded to some sufficiently narrow interval. However, this is wasteful: usually only a few operations really need to be performed at high precision, and the bulk of the expression could use much lower precision. Uniform precision can also waste iterations discovering the necessary precision and then still overestimate by up to a factor of two. We propose to instead use mixed-precision interval arithmetic to evaluate real-valued expressions. A key challenge is deriving the mixed-precision assignment both soundly and quickly. To do so, we introduce a sound variation of error Taylor series and condition numbers, specialized to interval arithmetic, that can be evaluated with minimal overhead thanks to an "exponent trick". Our implementation, Reval, achieves an average speed-up of 1.47x compared to the state-of-the-art Sollya tool, with the speed-up increasing to 4.92x on the most difficult input points. An examination of the precisions used with and without precision tuning shows that the speed-up results come from quickly assigning lower precisions for the majority of operations.
翻译:高精度求值实数表达式是计算数学、物理学和数值计算领域的关键基础模块。典型实现方案为每次运算采用统一精度,并不断将该精度加倍,直至能将实数结果限定于某个足够窄的区间内。然而这种方法存在资源浪费:通常仅有少数运算真正需要高精度执行,而表达式的主体部分完全可以使用更低精度完成。统一精度方案还会浪费迭代次数来探测必要精度,且最终仍可能产生高达两倍的精度高估。我们提出采用混合精度区间算术来替代现有方案。核心挑战在于如何既可靠又快速地推导出混合精度分配方案。为此,我们引入误差泰勒级数与条件数的可靠变体——该方法专为区间算术设计,通过"指数技巧"能以最小开销完成求值。我们的实现工具Reval相较于当前最先进的Sollya工具实现了平均1.47倍的加速,在最困难的输入点上加速比可达4.92倍。通过对比精度调优前后的精度使用情况分析表明,加速效果主要源于快速为大多数运算分配了更低精度。