A new common algorithms for expf/expm1f/exp2f/sinhf/coshf introduced: 1) Lookup tables size for expf/expm1f/exp2f reduced 12 times! 2) Common algorithm for all 5 functions. The same code for expf/expm1f/sinhf/coshf. 3) Improved precision: number of exceptional cases reduced from 9 to 2 (+1 sinhf). 4) More reliable algorithm. It uses pure mathematic and do not rely on Sollya fitting. Easy change of lookup table size, for example. 5) Perf tests shows similar performance with previous implementation. 6) Core-math performance tests below (glibc 2.31)
expf | expm1f | exp2f | sinhf | coshf | |
glibc | 10.519 | 42.483 | 10.377 | 64.084 | 23.605 |
this | 14.696 | 14.518 | 20.374 | 29.922 | 33.572 |
prev | 15.003 | 12.291 | 27.201 | --- | --- |
Use all caps for constants.