[libc-commits] [PATCH] D101134: [libc] Add implementation of expm1f.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 22 21:46:38 PDT 2021


lntue created this revision.
lntue added a reviewer: sivachandra.
Herald added subscribers: tmatheson, ecnelises, tschuett, mgorny.
Herald added a project: libc-project.
lntue requested review of this revision.

Use expm1f(x) = exp(x) - 1 for |x| > ln(2).
For |x| <= ln(2), divide it into 3 subintervals: [-ln2, -1/4], [-1/4, 1/4], [1/4, ln2]
and use a degree-6 polynomial approximation generated by Sollya's fpminmax for each interval.
Errors < 1.5 ULPs when we use fma to evaluate the polynomials.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101134

Files:
  libc/config/linux/aarch64/entrypoints.txt
  libc/config/linux/x86_64/entrypoints.txt
  libc/spec/stdc.td
  libc/src/math/CMakeLists.txt
  libc/src/math/expm1f.h
  libc/src/math/generic/CMakeLists.txt
  libc/src/math/generic/expm1f.cpp
  libc/test/src/math/CMakeLists.txt
  libc/test/src/math/exhaustive/CMakeLists.txt
  libc/test/src/math/exhaustive/expm1f_test.cpp
  libc/test/src/math/expm1f_test.cpp
  libc/utils/FPUtil/BitPatterns.h
  libc/utils/FPUtil/CMakeLists.txt
  libc/utils/FPUtil/PolyEval.h
  libc/utils/FPUtil/generic/FMA.h
  libc/utils/MPFRWrapper/MPFRUtils.cpp
  libc/utils/MPFRWrapper/MPFRUtils.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101134.339874.patch
Type: text/x-patch
Size: 17609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20210423/4fc780d8/attachment.bin>


More information about the libc-commits mailing list