Skip to content

PR: Add logaddexp to the spec #124

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 3 commits into from
Feb 11, 2021
Merged
Changes from all commits
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
31 changes: 31 additions & 0 deletions spec/API_specification/elementwise_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,37 @@ For floating-point operands,

- an array containing the evaluated base `10` logarithm for each element in `x`. The returned array must have a floating-point data type determined by {ref}`type-promotion`.

(function-logaddexp)=
### logaddexp(x1, x2)

Calculates the logarithm of the sum of exponentiations `log(exp(x1) + exp(x2))` for
each element `x1_i` of the input array `x1` with the respective element `x2_i` of the input array
`x2`.

#### Special Cases

For floating-point operands,

- If `x1_i` or `x2_i` is `NaN`, the result is `NaN`.
- If `x1_i` or `x2_i` is `+infinity`, the result is `+infinity`.

#### Parameters

- **x1**: _<array>_

- first input array.

- **x2**: _<array>_

- second input array. Must be compatible with `x1` (see {ref}`broadcasting`).

#### Returns

- **out**: _<array>_

- an array containing the element-wise results. The returned array must have a floating-point
data type determined by {ref}`type-promotion`.

(function-logical_and)=
### logical_and(x1, x2, /)

Expand Down