scijit.interpolate.splder_ev

scijit.interpolate.splder_ev(x, tck, nu=1)

Evaluate the nu-th derivative of a spline.

Named splder_ev, not splder, on purpose: scipy.interpolate. splder returns the derivative spline’s tck, and that role is filled in this package by splder (also exported as splder). This function EVALUATES.

Parameters:
x1-D float64 ndarray

Points to evaluate at.

tcktuple of (t, c, k)

Spline representation.

nuint, optional

Derivative order, 0 <= nu <= k. Default 1.

Returns:
y1-D float64 ndarray, same length as x

Derivative values, extrapolated outside the knot range.

Raises:
ValueError

If nu is outside 0..k, or if c holds fewer than len(t) - k - 1 coefficients.

Notes

scipy publishes no splder_ev. It reaches the same computation as splev(x, tck, nu), which this package also provides under the name splev.

prange-safe: yes.

Examples

>>> import numpy as np
>>> from numba import njit
>>> from scijit.interpolate import splrep, splder_ev
>>> x = np.linspace(0, 4, 40)
>>> tck = splrep(x, np.sin(x))
>>> @njit
... def slope(tck, q):
...     return splder_ev(q, tck, 1)
>>> float(np.round(slope(tck, np.array([0.0]))[0], 6))
1.000019