code: def powm1(ctx, x, y):
      mag = ctx.mag
      one = ctx.one
      w = x**y - one
      M = mag(w)
      # Only moderate cancellation
      if M > -8:
          return w
      # Check for the only possible exact cases
      if not w:
          if (not y) or (x in (1, -1, 1j, -1j) and ctx.isint(y)):
              return w
      x1 = x - one
      magy = mag(y)
      lnx = ctx.ln(x)
      # Small y: x^y - 1 ~ log(x)*y + O(log(x)^2 * y^2)
      if magy + mag(lnx) < -ctx.prec:
          return lnx * y + (lnx * y) ** 2 / 2
      # TODO: accurately eval the smaller of the real/imag part
      return ctx.sum_accurately(lambda: iter([x**y, -1]), 1)
  
imports: from ..libmp.backend import xrange
  import math
  import cmath
label_desc: Use image node_id 22 for calling a global function with example usage: powm1(ctx, x, y) and returns: ctx, w, unknown, w