MCPcopy Create free account
hub / github.com/numpy/numpy / _zseries_der

Function _zseries_der

numpy/polynomial/chebyshev.py:276–305  ·  view source on GitHub ↗

Differentiate a z-series. The derivative is with respect to x, not z. This is achieved using the chain rule and the value of dx/dz given in the module notes. Parameters ---------- zs : z-series The z-series to differentiate. Returns ------- derivative : z-s

(zs)

Source from the content-addressed store, hash-verified

274
275
276def _zseries_der(zs):
277 """Differentiate a z-series.
278
279 The derivative is with respect to x, not z. This is achieved using the
280 chain rule and the value of dx/dz given in the module notes.
281
282 Parameters
283 ----------
284 zs : z-series
285 The z-series to differentiate.
286
287 Returns
288 -------
289 derivative : z-series
290 The derivative
291
292 Notes
293 -----
294 The zseries for x (ns) has been multiplied by two in order to avoid
295 using floats that are incompatible with Decimal and likely other
296 specialized scalar types. This scaling has been compensated by
297 multiplying the value of zs by two also so that the two cancels in the
298 division.
299
300 """
301 n = len(zs) // 2
302 ns = np.array([-1, 0, 1], dtype=zs.dtype)
303 zs *= np.arange(-n, n + 1) * 2
304 d, r = _zseries_div(zs, ns)
305 return d
306
307
308def _zseries_int(zs):

Callers

nothing calls this directly

Calls 1

_zseries_divFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…