jax.numpy.polyder#

jax.numpy.polyder(p, m=1)[source]#

Returns the coefficients of the derivative of specified order of a polynomial.

JAX implementation of numpy.polyder().

Parameters:
  • p (ArrayLike) – Array of polynomials coefficients.

  • m (int) – Order of differentiation (positive integer). Default is 1. It must be specified statically.

Returns:

An array of polynomial coefficients representing the derivative.

Return type:

Array

Note

jax.numpy.polyder() differs from numpy.polyder() when an integer array is given. NumPy returns the result with dtype int whereas JAX returns the result with dtype float.

See also

Examples

The first order derivative of the polynomial \(2 x^3 - 5 x^2 + 3 x - 1\) is \(6 x^2 - 10 x +3\):

>>> p = jnp.array([2, -5, 3, -1])
>>> jnp.polyder(p)
Array([  6., -10.,   3.], dtype=float32)

and its second order derivative is \(12 x - 10\):

>>> jnp.polyder(p, m=2)
Array([ 12., -10.], dtype=float32)