jax.numpy.arctan#

jax.numpy.arctan(x, /)[原始碼]#

計算輸入的元素級反三角正切值。

JAX 實作 numpy.arctan

參數:

x (ArrayLike) – 輸入陣列或純量。

返回:

一個陣列,包含每個元素 x 的反三角正切值,以弧度表示,範圍在 [-pi/2, pi/2] 之間,並提升為非精確 dtype。

返回型別:

Array

注意

jnp.arctan 遵循 numpy.arctan 對於複數輸入的分支切割慣例。

另請參閱

範例

>>> x = jnp.array([-jnp.inf, -20, -1, 0, 1, 20, jnp.inf])
>>> with jnp.printoptions(precision=3, suppress=True):
...   jnp.arctan(x)
Array([-1.571, -1.521, -0.785,  0.   ,  0.785,  1.521,  1.571], dtype=float32)

對於複數值輸入

>>> with jnp.printoptions(precision=3, suppress=True):
...   jnp.arctan(2+7j)
Array(1.532+0.133j, dtype=complex64, weak_type=True)