You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add complex number support to `expm1`
* Update copy
* Add note concerning complex conjugation
* Specify special cases in terms of `cis` function
* Fix special cases and move note
* Move note
* Move note
Calculates an implementation-dependent approximation to ``exp(x)-1``, having domain ``[-infinity, +infinity]`` and codomain ``[-1, +infinity]``, for each element ``x_i`` of the input array ``x``.
645
+
Calculates an implementation-dependent approximation to ``exp(x)-1`` for each element ``x_i`` of the input array ``x``.
646
646
647
647
.. note::
648
648
The purpose of this function is to calculate ``exp(x)-1.0`` more accurately when `x` is close to zero. Accordingly, conforming implementations should avoid implementing this function as simply ``exp(x)-1.0``. See FDLIBM, or some other IEEE 754-2019 compliant mathematical library, for a potential reference implementation.
649
649
650
650
**Special cases**
651
651
652
-
For floating-point operands,
652
+
For real-valued floating-point operands,
653
653
654
654
- If ``x_i`` is ``NaN``, the result is ``NaN``.
655
655
- If ``x_i`` is ``+0``, the result is ``+0``.
656
656
- If ``x_i`` is ``-0``, the result is ``-0``.
657
657
- If ``x_i`` is ``+infinity``, the result is ``+infinity``.
658
658
- If ``x_i`` is ``-infinity``, the result is ``-1``.
659
659
660
+
For complex floating-point operands, let ``a = real(x_i)``, ``b = imag(x_i)``, and
661
+
662
+
- If ``a`` is either ``+0`` or ``-0`` and ``b`` is ``+0``, the result is ``0 + 0j``.
663
+
- If ``a`` is a finite number and ``b`` is ``+infinity``, the result is ``NaN + NaN j``.
664
+
- If ``a`` is a finite number and ``b`` is ``NaN``, the result is ``NaN + NaN j``.
665
+
- If ``a`` is ``+infinity`` and ``b`` is ``+0``, the result is ``+infinity + 0j``.
666
+
- If ``a`` is ``-infinity`` and ``b`` is a finite number, the result is ``+0 * cis(b) - 1.0``.
667
+
- If ``a`` is ``+infinity`` and ``b`` is a nonzero finite number, the result is ``+infinity * cis(b) - 1.0``.
668
+
- If ``a`` is ``-infinity`` and ``b`` is ``+infinity``, the result is ``-1 + 0j`` (sign of imaginary component is unspecified).
669
+
- If ``a`` is ``+infinity`` and ``b`` is ``+infinity``, the result is ``infinity + NaN j`` (sign of real component is unspecified).
670
+
- If ``a`` is ``-infinity`` and ``b`` is ``NaN``, the result is ``-1 + 0j`` (sign of imaginary component is unspecified).
671
+
- If ``a`` is ``+infinity`` and ``b`` is ``NaN``, the result is ``infinity + NaN j`` (sign of real component is unspecified).
672
+
- If ``a`` is ``NaN`` and ``b`` is ``+0``, the result is ``NaN + 0j``.
673
+
- If ``a`` is ``NaN`` and ``b`` is not equal to ``0``, the result is ``NaN + NaN j``.
674
+
- If ``a`` is ``NaN`` and ``b`` is ``NaN``, the result is ``NaN + NaN j``.
675
+
676
+
where ``cis(v)`` is ``cos(v) + sin(v)*1j``.
677
+
678
+
.. note::
679
+
For complex floating-point operands, ``expm1(conj(x))`` must equal ``conj(expm1(x))``.
680
+
681
+
.. note::
682
+
The exponential function is an entire function in the complex plane and has no branch cuts.
683
+
660
684
Parameters
661
685
----------
662
686
x: array
663
-
input array. Should have a real-valued floating-point data type.
687
+
input array. Should have a floating-point data type.
664
688
665
689
Returns
666
690
-------
667
691
out: array
668
-
an array containing the evaluated result for each element in ``x``. The returned array must have a real-valued floating-point data type determined by :ref:`type-promotion`.
692
+
an array containing the evaluated result for each element in ``x``. The returned array must have a floating-point data type determined by :ref:`type-promotion`.
0 commit comments