@defun_wrapped
def chi(ctx, z):
    nz = ctx.fneg(z, exact=True)
    v = 0.5*(ctx.ei(z) + ctx.ei(nz))
    zreal = ctx._re(z)
    zimag = ctx._im(z)
    if zimag > 0:
        v += ctx.pi*0.5j
    elif zimag < 0:
        v -= ctx.pi*0.5j
    elif 0 < zreal:
        v += ctx.pi*1j
    return v
dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/functions/expintegrals.py/chi/swapped operands of `<`