code: def erf(ctx, z):
      z = ctx.convert(z)
      if ctx._is_real_type(z):
          try:
              return ctx._erf(z)
          except NotImplementedError:
              pass
      if ctx._is_complex_type(z) and not z.imag:
          try:
              return type(z)(ctx._erf(z.real))
          except NotImplementedError:
              pass
      return ctx._erf_complex(z)
  
imports: from .functions import defun, defun_wrapped
label_desc: Use image node_id 3 for calling a global function with example usage: erf(ctx, z) and returns: ctx, ctx, type