code: def mpc_zeta(s, prec, rnd=round_fast, alt=0, force=False):
      re, im = s
      if im == fzero:
          return mpf_zeta(re, prec, rnd, alt), fzero
  
      # slow for large s
      if (not force) and mpf_gt(mpc_abs(s, 10), from_int(prec)):
          raise NotImplementedError
  
      wp = prec + 20
  
      # Near pole
      r = mpc_sub(mpc_one, s, wp)
      asign, aman, aexp, abc = mpc_abs(r, 10)
      pole_dist = -2 * (aexp + abc)
      if pole_dist > wp:
          if alt:
              q = mpf_ln2(wp)
              y = mpf_mul(q, mpf_euler(wp), wp)
              g = mpf_shift(mpf_mul(q, q, wp), -1)
              g = mpf_sub(y, g)
              z = mpc_mul_mpf(r, mpf_neg(g), wp)
              z = mpc_add_mpf(z, q, wp)
              return mpc_pos(z, prec, rnd)
          else:
              q = mpc_neg(mpc_div(mpc_one, r, wp))
              q = mpc_add_mpf(q, mpf_euler(wp), wp)
              return mpc_pos(q, prec, rnd)
      else:
          wp += max(0, pole_dist)
  
      # Reflection formula. To be rigorous, we should reflect to the left of
      # re = 1/2 (see comments for mpf_zeta), but this leads to unnecessary
      # slowdown for interesting values of s
      if mpf_lt(re, fzero):
          # XXX: could use the separate refl. formula for Dirichlet eta
          if alt:
              q = mpc_sub(
                  mpc_one,
                  mpc_pow(mpc_two, mpc_sub(mpc_one, s, wp), wp),
                  wp,
              )
              return mpc_mul(mpc_zeta(s, wp), q, prec, rnd)
          # XXX: -1 should be done exactly
          y = mpc_sub(mpc_one, s, 10 * wp)
          a = mpc_gamma(y, wp)
          b = mpc_zeta(y, wp)
          c = mpc_sin_pi(mpc_shift(s, -1), wp)
          rsign, rman, rexp, rbc = re
          isign, iman, iexp, ibc = im
          mag = max(rexp + rbc, iexp + ibc)
          wp2 = wp + max(0, mag)
          pi = mpf_pi(wp + wp2)
          pi2 = (mpf_shift(pi, 1), fzero)
          d = mpc_div_mpf(mpc_pow(pi2, s, wp2), pi, wp2)
          return mpc_mul(
              a, mpc_mul(b, mpc_mul(c, d, wp), wp), prec, rnd
          )
      n = int(wp / 2.54 + 5)
      n += int(0.9 * abs(to_int(im)))
      d = borwein_coefficients(n)
      ref = to_fixed(re, wp)
      imf = to_fixed(im, wp)
      tre = MPZ_ZERO
      tim = MPZ_ZERO
      one = MPZ_ONE << wp
      one_2wp = MPZ_ONE << (2 * wp)
      critical_line = re == fhalf
      ln2 = ln2_fixed(wp)
      pi2 = pi_fixed(wp - 1)
      wp2 = wp + wp
      for k in xrange(n):
          log = log_int_fixed(k + 1, wp, ln2)
          # A square root is much cheaper than an exp
          if critical_line:
              w = one_2wp // isqrt_fast((k + 1) << wp2)
          else:
              w = exp_fixed((-ref * log) >> wp, wp)
          if k & 1:
              w *= d[n] - d[k]
          else:
              w *= d[k] - d[n]
          wre, wim = cos_sin_fixed((-imf * log) >> wp, wp, pi2)
          tre += (w * wre) >> wp
          tim += (w * wim) >> wp
      tre //= -d[n]
      tim //= -d[n]
      tre = from_man_exp(tre, -wp, wp)
      tim = from_man_exp(tim, -wp, wp)
      if alt:
          return mpc_pos((tre, tim), prec, rnd)
      else:
          q = mpc_sub(mpc_one, mpc_pow(mpc_two, r, wp), wp)
          return mpc_div((tre, tim), q, prec, rnd)
  
imports: import math
  import sys
  from .backend import xrange
  from .backend import MPZ, MPZ_ZERO, MPZ_ONE, MPZ_THREE, gmpy
  from .libintmath import list_primes, ifac, ifac2, moebius
  from .libmpf import round_floor, round_ceiling, round_down, round_up, round_nearest, round_fast, lshift, sqrt_fixed, isqrt_fast, fzero, fone, fnone, fhalf, ftwo, finf, fninf, fnan, from_int, to_int, to_fixed, from_man_exp, from_rational, mpf_pos, mpf_neg, mpf_abs, mpf_add, mpf_sub, mpf_mul, mpf_mul_int, mpf_div, mpf_sqrt, mpf_pow_int, mpf_rdiv_int, mpf_perturb, mpf_le, mpf_lt, mpf_gt, mpf_shift, negative_rnd, reciprocal_rnd, bitcount, to_float, mpf_floor, mpf_sign, ComplexResult
  from .libelefun import constant_memo, def_mpf_constant, mpf_pi, pi_fixed, ln2_fixed, log_int_fixed, mpf_ln2, mpf_exp, mpf_log, mpf_pow, mpf_cosh, mpf_cos_sin, mpf_cosh_sinh, mpf_cos_sin_pi, mpf_cos_pi, mpf_sin_pi, ln_sqrt2pi_fixed, mpf_ln_sqrt2pi, sqrtpi_fixed, mpf_sqrtpi, cos_sin_fixed, exp_fixed
  from .libmpc import mpc_zero, mpc_one, mpc_half, mpc_two, mpc_abs, mpc_shift, mpc_pos, mpc_neg, mpc_add, mpc_sub, mpc_mul, mpc_div, mpc_add_mpf, mpc_mul_mpf, mpc_div_mpf, mpc_mpf_div, mpc_mul_int, mpc_pow_int, mpc_log, mpc_exp, mpc_pow, mpc_cos_pi, mpc_sin_pi, mpc_reciprocal, mpc_square, mpc_sub_mpf
label_desc: Use image node_id 21 for calling a global function with example usage: mpc_zeta(s, prec, rnd, alt, force) and returns: mpf_zeta,  fzero, mpc_mul, mpc_pos, mpc_div, mpc_pos, mpc_pos, mpc_mul