Split floating point values into mantissa and twos exponent.
JAX implementation of numpy.frexp()
.
x (ArrayLike) – real-valued array
A tuple (mantissa, exponent)
where mantissa
is a floating point value between -1 and 1, and exponent
is an integer such that x == mantissa * 2 ** exponent
.
Examples
Split values into mantissa and exponent:
>>> x = jnp.array([1., 2., 3., 4., 5.]) >>> m, e = jnp.frexp(x) >>> m Array([0.5 , 0.5 , 0.75 , 0.5 , 0.625], dtype=float32) >>> e Array([1, 2, 2, 3, 3], dtype=int32)
Reconstruct the original array:
>>> m * 2 ** e Array([1., 2., 3., 4., 5.], dtype=float32)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4