English

SLEEF: A Portable Vectorized Library of C Standard Mathematical Functions

Mathematical Software 2020-01-28 v1 Distributed, Parallel, and Cluster Computing Programming Languages

Abstract

In this paper, we present techniques used to implement our portable vectorized library of C standard mathematical functions written entirely in C language. In order to make the library portable while maintaining good performance, intrinsic functions of vector extensions are abstracted by inline functions or preprocessor macros. We implemented the functions so that they can use sub-features of vector extensions such as fused multiply-add, mask registers and extraction of mantissa. In order to make computation with SIMD instructions efficient, the library only uses a small number of conditional branches, and all the computation paths are vectorized. We devised a variation of the Payne-Hanek argument reduction for trigonometric functions and a floating point remainder, both of which are suitable for vector computation. We compare the performance of our library to Intel SVML.

Keywords

Cite

@article{arxiv.2001.09258,
  title  = {SLEEF: A Portable Vectorized Library of C Standard Mathematical Functions},
  author = {Naoki Shibata and Francesco Petrogalli},
  journal= {arXiv preprint arXiv:2001.09258},
  year   = {2020}
}

Comments

in IEEE Transactions on Parallel and Distributed Systems. This is a version with all appendices included in a PDF. Accompanying software can be accessed at https://sleef.org or https://codeocean.com/capsule/6861013

R2 v1 2026-06-23T13:20:26.981Z