[libc-commits] [PATCH] D127951: [libc][math] New common algorithm for expf/expm1f/exp2f.
Kirill Okhotnikov via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Jun 16 05:03:22 PDT 2022
orex created this revision.
orex added reviewers: lntue, sivachandra.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added projects: libc-project, All.
orex edited the summary of this revision.
orex edited the summary of this revision.
orex published this revision for review.
A new algorithms for expf/expm1f/exp2f introduced:
1. Lookup tables size for expf/expm1f/exp2f reduced 12 times!
2. Common algorithm for all 3 functions. The same code for expf/expm1f.
3. Improved precision: number of exceptional cases reduced from 9 to 2.
4. More reliable algorithm. It uses pure mathematic and do not rely on Sollya fitting. Easy change of lookup table size, for example.
5. FMA agnostic. FMA improves performance, but not precision. FMA emulation is not needed anymore.
6. _perf tests shows similar performance with previous implementation.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D127951
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/exp2f.cpp
libc/src/math/generic/expf.cpp
libc/src/math/generic/expm1f.cpp
libc/src/math/generic/expxf.h
libc/test/src/math/CMakeLists.txt
libc/test/src/math/exp2f_test.cpp
libc/test/src/math/expf_test.cpp
libc/test/src/math/expm1f_test.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127951.437496.patch
Type: text/x-patch
Size: 37242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220616/f67d4151/attachment-0001.bin>
More information about the libc-commits
mailing list