'One dimensional smoothly broken power law model function'

@staticmethod
def evaluate(x, amplitude, x_break, alpha_1, alpha_2, delta):

    xx = (x / x_break)
    f = np.zeros_like(xx, subok=False)
    if isinstance(amplitude, Quantity):
        return_unit = amplitude.unit
        amplitude = amplitude.value
    else:
        return_unit = None
    logt = (np.log(xx) / delta)
    threshold = 30
    i = (logt > threshold)
    if i.max():
        f[i] = ((amplitude * (xx[i] ** (- alpha_2))) / (2.0 ** ((alpha_1 - alpha_2) * delta)))
    i = (logt < (- threshold))
    if i.max():
        f[i] = ((amplitude * (xx[i] ** (- alpha_1))) / (2.0 ** ((alpha_1 - alpha_2) * delta)))
    i = (np.abs(logt) <= threshold)
    if i.max():
        t = np.exp(logt[i])
        r = ((1.0 + t) / 2.0)
        f[i] = ((amplitude * (xx[i] ** (- alpha_1))) * (r ** ((alpha_1 - alpha_2) * delta)))
    if return_unit:
        return Quantity(f, unit=return_unit, copy=False)
    else:
        return f
