Sound Approximation of Programs with Elementary Functions

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.

[1]  Heiko Becker,et al.  Daisy - Framework for Analysis and Optimization of Numerical Programs (Tool Paper) , 2018, TACAS.

[2]  James Demmel,et al.  Statistical Models for Empirical Search-Based Performance Tuning , 2004, Int. J. High Perform. Comput. Appl..

[3]  Pavel Panchekha,et al.  Automatically improving accuracy for floating point expressions , 2015, PLDI.

[4]  Ian Briggs,et al.  Rigorous Estimation of Floating-Point Round-Off Errors with Symbolic Taylor Expansions , 2015, FM.

[5]  Jean-Michel Muller,et al.  Elementary functions - algorithms and implementation (2. ed.) , 2006 .

[6]  Jean-Michel Muller,et al.  Elementary Functions: Algorithms and Implementation , 1997 .

[7]  James Demmel,et al.  IEEE Standard for Floating-Point Arithmetic , 2008 .

[8]  Viktor Kuncak,et al.  Towards a Compiler for Reals , 2014, ACM Trans. Program. Lang. Syst..

[9]  Nachiket Kapre,et al.  Accelerating SPICE Model-Evaluation using FPGAs , 2009, 2009 17th IEEE Symposium on Field Programmable Custom Computing Machines.

[10]  Alexander Aiken,et al.  Stochastic optimization of floating-point programs with tunable precision , 2014, PLDI.

[11]  Jorge Stolfi,et al.  Affine Arithmetic: Concepts and Applications , 2004, Numerical Algorithms.

[12]  Nicolas Brisebarre,et al.  Efficient polynomial L-approximations , 2007, 18th IEEE Symposium on Computer Arithmetic (ARITH '07).

[13]  George A. Constantinides,et al.  Certified Roundoff Error Bounds Using Semidefinite Programming , 2015, ACM Trans. Math. Softw..

[14]  Luis Ceze,et al.  Neural Acceleration for General-Purpose Approximate Programs , 2012, 2012 45th Annual IEEE/ACM International Symposium on Microarchitecture.

[15]  Christoph Quirin Lauter,et al.  Semi-Automatic Floating-Point Implementation of Special Functions , 2015, 2015 IEEE 22nd Symposium on Computer Arithmetic.

[16]  Eric Goubault,et al.  Robustness Analysis of Finite Precision Implementations , 2013, APLAS.

[17]  Mei Han An,et al.  accuracy and stability of numerical algorithms , 1991 .

[18]  Ian Briggs,et al.  Rigorous floating-point mixed-precision tuning , 2017, POPL.

[19]  Mariano M. Moscato,et al.  Automatic Estimation of Verified Floating-Point Round-Off Errors via Static Analysis , 2017, SAFECOMP.

[20]  Matthieu Martel,et al.  Mixed Precision Tuning with Salsa. , 2018, PECCS 2018.

[21]  Alexander Aiken,et al.  Stochastic superoptimization , 2012, ASPLOS '13.

[22]  Eric Goubault,et al.  Static Analysis of Finite Precision Computations , 2011, VMCAI.

[23]  James Demmel,et al.  Precimonious: Tuning assistant for floating-point precision , 2013, 2013 SC - International Conference for High Performance Computing, Networking, Storage and Analysis (SC).

[24]  Emina Torlak,et al.  Optimizing synthesis with metasketches , 2016, POPL.

[25]  Qiang Xu,et al.  Approximate Computing: A Survey , 2016, IEEE Design & Test.

[26]  Florent de Dinechin,et al.  Code Generators for Mathematical Functions , 2015, 2015 IEEE 22nd Symposium on Computer Arithmetic.

[27]  Florent de Dinechin,et al.  Assisted verification of elementary functions using Gappa , 2006, SAC.

[28]  Eva Darulova,et al.  Sound Mixed-Precision Optimization with Rewriting , 2017, 2018 ACM/IEEE 9th International Conference on Cyber-Physical Systems (ICCPS).

[29]  Hadi Esmaeilzadeh,et al.  AxBench: A Multiplatform Benchmark Suite for Approximate Computing , 2017, IEEE Design & Test.

[30]  Bronis R. de Supinski,et al.  Abstract: Automatically Adapting Programs for Mixed-Precision Floating-Point Computation , 2013, 2012 SC Companion: High Performance Computing, Networking Storage and Analysis.

[31]  José M. F. Moura,et al.  Spiral: A Generator for Platform-Adapted Libraries of Signal Processing Alogorithms , 2004, Int. J. High Perform. Comput. Appl..

[32]  Christoph Quirin Lauter,et al.  A domain splitting algorithm for the mathematical functions code generator , 2014, 2014 48th Asilomar Conference on Signals, Systems and Computers.

[33]  Christoph Quirin Lauter,et al.  Sollya: An Environment for the Development of Numerical Codes , 2010, ICMS.

[34]  J. Muller Elementary Functions, Algorithms and Implementation, 2nd Edition , 2006 .

[35]  Florent de Dinechin,et al.  Certifying the Floating-Point Implementation of an Elementary Function Using Gappa , 2011, IEEE Transactions on Computers.

[36]  Matthieu Martel,et al.  Improving the numerical accuracy of programs by automatic transformation , 2017, International Journal on Software Tools for Technology Transfer.

[37]  Alexander Aiken,et al.  On automatically proving the correctness of math.h implementations , 2017, Proc. ACM Program. Lang..