Returns the coefficients of the derivative of specified order of a polynomial.
JAX implementation of numpy.polyder()
.
p (ArrayLike) – Array of polynomials coefficients.
m (int) – Order of differentiation (positive integer). Default is 1. It must be specified statically.
An array of polynomial coefficients representing the derivative.
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
.
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)
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