logaddexp2#
- class saiunit.math.logaddexp2(x, y, unit_to_scale=None, **kwargs)#
Logarithm of the sum of exponentiations of the inputs in base 2.
Computes
log2(2**x + 2**y)in a numerically stable way.- Parameters:
- Returns:
out – Element-wise
log2(2**x + 2**y).- Return type:
Array
Examples
>>> import saiunit as u >>> import jax.numpy as jnp >>> u.math.logaddexp2(jnp.array([1.0]), jnp.array([2.0])) Array([2.321928], dtype=float32)