Select Page

PL Perspectives

Perspectives on computing and technology from and for those with an interest in programming languages.
Archive of posts tagged: optimization
A DSL for Implementing Math Functions

A DSL for Implementing Math Functions

Numerical code needs to carefully balance accuracy and performance. A new DSL, MegaLibm, makes this easier by checking for numerical correctness and offering flexible compilation to efficient code. By reconceptualizing classic numerical techniques like polynomial approximation and range reduction as type-theoric operations like casts and binding operators, MegaLibm makes numerical code composable, and its ability to plug in mathematical an numerical tools (like Sollya) makes it easier and safer to write such code.

Read more...

One Polynomial Approximation to Produce Correctly Rounded Results for Multiple Representations and Rounding Modes

One Polynomial Approximation to Produce Correctly Rounded Results for Multiple Representations and Rounding Modes

To create a single polynomial approximation that produces correct results for multiple representations and rounding modes,  we propose to generate a polynomial that generates the correctly rounded result of f(x) using the non-standard round-to-odd rounding mode with 2 additional precision bits compared to the largest floating point representation that we wish to support.  We provide a proof that this method produces correctly rounded results for multiple representations and for all the standard rounding modes. More detailed explanation of our approach can be found in our POPL 2022 distinguished paper.

Read more...

High Performance Correctly Rounded Math Libraries for 32-bit Floating Point Representations

High Performance Correctly Rounded Math Libraries for 32-bit Floating Point Representations

Everyone uses math libraries. Surprisingly, mainstream math libraries do not produce correct results for several thousands of inputs. Developers are seldom aware of them, which affects reproducibility and portability. We describe our new method for synthesizing elementary functions that produces correct results for all inputs but is also significantly faster than the state of the art libraries, which have been optimized for decades.

Read more...