Code Generators for Mathematical Functions

A typical floating-point environment includes support for a small set of about 30 mathematical functions such as exponential, logarithm, trigonometric and hyperbolic functions. These functions are provided by mathematical software libraries (libm), typically in IEEE754 single, double and quad precision. This article suggests to replace this libm paradigm by a more general approach: the on-demand generation of numerical function code, on arbitrary domains and with arbitrary accuracies. First, such code generation opens up the libm function space available to programmers. It may capture a much wider set of functions, and may capture even standard functions on non-standard domains and accuracy/performance points. Second, writing libm code requires fine-tuned instruction selection and scheduling for performance, and sophisticated floating-point techniques for accuracy. Automating this task through code generation improves confidence in the code while enabling better design space exploration, and therefore better time to market, even for the libm functions. This article discusses the new challenges of this paradigm shift, and presents the current state of open-source function code generators available on http://www.metalibm.org/.

[1]  Richard W. Vuduc,et al.  Methods for High-Throughput Computation of Elementary Functions , 2013, PPAM.

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

[3]  J. Apostolakis,et al.  Final Report of the ATLAS Detector Simulation Performance Assessment Group , 2010 .

[4]  Ping Tak Peter Tang Table-driven implementation of the logarithm function in IEEE floating-point arithmetic , 1990, TOMS.

[5]  George Paul,et al.  Should the Elementary Function Library Be Incorporated Into Computer Instruction Sets? , 1976, TOMS.

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

[7]  Christoph Quirin Lauter,et al.  Replacing Branches by Polynomials in Vectorizable Elementary Functions , 2014, SCAN.

[8]  John Harrison,et al.  Scientific Computing on Itanium-Based Systems , 2002 .

[9]  Franz Franchetti,et al.  SPIRAL: Code Generation for DSP Transforms , 2005, Proceedings of the IEEE.

[10]  Sandra Loosemore,et al.  The GNU C Library Reference Manual , 2001 .

[11]  Thorsten Gerber,et al.  Handbook Of Mathematical Functions , 2016 .

[12]  Shmuel Gal,et al.  An accurate elementary mathematical library for the IEEE floating point standard , 1991, TOMS.

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

[14]  Wayne Luk,et al.  Hierarchical segmentation schemes for function evaluation , 2003, Proceedings. 2003 IEEE International Conference on Field-Programmable Technology (FPT) (IEEE Cat. No.03EX798).

[15]  R. C. Whaley,et al.  Minimizing development and maintenance costs in supporting persistently optimized BLAS , 2005, Softw. Pract. Exp..

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

[17]  Christoph Quirin Lauter,et al.  Certified and Fast Computation of Supremum Norms of Approximation Errors , 2009, 2009 19th IEEE Symposium on Computer Arithmetic.

[18]  Abraham Ziv,et al.  Fast evaluation of elementary mathematical functions with correctly rounded last bit , 1991, TOMS.

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

[20]  Steven G. Johnson,et al.  The Design and Implementation of FFTW3 , 2005, Proceedings of the IEEE.

[21]  Peter W. Markstein,et al.  IA-64 and elementary functions - speed and precision , 2000 .

[22]  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.

[23]  Ping Tak Peter Tang Table-driven implementation of the exponential function in IEEE floating-point arithmetic , 1989, TOMS.

[24]  Peter W. Markstein Accelerating sine and cosine evaluation with compiler assistance , 2003, Proceedings 2003 16th IEEE Symposium on Computer Arithmetic.

[25]  Jean-Michel Muller,et al.  Fast and correctly rounded logarithms in double-precision , 2007, RAIRO Theor. Informatics Appl..

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

[27]  Christophe Mouilleron,et al.  Automatic Generation of Fast and Certified Code for Polynomial Evaluation , 2011, 2011 IEEE 20th Symposium on Computer Arithmetic.

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

[29]  W. Marsden I and J , 2012 .

[30]  Ping Tak Peter Tang Table-driven implementation of the Expm1 function in IEEE floating-point arithmetic , 1992, TOMS.