code: 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 zreal < 0:
          v += ctx.pi * 1j
      return v
  
imports: from .functions import defun, defun_wrapped
label_desc: Use image node_id 24 for calling a global function with example usage: chi(ctx, z) and returns: v