Я запутался в использовании функции expm1 в java Документ Oracle Java для Math.expm1 говорит:
Returns exp(x) -1. Note that for values of x near 0, the exact sum of expm1(x) + 1 is much closer to the true result of ex than exp(x).
но на этой странице написано:
However, for negative values of x, roughly -4 and lower, the algorithm used to calculate Math.exp() is relatively ill-behaved and subject to round-off error. It's more accurate to calculate ex - 1 with a different algorithm and then add 1 to the final result.
должны ли мы использовать expm1 (x )для отрицательных значений x или значений, близких к 0?