code: def glaisher_fixed(prec):
      wp = prec + 30
      # Number of direct terms to sum before applying the Euler-Maclaurin
      # formula to the tail. TODO: choose more intelligently
      N = int(0.33 * prec + 5)
      ONE = MPZ_ONE << wp
      # Euler-Maclaurin, step 1: sum log(k)/k**2 for k from 2 to N-1
      s = MPZ_ZERO
      for k in range(2, N):
          # print k, N
          s += log_int_fixed(k, wp) // k**2
      logN = log_int_fixed(N, wp)
      # logN = to_fixed(mpf_log(from_int(N), wp+20), wp)
      # E-M step 2: integral of log(x)/x**2 from N to inf
      s += (ONE + logN) // N
      # E-M step 3: endpoint correction term f(N)/2
      s += logN // (N**2 * 2)
      # E-M step 4: the series of derivatives
      pN = N**3
      a = 1
      b = -2
      j = 3
      fac = from_int(2)
      k = 1
      while 1:
          # D(2*k-1) * B(2*k) / fac(2*k) [D(n) = nth derivative]
          D = ((a << wp) + b * logN) // pN
          D = from_man_exp(D, -wp)
          B = mpf_bernoulli(2 * k, wp)
          term = mpf_mul(B, D, wp)
          term = mpf_div(term, fac, wp)
          term = to_fixed(term, wp)
          if abs(term) < 100:
              break
          # if not k % 10:
          #    print k, math.log(int(abs(term)), 10)
          s -= term
          # Advance derivative twice
          a, b, pN, j = b - a * j, -j * b, pN * N, j + 1
          a, b, pN, j = b - a * j, -j * b, pN * N, j + 1
          k += 1
          fac = mpf_mul_int(fac, (2 * k) * (2 * k - 1), wp)
      # A = exp((6*s/pi**2 + log(2*pi) + euler)/12)
      pi = pi_fixed(wp)
      s *= 6
      s = (s << wp) // (pi**2 >> wp)
      s += euler_fixed(wp)
      s += to_fixed(mpf_log(from_man_exp(2 * pi, -wp), wp), wp)
      s //= 12
      A = mpf_exp(from_man_exp(s, -wp), wp)
      return to_fixed(A, prec)
  
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 3 for calling a global function with example usage: glaisher_fixed(prec) and returns: to_fixed