logaddexp¶
- logaddexp(x1: array, x2: array, /) array ¶
Calculates the logarithm of the sum of exponentiations
log(exp(x1) + exp(x2))
for each elementx1_i
of the input arrayx1
with the respective elementx2_i
of the input arrayx2
.Special cases
For floating-point operands,
If either
x1_i
orx2_i
isNaN
, the result isNaN
.If
x1_i
is+infinity
andx2_i
is notNaN
, the result is+infinity
.If
x1_i
is notNaN
andx2_i
is+infinity
, the result is+infinity
.
- Parameters:
x1 (array) – first input array. Should have a floating-point data type.
x2 (array) – second input array. Must be compatible with
x1
(see Broadcasting). Should have a floating-point data type.
- Returns:
out (array) – an array containing the element-wise results. The returned array must have a floating-point data type determined by Type Promotion Rules.