code: def _gamma3(ctx, z, a, b, regularized=False):
      pole = ctx.isnpint(z)
      if regularized and pole:
          return ctx.zero
      try:
          ctx.prec += 15
          # We don't know in advance whether it's better to write as a difference
          # of lower or upper gamma functions, so try both
          T1 = ctx.gammainc(z, a, regularized=regularized)
          T2 = ctx.gammainc(z, b, regularized=regularized)
          R = T1 - T2
          if ctx.mag(R) - max(ctx.mag(T1), ctx.mag(T2)) > -10:
              return R
          if not pole:
              T1 = ctx.gammainc(z, 0, b, regularized=regularized)
              T2 = ctx.gammainc(z, 0, a, regularized=regularized)
              R = T1 - T2
              # May be ok, but should probably at least print a warning
              # about possible cancellation
              if 1:  # ctx.mag(R) - max(ctx.mag(T1), ctx.mag(T2)) > -10:
                  return R
      finally:
          ctx.prec -= 15
      raise NotImplementedError
  
imports: from .functions import defun, defun_wrapped
label_desc: Use image node_id 14 for calling a global function with example usage: _gamma3(ctx, z, a, b, regularized) and returns: ctx, R, R