Use expm1f(x) = exp(x) - 1 for |x| > ln(2).

For |x| <= ln(2), divide it into 3 subintervals: [-ln2, -1/8], [-1/8, 1/8], [1/8, 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.

# Details

Details

- Reviewers
sivachandra - Commits
- rG4e5f8b4d8d9d: [libc] Add implementation of expm1f.

# Diff Detail

Diff Detail

- Repository
- rG LLVM Github Monorepo

### Event Timeline

Comment Actions

LGTM but I have added a comment to add a sollya script. Good to go after that.

libc/src/math/generic/expm1f.cpp | ||
---|---|---|

29 | I think we should add a sollya script for this under a directory named | |

libc/test/src/math/expm1f_test.cpp | ||

32 | Nitty nit: The name should probably be |

Comment Actions

Add more detail about generating polynomial coefficients with Sollya to utils/mathtools/expm1f.sollya.

Add differential and perf tests.