8000 Add complex number support to `exp` by kgryte · Pull Request #451 · data-apis/array-api · GitHub
[go: up one dir, main page]

Skip to content

Add complex number support to exp #451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Specify special case in terms of cis function
  • Loading branch information
kgryte committed Jun 13, 2022
commit cb2c8df2e76c61be36099c6060dfc7dbab6302c3
6 changes: 4 additions & 2 deletions spec/API_specification/array_api/elementwise_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@ def exp(x: array, /) -> array:
- If ``a`` is a finite number and ``b`` is ``+infinity``, the result is ``NaN + NaN j``.
- If ``a`` is a finite number and ``b`` is ``NaN``, the result is ``NaN + NaN j``.
- If ``a`` is ``+infinity`` and ``b`` is either ``+0`` or ``-0``, the result is ``infinity + 0j``.
- If ``a`` is ``-infinity`` and ``b`` is a finite number, the result is ``0 + 0j``.
- If ``a`` is ``+infinity`` and ``b`` is a nonzero finite number, the result is ``infinity + infinity j``.
- If ``a`` is ``-infinity`` and ``b`` is a finite number, the result is ``+0 * cis(x_i)``.
- If ``a`` is ``+infinity`` and ``b`` is a nonzero finite number, the result is ``+infinity * cis(x_i)``.
- If ``a`` is ``-infinity`` and ``b`` is ``+infinity``, the result is ``0 + 0j`` (signs of real and imaginary components are unspecified).
- If ``a`` is ``+infinity`` and ``b`` is ``+infinity``, the result is ``infinity + NaN j`` (sign of real component is unspecified).
- If ``a`` is ``-infinity`` and ``b`` is ``NaN``, the result is ``0 + 0j`` (signs of real and imaginary components are unspecified).
Expand All @@ -547,6 +547,8 @@ def exp(x: array, /) -> array:
- If ``a`` is ``NaN`` and ``b`` is not equal to ``0``, the result is ``NaN + NaN j``.
- If ``a`` is ``NaN`` and ``b`` is ``NaN``, the result is ``NaN + NaN j``.

where ``cis(x_i)`` is ``cos(x_i) + sin(x_i)*1j``.

.. note::
The exponential function is an entire function in the complex plane and has no branch cuts.

Expand Down
0