原文:https://docs.scipy.org/doc/numpy/reference/generated/numpy.expm1.html
校对:(虚位以待)
numpy.expm1(x[, out]) = <ufunc 'expm1'>对数组中的所有元素计算exp(x) - 1
| 参数: | x:array_like
|
|---|---|
| 返回: | out:ndarray
|
也可以看看
log1plog(1 + x)笔记
This function provides greater precision than exp(x) - 1 for small values of x.
例子
exp(1e-10) - 1的真值是1.00000000005e-10这个例子显示了expm1在这种情况下的优越性。
>>> np.expm1(1e-10)
1.00000000005e-10
>>> np.exp(1e-10) - 1
1.000000082740371e-10