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