code: def _compute_log_a_frac(q, sigma, alpha):
      """Compute log(A_alpha) for fractional alpha. 0 < q < 1."""
      # The two parts of A_alpha, integrals over (-inf,z0] and [z0, +inf), are
      # initialized to 0 in the log space:
      log_a0, log_a1 = -np.inf, -np.inf
      i = 0
  
      z0 = sigma**2 * math.log(1 / q - 1) + 0.5
  
      while True:  # do ... until loop
          coef = special.binom(alpha, i)
          log_coef = math.log(abs(coef))
          j = alpha - i
  
          log_t0 = log_coef + i * math.log(q) + j * math.log(1 - q)
          log_t1 = log_coef + j * math.log(q) + i * math.log(1 - q)
  
          log_e0 = math.log(0.5) + _log_erfc(
              (i - z0) / (math.sqrt(2) * sigma)
          )
          log_e1 = math.log(0.5) + _log_erfc(
              (z0 - j) / (math.sqrt(2) * sigma)
          )
  
          log_s0 = log_t0 + (i * i - i) / (2 * (sigma**2)) + log_e0
          log_s1 = log_t1 + (j * j - j) / (2 * (sigma**2)) + log_e1
  
          if coef > 0:
              log_a0 = _log_add(log_a0, log_s0)
              log_a1 = _log_add(log_a1, log_s1)
          else:
              log_a0 = _log_sub(log_a0, log_s0)
              log_a1 = _log_sub(log_a1, log_s1)
  
          i += 1
          if max(log_s0, log_s1) < -30:
              break
  
      return _log_add(log_a0, log_a1)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import sys
  import numpy
  from scipy import special
  import six
label_desc: Use image node_id 7 for calling a global function with example usage: _compute_log_a_frac(q, sigma, alpha) and returns: _log_add