code: def mpi_div(s, t, prec):
      sa, sb = s
      ta, tb = t
      sas = mpf_sign(sa)
      sbs = mpf_sign(sb)
      tas = mpf_sign(ta)
      tbs = mpf_sign(tb)
      # 0 / X
      if sas == sbs == 0:
          # 0 / <interval containing 0>
          if (tas < 0 and tbs > 0) or (tas == 0 or tbs == 0):
              return fninf, finf
          return fzero, fzero
      # Denominator contains both negative and positive numbers;
      # this should properly be a multi-interval, but the closest
      # match is the entire (extended) real line
      if tas < 0 and tbs > 0:
          return fninf, finf
      # Assume denominator to be nonnegative
      if tas < 0:
          return mpi_div(mpi_neg(s), mpi_neg(t), prec)
      # Division by zero
      # XXX: make sure all results make sense
      if tas == 0:
          # Numerator contains both signs?
          if sas < 0 and sbs > 0:
              return fninf, finf
          if tas == tbs:
              return fninf, finf
          # Numerator positive?
          if sas >= 0:
              a = mpf_div(sa, tb, prec, round_floor)
              b = finf
          if sbs <= 0:
              a = fninf
              b = mpf_div(sb, tb, prec, round_ceiling)
      # Division with positive denominator
      # We still have to handle nans resulting from inf/0 or inf/inf
      else:
          # Nonnegative numerator
          if sas >= 0:
              a = mpf_div(sa, tb, prec, round_floor)
              b = mpf_div(sb, ta, prec, round_ceiling)
              if a == fnan:
                  a = fzero
              if b == fnan:
                  b = finf
          # Nonpositive numerator
          elif sbs <= 0:
              a = mpf_div(sa, ta, prec, round_floor)
              b = mpf_div(sb, tb, prec, round_ceiling)
              if a == fnan:
                  a = fninf
              if b == fnan:
                  b = fzero
          # Numerator contains both signs?
          else:
              a = mpf_div(sa, ta, prec, round_floor)
              b = mpf_div(sb, ta, prec, round_ceiling)
              if a == fnan:
                  a = fninf
              if b == fnan:
                  b = finf
      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 19 for calling a global function with example usage: mpi_div(s, t, prec) and returns: a,  b, fzero,  fzero, fninf,  finf, mpi_div, fninf,  finf, fninf,  finf, fninf,  finf