llvm-project/libc/src
Tue Ly 6168b42225 [libc] Improve the performance of expf.
Reduce the polynomial's degree from 7 down to 4.

Currently we use a degree-7 minimax polynomial on an interval of length 2^-7
around 0 to compute `expf`. Based on the suggestion of @santoshn and the RLIBM
project (https://github.com/rutgers-apl/rlibm-all/blob/main/source/float/exp.c)
and the improvement we made with `exp2f` in https://reviews.llvm.org/D122346,
it is possible to have a good polynomial of degree-4 on a subinterval of length
2^(-7) to approximate e^x.

We did try to either reduce the degree of the polynomial down to 3 or increase
the interval size to 2^(-6), but in both cases the number of exceptional values
exploded. So we settle with using a degree-4 polynomial of the interval of
size 2^(-7) around 0.

Reviewed By: sivachandra, zimmermann6, santoshn

Differential Revision: https://reviews.llvm.org/D122418
2022-03-25 12:20:20 -04:00
..
__support [libc] Change FEnv to use MXCSR as source of truth 2022-03-23 16:08:00 -07:00
assert [libc][NFC] Remove all Linux specific code to respective linux/ directories 2022-02-08 18:32:18 +00:00
ctype [libc][NFC] Add explicit casts to ctype functions 2021-08-23 18:17:20 +00:00
errno [libc] Make the errno macro resolve to the thread local variable directly. 2022-03-04 17:29:49 +00:00
fcntl [libc] Make the errno macro resolve to the thread local variable directly. 2022-03-04 17:29:49 +00:00
fenv [libc] Remove the redundant header FPUtil/FEnvUtils.h 2022-03-04 14:09:47 -05:00
inttypes [libc] apply new lint rules 2021-12-07 10:49:47 -08:00
math [libc] Improve the performance of expf. 2022-03-25 12:20:20 -04:00
signal [libc] Make the errno macro resolve to the thread local variable directly. 2022-03-04 17:29:49 +00:00
stdio [libc] Add implementations of fopen, flose, fread, fwrite and fseek. 2022-03-24 04:20:12 +00:00
stdlib [libc][obvious] add aligned_alloc as entrypoint 2022-03-23 16:44:15 -07:00
string [libc][NFC] split standalone_cpp into single headers 2022-03-08 11:56:08 -08:00
sys [libc] Make the errno macro resolve to the thread local variable directly. 2022-03-04 17:29:49 +00:00
threads [libc][NFC] Add the platform independent file target only if mutex is available. 2022-03-18 03:34:38 +00:00
time [libc] Make the errno macro resolve to the thread local variable directly. 2022-03-04 17:29:49 +00:00
unistd [libc] Add implementation of POSIX lseek function. 2022-03-15 16:24:48 +00:00
.clang-tidy [libc] Add a .clang-tidy file for the toplevel libc directory. 2021-12-09 00:19:25 +00:00
CMakeLists.txt [libc] Add POSIX close, fsync, open, read and write functions. 2022-01-27 20:32:02 +00:00