code: def mpi_atan2(y, x, prec):
      ya, yb = y
      xa, xb = x
      # Constrained to the real line
      if ya == yb == fzero:
          if mpf_ge(xa, fzero):
              return mpi_zero
          return mpi_pi(prec)
      # Right half-plane
      if mpf_ge(xa, fzero):
          if mpf_ge(ya, fzero):
              a = mpf_atan2(ya, xb, prec, round_floor)
          else:
              a = mpf_atan2(ya, xa, prec, round_floor)
          if mpf_ge(yb, fzero):
              b = mpf_atan2(yb, xa, prec, round_ceiling)
          else:
              b = mpf_atan2(yb, xb, prec, round_ceiling)
      # Upper half-plane
      elif mpf_ge(ya, fzero):
          b = mpf_atan2(ya, xa, prec, round_ceiling)
          if mpf_le(xb, fzero):
              a = mpf_atan2(yb, xb, prec, round_floor)
          else:
              a = mpf_atan2(ya, xb, prec, round_floor)
      # Lower half-plane
      elif mpf_le(yb, fzero):
          a = mpf_atan2(yb, xa, prec, round_floor)
          if mpf_le(xb, fzero):
              b = mpf_atan2(ya, xb, prec, round_ceiling)
          else:
              b = mpf_atan2(yb, xb, prec, round_ceiling)
      # Covering the origin
      else:
          b = mpf_pi(prec, round_ceiling)
          a = mpf_neg(b)
      return a, b
  
imports: from .backend import xrange
  from .libmpf import ComplexResult, round_down, round_up, round_floor, round_ceiling, round_nearest, prec_to_dps, repr_dps, dps_to_prec, bitcount, from_float, fnan, finf, fninf, fzero, fhalf, fone, fnone, mpf_sign, mpf_lt, mpf_le, mpf_gt, mpf_ge, mpf_eq, mpf_cmp, mpf_min_max, mpf_floor, from_int, to_int, to_str, from_str, mpf_abs, mpf_neg, mpf_pos, mpf_add, mpf_sub, mpf_mul, mpf_mul_int, mpf_div, mpf_shift, mpf_pow_int, from_man_exp, MPZ_ONE
  from .libelefun import mpf_log, mpf_exp, mpf_sqrt, mpf_atan, mpf_atan2, mpf_pi, mod_pi2, mpf_cos_sin
  from .gammazeta import mpf_gamma, mpf_rgamma, mpf_loggamma, mpc_loggamma
label_desc: Use image node_id 50 for calling a global function with example usage: mpi_atan2(y, x, prec) and returns: a,  b, mpi_pi, mpi_zero