logaddexp2#

ivy.logaddexp2(x1, x2, /, *, out=None)[source]#

Calculate log2(2**x1 + 2**x2).

Parameters:
  • x1 (Union[Array, NativeArray, float, list, tuple]) – First array-like input.

  • x2 (Union[Array, NativeArray, float, list, tuple]) – Second array-input.

  • out (Optional[Array], default: None) – optional output array, for writing the result to.

Return type:

Array

Returns:

ret – Element-wise logaddexp2 of x1 and x2.

Examples

>>> x1 = ivy.array([1, 2, 3])
>>> x2 = ivy.array([4, 5, 6])
>>> ivy.logaddexp2(x1, x2)
ivy.array([4.169925, 5.169925, 6.169925])
Array.logaddexp2(self, x2, /, *, out=None)[source]#

ivy.Array instance method variant of ivy.logaddexp2. This method simply wraps the function, and so the docstring for ivy.logaddexp2 also applies to this method with minimal changes.

Parameters:
  • self (Union[Array, float, list, tuple]) – First array-like input.

  • x2 (Union[Array, float, list, tuple]) – Second array-like input

  • out (Optional[Array], default: None) – optional output array, for writing the result to.

Return type:

Array

Returns:

ret – Element-wise logaddexp2 of x1 and x2.

Examples

>>> x1 = ivy.array([1, 2, 3])
>>> x2 = ivy.array([4, 5, 6])
>>> x1.logaddexp2(x2)
ivy.array([4.169925, 5.169925, 6.169925])
Container.logaddexp2(self, x2, /, *, out=None)[source]#

ivy.Container instance method variant of ivy.logaddexp2. This method simply wraps the function, and so the docstring for ivy.logaddexp2 also applies to this method with minimal changes.

Parameters:
  • self (Container) – first input container with array-like items.

  • x2 (Container) – second input container with array-like items.

  • out (Optional[Container], default: None) – optional output container, for writing the result to.

Return type:

Container

Returns:

ret – Container including arrays with element-wise logaddexp2 of input arrays.

Examples

>>> x1 = ivy.Container(a=ivy.array([1, 2, 3]),                               b=ivy.array([1, 2, 3]))
>>> x2 = ivy.Container(a=ivy.array([4, 5, 6]),                               b=5)
>>> x1.logaddexp2(x2)
{
    a: ivy.array([4.169925, 5.169925, 6.169925])
    b: ivy.array([5.08746284, 5.169925  , 5.32192809])
}