Towards an API for the real numbers
Hans-Juergen Boehm
摘要
The real numbers are pervasive, both in daily life, and in mathematics. Students spend much time studying their properties. Yet computers and programming languages generally provide only an approximation geared towards performance, at the expense of many of the nice properties we were taught in high school.
Although this is entirely appropriate for many applications, particularly those that are sensitive to arithmetic performance in the usual sense, we argue that there are others where it is a poor choice. If arithmetic computations and result are directly exposed to human users who are not floating point experts, floating point approximations tend to be viewed as bugs. For applications such as calculators, spreadsheets, and various verification tasks, the cost of precision sacrifices is high, and the performance benefit is often not critical. We argue that previous attempts to provide accurate and understandable results for such applications using the recursive reals were great steps in the right direction, but they do not suffice. Comparing recursive reals diverges if they are equal. In many cases, comparison of numbers, including equal ones, is both important, particularly in simple cases, and intractable in the general case.
We propose an API for a real number type that explicitly provides decidable equality in the easy common cases, in which it is often unnatural not to. We describe a surprisingly compact and simple implementation in detail. The approach relies heavily on classical number theory results. We demonstrate the utility of such a facility in two applications: testing floating point functions, and to implement arithmetic in Google's Android calculator application.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper5
- Equality Saturation Theory Exploration à la CarteAnjali Pal, Brett Saiki, Ryan Tjoa, Cynthia Richey 等OOPSLA 2023 · 被引用 11 次
- Implementation and Synthesis of Math Library FunctionsIan Briggs, Yash Lad, Pavel PanchekhaPOPL 2024 · 被引用 7 次
- FPVM: Towards a Floating Point Virtual MachinePeter A. Dinda, Nick Wanninger, Jiacheng Ma, Alex Bernat 等HPDC 2022 · 被引用 4 次
- Virtualization So Light, it Floats! Accelerating Floating Point VirtualizationNick Wanninger, Nadharm Dhiantravan, Peter A. DindaHPDC 2025 · 被引用 2 次
- Verifying Exact Samplers for Continuous Distributions with a Discrete Program LogicMarkus de Medeiros, Puming Liu, Kwing Hei Li, Alejandro Aguirre 等LICS 2026
相关 Paper
- Alternative Implementations of Secure Real NumbersVassil S. Dimitrov, Liisi Kerik, Toomas Krips, Jaak Randmets 等CCS 2016 · 被引用 26 次
- Global Optimisation with Constructive RealsDan R. Ghica, Todd Waugh AmbridgeLICS 2021 · 被引用 1 次
- Choosing mathematical function implementations for speed and accuracyIan Briggs, Pavel PanchekhaPLDI 2022 · 被引用 4 次
- Floating-Point Neural Networks are Provably Robust Universal ApproximatorsGeonho Hwang, Wonyeol Lee, Yeachan Park, Sejun Park 等CAV 2025
- Spain: Succinct Proofs for Numerical ComputationsZachary DeStefano, Noah Golub, Zile Huang, Julius Zhang 等OSDI 2026
