def _der(self, x):
    '\n        Returns the first derivative of the interpolated function at each value\n        in x. Only called internally by HARKinterpolator1D.derivative (etc).\n        '
    if _isscalar(x):
        pos = np.searchsorted(self.x_list, x)
        if (pos == 0):
            dydx = self.coeffs[(0, 1)]
        elif (pos < self.n):
            alpha = ((x - self.x_list[(pos - 1)]) / (self.x_list[pos] - self.x_list[(pos - 1)]))
            dydx = ((self.coeffs[(pos, 1)] + (alpha * ((2 * self.coeffs[(pos, 2)]) + ((alpha * 3) * self.coeffs[(pos, 3)])))) / (self.x_list[pos] - self.x_list[(pos - 1)]))
        else:
            alpha = (x - self.x_list[(self.n - 1)])
            dydx = (self.coeffs[(pos, 1)] - ((self.coeffs[(pos, 2)] * self.coeffs[(pos, 3)]) * np.exp((alpha * self.coeffs[(pos, 3)]))))
    else:
        m = len(x)
        pos = np.searchsorted(self.x_list, x)
        dydx = np.zeros(m)
        if (dydx.size > 0):
            out_bot = (pos == 0)
            out_top = (pos == self.n)
            in_bnds = np.logical_not(np.logical_or(out_bot, out_top))
            i = pos[in_bnds]
            coeffs_in = self.coeffs[i, :]
            alpha = ((x[in_bnds] - self.x_list[(i - 1)]) / (self.x_list[i] - self.x_list[(i - 1)]))
            dydx[in_bnds] = ((coeffs_in[:, 1] + (alpha * ((2 * coeffs_in[:, 2]) + ((alpha * 3) * coeffs_in[:, 3])))) / (self.x_list[i] - self.x_list[(i - 1)]))
            dydx[out_bot] = self.coeffs[(0, 1)]
            alpha = (x[out_top] - self.x_list[(self.n - 1)])
            dydx[out_top] = (self.coeffs[(self.n, 1)] - ((self.coeffs[(self.n, 2)] * self.coeffs[(self.n, 3)]) * np.exp((alpha * self.coeffs[(self.n, 3)]))))
    return dydx
Returns the first derivative of the interpolated function at each value
in x. Only called internally by HARKinterpolator1D.derivative (etc).
def _der(self, x):
    '\n        Returns the first derivative of the interpolated function at each value\n        in x. Only called internally by HARKinterpolator1D.derivative (etc).\n        '
    if _isscalar(x):
        pos = np.searchsorted(self.x_list, x)
        if (pos == 0):
            dydx = self.coeffs[(0, 1)]
        elif (pos < self.n):
            alpha = ((x - self.x_list[(pos - 1)]) / (self.x_list[pos] - self.x_list[(pos - 1)]))
            dydx = ((self.coeffs[(pos, 1)] + (alpha * ((2 * self.coeffs[(pos, 2)]) + ((alpha * 3) * self.coeffs[(pos, 3)])))) / (self.x_list[pos] - self.x_list[(pos - 1)]))
        else:
            alpha = (x - self.x_list[(self.n - 1)])
            dydx = (self.coeffs[(pos, 1)] - ((self.coeffs[(pos, 2)] * self.coeffs[(pos, 3)]) * np.exp((alpha * self.coeffs[(pos, 3)]))))
    else:
        m = len(x)
        pos = np.searchsorted(self.x_list, x)
        dydx = np.zeros(m)
        if (dydx.size > 0):
            out_bot = (pos == 0)
            out_top = (pos == self.n)
            in_bnds = np.logical_not(np.logical_or(out_bot, out_top))
            i = pos[in_bnds]
            coeffs_in = self.coeffs[i, :]
            alpha = ((x[in_bnds] - self.x_list[(i - 1)]) / (self.x_list[i] - self.x_list[(i - 1)]))
            dydx[in_bnds] = ((coeffs_in[:, 1] + (alpha * ((2 * coeffs_in[:, 2]) + ((alpha * 3) * coeffs_in[:, 3])))) / (self.x_list[i] - self.x_list[(i - 1)]))
            dydx[out_bot] = self.coeffs[(0, 1)]
            alpha = (x[out_top] - self.x_list[(self.n - 1)])
            dydx[out_top] = (self.coeffs[(self.n, 1)] - ((self.coeffs[(self.n, 2)] * self.coeffs[(self.n, 3)]) * np.exp((alpha * self.coeffs[(self.n, 3)]))))
    return dydx