jax.numpy.float_power

Contents

jax.numpy.float_power#

jax.numpy.float_power(x, y, /)[source]#

First array elements raised to powers from second array, element-wise.

LAX-backend implementation of numpy.float_power().

Original docstring below.

Raise each base in x1 to the positionally-corresponding power in x2. x1 and x2 must be broadcastable to the same shape. This differs from the power function in that integers, float16, and float32 are promoted to floats with a minimum precision of float64 so that the result is always inexact. The intent is that the function will return a usable result for negative powers and seldom overflow for positive powers.

Negative values raised to a non-integral value will return nan. To get complex results, cast the input to complex, or specify the dtype to be complex (see the example below).

Added in version 1.12.0.

Returns:

y – The bases in x1 raised to the exponents in x2. This is a scalar if both x1 and x2 are scalars.

Return type:

ndarray

Parameters:
  • x (jax.typing.ArrayLike)

  • y (jax.typing.ArrayLike)