A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.numpy.polysub.html below:

jax.numpy.polysub — JAX documentation

jax.numpy.polysub#
jax.numpy.polysub(a1, a2)[source]#

Returns the difference of two polynomials.

JAX implementation of numpy.polysub().

Parameters:
  • a1 (ArrayLike) – Array of minuend polynomial coefficients.

  • a2 (ArrayLike) – Array of subtrahend polynomial coefficients.

Returns:

An array containing the coefficients of the difference of two polynomials.

Return type:

Array

Examples

>>> x1 = jnp.array([2, 3])
>>> x2 = jnp.array([5, 4, 1])
>>> jnp.polysub(x1, x2)
Array([-5, -2,  2], dtype=int32)
>>> x3 = jnp.array([[2, 3, 1]])
>>> x4 = jnp.array([[5, 7, 3],
...                 [8, 2, 6]])
>>> jnp.polysub(x3, x4)
Array([[-5, -7, -3],
       [-6,  1, -5]], dtype=int32)
>>> x5 = jnp.array([1, 3, 5])
>>> x6 = jnp.array([[5, 7, 9],
...                 [8, 6, 4]])
>>> jnp.polysub(x5, x6)  
Traceback (most recent call last):
...
ValueError: Cannot broadcast to shape with fewer dimensions: arr_shape=(2, 3) shape=(2,)
>>> x7 = jnp.array([2])
>>> jnp.polysub(x6, x7)
Array([[5, 7, 9],
       [6, 4, 2]], dtype=int32)

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.3