parameters: (x, series_order)
return_statement: return 1. + even_sum - odd_sum
docstring: Calculates the asymptotic series used in log_ndtr.
docstring_summary: Calculates the asymptotic series used in log_ndtr.
docstring_tokens: Calculates the asymptotic series used in log_ndtr .
function: def _log_ndtr_asymptotic_series(x, series_order):
    """Calculates the asymptotic series used in log_ndtr."""
    if series_order <= 0:
      return 1.
    x_2 = math_ops.square(x)
    even_sum = 0.
    odd_sum = 0.
    x_2n = x_2  # Start with x^{2*1} = x^{2*n} with n = 1.
    for n in range(1, series_order + 1):
      if n % 2:
        odd_sum += _double_factorial(2 * n - 1) / x_2n
      else:
        even_sum += _double_factorial(2 * n - 1) / x_2n
      x_2n *= x_2
    return 1. + even_sum - odd_sum
function_tokens: def _log_ndtr_asymptotic_series ( x , series_order ) : if series_order <= 0 : return 1. x_2 = math_ops . square ( x ) even_sum = 0. odd_sum = 0. x_2n = x_2 # Start with x^{2*1} = x^{2*n} with n = 1. for n in range ( 1 , series_order + 1 ) : if n % 2 : odd_sum += _double_factorial ( 2 * n - 1 ) / x_2n else : even_sum += _double_factorial ( 2 * n - 1 ) / x_2n x_2n *= x_2 return 1. + even_sum - odd_sum