llvm-project/libc/test/src/math
Tue Ly a5466f0436 [libc] Improve the performance of expm1f.
Improve the performance of expm1f:
- Rearrange the selection logic for different cases to improve the overall
throughput.
- Use the same degree-4 polynomial for large inputs as `expf`
(https://reviews.llvm.org/D122418), reduced from a degree-7 polynomial.

Performance benchmark using perf tool from CORE-MATH project
(https://gitlab.inria.fr/core-math/core-math/-/tree/master):
Before this patch:
```
$ ./perf.sh expm1f

CORE-MATH reciprocal throughput   : 15.362
System LIBC reciprocal throughput : 53.288
LIBC reciprocal throughput        : 54.572

$ ./perf.sh expm1f --latency

CORE-MATH latency   : 57.759
System LIBC latency : 147.146
LIBC latency        : 118.057
```

After this patch:
```
$ ./perf.sh expm1f

CORE-MATH reciprocal throughput   : 15.359
System LIBC reciprocal throughput : 53.188
LIBC reciprocal throughput        : 14.600

$ ./perf.sh expm1f --latency

CORE-MATH latency   : 57.774
System LIBC latency : 147.119
LIBC latency        : 60.280

```

Reviewed By: michaelrj, santoshn, zimmermann6

Differential Revision: https://reviews.llvm.org/D122538
2022-03-30 19:23:25 -04:00
..
differential_testing [libc] Improve hypotf performance with different algorithm correctly rounded to all rounding modes. 2022-02-16 09:48:51 -05:00
exhaustive [libc] Improve the performance of expm1f. 2022-03-30 19:23:25 -04:00
generic [libc][nfc] move ctype_utils and FPUtils to __support 2021-08-06 17:29:41 +00:00
CMakeLists.txt [libc][NFC] split standalone_cpp into single headers 2022-03-08 11:56:08 -08:00
CeilTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
CopySignTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
FAbsTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
FDimTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
FMaxTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
FMinTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
FloorTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
FmaTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
FrexpTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
HypotTest.h [libc] Implement correct rounding with all rounding modes for hypot functions. 2022-01-20 13:33:20 -05:00
ILogbTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
LdExpTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
LogbTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
ModfTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
NextAfterTest.h [libc] Replace type punning with bit_cast 2022-02-08 20:45:59 +00:00
RIntTest.h [libc] Remove the redundant header FPUtil/FEnvUtils.h 2022-03-04 14:09:47 -05:00
RemQuoTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
RoundTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
RoundToIntegerTest.h [libc] Initial support for darwin-aarch64. 2022-03-10 09:26:09 -05:00
SqrtTest.h [libc] Replace type punning with bit_cast 2022-02-08 20:45:59 +00:00
TruncTest.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
ceil_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
ceilf_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
ceill_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
copysign_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
copysignf_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
copysignl_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
cos_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
cosf_test.cpp [libc] Add testing macros for errno and floating point exceptions. 2022-03-08 15:49:43 -05:00
exp2f_test.cpp [libc] Improve the performance of exp2f. 2022-03-24 18:06:37 -04:00
expf_test.cpp [libc] Improve the performance of expf. 2022-03-25 12:20:20 -04:00
expm1f_test.cpp [libc] Improve the performance of expm1f. 2022-03-30 19:23:25 -04:00
fabs_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
fabsf_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
fabsl_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
fdim_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
fdimf_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
fdiml_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
floor_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
floorf_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
floorl_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
fma_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
fmaf_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
fmax_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
fmaxf_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
fmaxl_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
fmin_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
fminf_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
fminl_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
frexp_test.cpp [libc][NFC] Remove few deprecated FPUtil header files and test patterns. 2021-06-30 22:09:23 +00:00
frexpf_test.cpp [libc][NFC] Remove few deprecated FPUtil header files and test patterns. 2021-06-30 22:09:23 +00:00
frexpl_test.cpp [libc][NFC] Remove few deprecated FPUtil header files and test patterns. 2021-06-30 22:09:23 +00:00
generic_sqrt_test.cpp [libc] Refactor sqrt implementations and add tests for generic sqrt implementations. 2022-01-28 13:39:03 -05:00
generic_sqrtf_test.cpp [libc] Refactor sqrt implementations and add tests for generic sqrt implementations. 2022-01-28 13:39:03 -05:00
generic_sqrtl_test.cpp [libc] Refactor sqrt implementations and add tests for generic sqrt implementations. 2022-01-28 13:39:03 -05:00
hypot_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
hypotf_hard_to_round.h [libc] Improve hypotf performance with different algorithm correctly rounded to all rounding modes. 2022-02-16 09:48:51 -05:00
hypotf_test.cpp [libc] Implement correct rounding with all rounding modes for hypot functions. 2022-01-20 13:33:20 -05:00
ilogb_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
ilogbf_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
ilogbl_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
ldexp_test.cpp [libc][NFC][Obvious] Remove few unnecessary #include directives in tests. 2020-12-15 21:41:44 -08:00
ldexpf_test.cpp [libc][NFC][Obvious] Remove few unnecessary #include directives in tests. 2020-12-15 21:41:44 -08:00
ldexpl_test.cpp [libc][NFC][Obvious] Remove few unnecessary #include directives in tests. 2020-12-15 21:41:44 -08:00
llrint_test.cpp [libc] Add implementations of rounding functions which depend rounding mode. 2020-12-29 22:22:02 -08:00
llrintf_test.cpp [libc] Add implementations of rounding functions which depend rounding mode. 2020-12-29 22:22:02 -08:00
llrintl_test.cpp [libc] Add implementations of rounding functions which depend rounding mode. 2020-12-29 22:22:02 -08:00
llround_test.cpp [libc][NFC][Obvious] Remove few unnecessary #include directives in tests. 2020-12-15 21:41:44 -08:00
llroundf_test.cpp [libc][NFC][Obvious] Remove few unnecessary #include directives in tests. 2020-12-15 21:41:44 -08:00
llroundl_test.cpp [libc][NFC][Obvious] Remove few unnecessary #include directives in tests. 2020-12-15 21:41:44 -08:00
log1pf_test.cpp [libc] Implement log1pf correctly rounded to all rounding modes. 2022-02-07 16:17:18 -05:00
log2f_test.cpp [libc] Make log2f correctly rounded for all rounding modes when FMA is not available. 2022-01-20 16:16:11 -05:00
log10f_test.cpp [libc] Implement log10f correctly rounded for all rounding modes. 2022-01-25 10:33:39 -05:00
logb_test.cpp [libc][NFC] Remove few deprecated FPUtil header files and test patterns. 2021-06-30 22:09:23 +00:00
logbf_test.cpp [libc][NFC] Remove few deprecated FPUtil header files and test patterns. 2021-06-30 22:09:23 +00:00
logbl_test.cpp [libc][NFC] Remove few deprecated FPUtil header files and test patterns. 2021-06-30 22:09:23 +00:00
logf_test.cpp [libc] Make logf function correctly rounded for all rounding modes. 2022-01-25 15:22:21 -05:00
lrint_test.cpp [libc] Add implementations of rounding functions which depend rounding mode. 2020-12-29 22:22:02 -08:00
lrintf_test.cpp [libc] Add implementations of rounding functions which depend rounding mode. 2020-12-29 22:22:02 -08:00
lrintl_test.cpp [libc] Add implementations of rounding functions which depend rounding mode. 2020-12-29 22:22:02 -08:00
lround_test.cpp [libc][NFC][Obvious] Remove few unnecessary #include directives in tests. 2020-12-15 21:41:44 -08:00
lroundf_test.cpp [libc][NFC][Obvious] Remove few unnecessary #include directives in tests. 2020-12-15 21:41:44 -08:00
lroundl_test.cpp [libc][NFC][Obvious] Remove few unnecessary #include directives in tests. 2020-12-15 21:41:44 -08:00
mod_k_pi_test.cpp [libc][NFC] Move test related pieces from FPUtil to util/UnitTest. 2021-10-29 15:37:30 +00:00
modf_test.cpp [libc][NFC] Remove few deprecated FPUtil header files and test patterns. 2021-06-30 22:09:23 +00:00
modff_test.cpp [libc][NFC] Remove few deprecated FPUtil header files and test patterns. 2021-06-30 22:09:23 +00:00
modfl_test.cpp [libc][NFC] Remove few deprecated FPUtil header files and test patterns. 2021-06-30 22:09:23 +00:00
nextafter_test.cpp [libc] Add implementations of nextafter[f|l] functions. 2021-01-05 22:32:39 -08:00
nextafterf_test.cpp [libc] Add implementations of nextafter[f|l] functions. 2021-01-05 22:32:39 -08:00
nextafterl_test.cpp [libc] Add implementations of nextafter[f|l] functions. 2021-01-05 22:32:39 -08:00
remquo_test.cpp [libc] Fix couple of corner cases in remquo. 2020-12-02 11:48:49 -08:00
remquof_test.cpp [libc] Fix couple of corner cases in remquo. 2020-12-02 11:48:49 -08:00
remquol_test.cpp [libc] Fix couple of corner cases in remquo. 2020-12-02 11:48:49 -08:00
rint_test.cpp [libc] Add implementations of rounding functions which depend rounding mode. 2020-12-29 22:22:02 -08:00
rintf_test.cpp [libc] Add implementations of rounding functions which depend rounding mode. 2020-12-29 22:22:02 -08:00
rintl_test.cpp [libc] Add implementations of rounding functions which depend rounding mode. 2020-12-29 22:22:02 -08:00
round_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
roundf_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
roundl_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
sdcomp26094.h [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
sin_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
sincosf_test.cpp [libc] Add testing macros for errno and floating point exceptions. 2022-03-08 15:49:43 -05:00
sinf_test.cpp [libc] Add testing macros for errno and floating point exceptions. 2022-03-08 15:49:43 -05:00
sqrt_test.cpp [libc][NFC] Add common template test class for sqrt, sqrtf and sqrtl. 2021-04-17 05:13:27 +00:00
sqrtf_test.cpp [libc][NFC] Add common template test class for sqrt, sqrtf and sqrtl. 2021-04-17 05:13:27 +00:00
sqrtl_test.cpp [libc][NFC] Add common template test class for sqrt, sqrtf and sqrtl. 2021-04-17 05:13:27 +00:00
tan_test.cpp [libc] apply formatting to tests 2021-12-22 10:53:25 -08:00
trunc_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
truncf_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00
truncl_test.cpp [libc][NFC] Add template tests for a bunch of math functions. 2021-04-16 17:28:17 +00:00