This is an archive of the discontinued LLVM Phabricator instance.

[libc] Implement expm1f function that is correctly rounded for all rounding modes.
ClosedPublic

Authored by lntue on Mar 13 2022, 11:29 PM.

Details

Summary

Implement expm1f function that is correctly rounded for all rounding modes. This is based on expf implementation.

From exhaustive testings, using expf implementation, and subtract 1.0 before rounding the final result to single precision
gives correctly rounded results for all |x| > 2^-4 with 1 exception. When |x| < 2^-25, we use x + x^2 (implemented with a
single fma). And for 2^-25 <= |x| <= 2^-4, we use a single degree-8 minimax polynomial generated by Sollya.

Diff Detail

Event Timeline

lntue created this revision.Mar 13 2022, 11:29 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 13 2022, 11:29 PM
lntue requested review of this revision.Mar 13 2022, 11:29 PM
sivachandra accepted this revision.Mar 15 2022, 2:09 AM

OK for structure.

This revision is now accepted and ready to land.Mar 15 2022, 2:09 AM
zimmermann6 accepted this revision.Mar 15 2022, 7:00 AM

ok for me too, I confirm all exhaustive searchs do pass. Great!