[libc-commits] [PATCH] D121574: [libc] Implement expm1f function that is correctly rounded for all rounding modes.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Sun Mar 13 23:29:44 PDT 2022


lntue created this revision.
lntue added reviewers: michaelrj, sivachandra, zimmermann6.
Herald added subscribers: ecnelises, tschuett, mgorny.
Herald added projects: libc-project, All.
lntue requested review of this revision.

Implement expm1f function that is correctly rounded for all rounding modes.  This is based on expf implementation.

>From exhaustive testings, using expf implementation, and subtract 1.0 before rounding the final result to single precision
gives correctly rounded results for all |x| > 2^-4 with 1 exception.  When |x| < 2^-25, we use x + x^2 (implemented with a
single fma).  And for 2^-25 <= |x| <= 2^-4, we use a single degree-8 minimax polynomial generated by Sollya.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121574

Files:
  libc/src/math/generic/CMakeLists.txt
  libc/src/math/generic/common_constants.cpp
  libc/src/math/generic/common_constants.h
  libc/src/math/generic/expf.cpp
  libc/src/math/generic/expm1f.cpp
  libc/test/src/math/exhaustive/CMakeLists.txt
  libc/test/src/math/exhaustive/exhaustive_test.cpp
  libc/test/src/math/exhaustive/exhaustive_test.h
  libc/test/src/math/exhaustive/expm1f_test.cpp
  libc/test/src/math/expm1f_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121574.415011.patch
Type: text/x-patch
Size: 33774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220314/c57cc6dd/attachment-0001.bin>


More information about the libc-commits mailing list