TY - JOUR

T1 - An approach to generate correctly rounded math libraries for new floating point variants

AU - Lim, Jay P.

AU - Aanjaneya, Mridul

AU - Gustafson, John

AU - Nagarakatte, Santosh

N1 - Funding Information:
We thank the POPL reviewers for their feedback. This material is based upon work supported by the National Science Foundation under Grant No. 1908798, Grant No. 1917897, and Grant No. 1453086. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.
Publisher Copyright:
© 2021 Owner/Author.

PY - 2021/1

Y1 - 2021/1

N2 - Given the importance of floating point (FP) performance in numerous domains, several new variants of FP and its alternatives have been proposed (e.g., Bfloat16, TensorFloat32, and posits). These representations do not have correctly rounded math libraries. Further, the use of existing FP libraries for these new representations can produce incorrect results. This paper proposes a novel approach for generating polynomial approximations that can be used to implement correctly rounded math libraries. Existing methods generate polynomials that approximate the real value of an elementary function () and produce wrong results due to approximation errors and rounding errors in the implementation. In contrast, our approach generates polynomials that approximate the correctly rounded value of () (i.e., the value of () rounded to the target representation). It provides more margin to identify efficient polynomials that produce correctly rounded results for all inputs. We frame the problem of generating efficient polynomials that produce correctly rounded results as a linear programming problem. Using our approach, we have developed correctly rounded, yet faster, implementations of elementary functions for multiple target representations.

AB - Given the importance of floating point (FP) performance in numerous domains, several new variants of FP and its alternatives have been proposed (e.g., Bfloat16, TensorFloat32, and posits). These representations do not have correctly rounded math libraries. Further, the use of existing FP libraries for these new representations can produce incorrect results. This paper proposes a novel approach for generating polynomial approximations that can be used to implement correctly rounded math libraries. Existing methods generate polynomials that approximate the real value of an elementary function () and produce wrong results due to approximation errors and rounding errors in the implementation. In contrast, our approach generates polynomials that approximate the correctly rounded value of () (i.e., the value of () rounded to the target representation). It provides more margin to identify efficient polynomials that produce correctly rounded results for all inputs. We frame the problem of generating efficient polynomials that produce correctly rounded results as a linear programming problem. Using our approach, we have developed correctly rounded, yet faster, implementations of elementary functions for multiple target representations.

KW - correctly rounded math libraries

KW - floating point

KW - posits

UR - http://www.scopus.com/inward/record.url?scp=85099028932&partnerID=8YFLogxK

UR - http://www.scopus.com/inward/citedby.url?scp=85099028932&partnerID=8YFLogxK

U2 - 10.1145/3434310

DO - 10.1145/3434310

M3 - Article

AN - SCOPUS:85099028932

SN - 2475-1421

VL - 5

JO - Proceedings of the ACM on Programming Languages

JF - Proceedings of the ACM on Programming Languages

IS - POPL

M1 - 29

ER -