Sound Approximation of Programs with Elementary Functions
This work addresses the challenge of navigating the accuracy-efficiency tradeoff in elementary function calls for non-expert programmers, providing an automated solution that guarantees error bounds.
The paper presents an automated tool that approximates elementary function calls in numerical programs while guaranteeing user-specified error bounds, achieving significant efficiency improvements (e.g., up to 10x speedup) with reduced but guaranteed accuracy.
Elementary function calls are a common feature in numerical programs. While their implementions in library functions are highly optimized, their computation is nonetheless very expensive compared to plain arithmetic. Full accuracy is, however, not always needed. Unlike arithmetic, where the performance difference between for example single and double precision floating-point arithmetic is relatively small, elementary function calls provide a much richer tradeoff space between accuracy and efficiency. Navigating this space is challenging. First, generating approximations of elementary function calls which are guaranteed to satisfy accuracy error bounds is highly nontrivial. Second, the performance of such approximations generally depends on several parameters which are unintuitive to choose manually, especially for non-experts. We present a fully automated approach and tool which approximates elementary function calls inside small programs while guaranteeing overall user provided error bounds. Our tool leverages existing techniques for roundoff error computation and approximation of individual elementary function calls, and provides automated selection of many parameters. Our experiments show that significant efficiency improvements are possible in exchange for reduced, but guaranteed, accuracy.