code: def mpf_erfc(x, prec, rnd=round_fast):
      sign, man, exp, bc = x
      if not man:
          if x == fzero:
              return fone
          if x == finf:
              return fzero
          if x == fninf:
              return ftwo
          return fnan
      wp = prec + 20
      mag = bc + exp
      # Preserve full accuracy when exponent grows huge
      wp += max(0, 2 * mag)
      regular_erf = sign or mag < 2
      if regular_erf or not erfc_check_series(x, wp):
          if regular_erf:
              return mpf_sub(
                  fone,
                  mpf_erf(x, prec + 10, negative_rnd[rnd]),
                  prec,
                  rnd,
              )
          # 1-erf(x) ~ exp(-x^2), increase prec to deal with cancellation
          n = to_int(x) + 1
          return mpf_sub(
              fone,
              mpf_erf(x, prec + int(n**2 * 1.44) + 10),
              prec,
              rnd,
          )
      s = term = MPZ_ONE << wp
      term_prev = 0
      t = (2 * to_fixed(x, wp) ** 2) >> wp
      k = 1
      while 1:
          term = ((term * (2 * k - 1)) << wp) // t
          if k > 4 and term > term_prev or not term:
              break
          if k & 1:
              s -= term
          else:
              s += term
          term_prev = term
          # print k, to_str(from_man_exp(term, -wp, 50), 10)
          k += 1
      s = (s << wp) // sqrt_fixed(pi_fixed(wp), wp)
      s = from_man_exp(s, -wp, wp)
      z = mpf_exp(mpf_neg(mpf_mul(x, x, wp), wp), wp)
      y = mpf_div(mpf_mul(z, s, wp), x, prec, rnd)
      return y
  
imports: import operator
  import math
  from .backend import MPZ_ZERO, MPZ_ONE, BACKEND, xrange, exec_
  from .libintmath import gcd
  from .libmpf import ComplexResult, round_fast, round_nearest, negative_rnd, bitcount, to_fixed, from_man_exp, from_int, to_int, from_rational, fzero, fone, fnone, ftwo, finf, fninf, fnan, mpf_sign, mpf_add, mpf_abs, mpf_pos, mpf_cmp, mpf_lt, mpf_le, mpf_gt, mpf_min_max, mpf_perturb, mpf_neg, mpf_shift, mpf_sub, mpf_mul, mpf_div, sqrt_fixed, mpf_sqrt, mpf_rdiv_int, mpf_pow_int, to_rational
  from .libelefun import mpf_pi, mpf_exp, mpf_log, pi_fixed, mpf_cos_sin, mpf_cos, mpf_sin, mpf_sqrt, agm_fixed
  from .libmpc import mpc_one, mpc_sub, mpc_mul_mpf, mpc_mul, mpc_neg, complex_int_pow, mpc_div, mpc_add_mpf, mpc_sub_mpf, mpc_log, mpc_add, mpc_pos, mpc_shift, mpc_is_infnan, mpc_zero, mpc_sqrt, mpc_abs, mpc_mpf_div, mpc_square, mpc_exp
  from .libintmath import ifac
  from .gammazeta import mpf_gamma_int, mpf_euler, euler_fixed
label_desc: Use image node_id 4 for calling a global function with example usage: mpf_erfc(x, prec, rnd) and returns: y, fnan, mpf_sub, fone, fzero, ftwo, mpf_sub