expm1() And log1p()¶
In PHP, expm1() computes exp(x) - 1.
log1p() computes log(1 + x).
“Why not just write exp($x) - 1” you may ask…
Because when x is close to 0, floating point eats your precision alive. Think about it if you deal with finance!
These two functions exist solely to save your math from IEEE 754.