Skip to Main content Skip to Navigation
Conference papers

Code generation for argument filtering and argument reduction in elementary functions

Florent de Dinechin 1, 2 Claude-Pierre Jeannerod 1 David Pfannholzer 1 Nathalie Revol 1
1 ARENAIRE - Computer arithmetic
Inria Grenoble - Rhône-Alpes, LIP - Laboratoire de l'Informatique du Parallélisme
Abstract : Computer platforms need implementations of elementary functions (exponential, logarithm, trigonometric, etc.) that are both efficient and reliable. Such an implementation relates a function (in the mathematical sense), input and output formats (for instance IEEE floating-point in single or double precision), and the constraints and capabilities of the target (hardware floating-point support or not, available parallelism, etc.). The quality (performance, memory consumption, accuracy, etc.) of the implementation depends on the algorithms chosen. In addition, it is often possible to control performance/cost/accuracy tradeoffs by means of implementation parameters. Code generation is a means to manage the resulting complexity, while maintaining confidence in the resulting code. A code generator may explore the parameter space and perform optimizations before actually producing the code. The implementation of a function often reduces to polynomial approximation, for which several approaches to code generation have been studied. Here, we focus on code generation for the remaining parts of the implementation: special case management (detecting overflows or underflows, or proving that they cannot happen), range reduction, and reconstruction. Indeed, these are the parts of the code where the features of the input and output formats are used. This work presents a code generator framework that abstracts the function, the target hardware, and the input and output formats, in a way that enables automatic code generation for special case management. It is demonstrated on several functions of the C99 standard. Its extension to generic techniques of range reduction is also discussed.
Document type :
Conference papers
Complete list of metadatas
Contributor : Nathalie Revol <>
Submitted on : Thursday, December 9, 2010 - 2:32:22 AM
Last modification on : Thursday, November 21, 2019 - 2:13:03 AM


  • HAL Id : inria-00544808, version 1



Florent de Dinechin, Claude-Pierre Jeannerod, David Pfannholzer, Nathalie Revol. Code generation for argument filtering and argument reduction in elementary functions. SCAN 2010: 14th GAMM-IMACS International Symposium on Scientific Computing, Computer Arithmetic and Validated Numerics, Revol, Nathalie and de Dinechin, Florent and Jeannerod, Claude-Pierre and Lefèvre, Vincent and Louvet, Nicolas and Morin, Sèverine and Nguyen, Hong Diep, Sep 2010, Lyon, France. ⟨inria-00544808⟩



Record views