# megengine.functional.expm1¶

expm1(x)[源代码]

Element-wise $$e^x - 1$$ function.

Calculate the exponential of the elements minus 1 of input.

This function has domain [-infinity, +infinity] and codomain [-1, +infinity].

$y_i = e^{x_i} - 1$

x – input tensor. Should have a floating-point data type.

a tensor containing the evaluated result for each element in $$x$$. The returned tensor must have a floating-point data type determined by 类型提升规则.

This function provides greater precision than $$\exp(x) - 1$$ for small values of x. See FDLIBM, or some other IEEE 754-2019 compliant mathematical library, for a potential reference implementation.

>>> F.expm1(1e-10)
Tensor(1e-10, device=xpux:0)