code: def _hyp2f1_large_a(a, b, c, z):
      """Compute 2F1(a, b, c, z) when |a| >> |c|."""
      # References
      # [1] M. Abramowitz, I. Stegun. Handbook of Mathematical Functions with
      #     Formulas, Graphs and Mathematical Tables.
      with tf.name_scope("hyp2f1_large_a"):
          dtype = dtype_util.common_dtype([a, b, c, z], tf.float32)
          a = tf.convert_to_tensor(a, dtype=dtype)
          b = tf.convert_to_tensor(b, dtype=dtype)
          c = tf.convert_to_tensor(c, dtype=dtype)
          z = tf.convert_to_tensor(z, dtype=dtype)
          numpy_dtype = dtype_util.as_numpy_dtype(dtype)
  
          # We assume that c < 0 and a, b > 0.
  
          # If a < c < 0 or a > c > 0, stop at round(a - c) steps
          num_iterations = tf.where(
              (tf.math.sign(a) == tf.math.sign(c)),
              tf.math.round(a - c),
              tf.math.round(a),
          )
  
          broadcast_shape = functools.reduce(
              ps.broadcast_shape, [ps.shape(x) for x in [a, b, c]]
          )
  
          # We use recurrence 15.2.10 in [1]:
          # w * 2F1(a, b, c, z) + x * 2F1(a + 1, b, c, z) = y 2F1(a - 1, b, c, z)
          # Where, w, x and y are coefficients for the recurrence (as specified
          # in [1]).
          t = a - num_iterations
          negative_recurrence_num_iterations = tf.where(
              num_iterations < 0, -num_iterations, numpy_dtype(0)
          )
          first_result = _hyp2f1_small_parameters(t, b, c, z)
          second_result = _hyp2f1_small_parameters(
              t + tf.math.sign(num_iterations), b, c, z
          )
  
          def hypergeometric_negative_a_recurrence(
              should_stop, index, term, result, previous_result
          ):
              t = term
              new_result = (
                  -(2 * t - c + (b - t) * z) * result
                  - t * (z - 1.0) * previous_result
              ) / (c - t)
              should_stop = index >= negative_recurrence_num_iterations
              new_term = tf.where(should_stop, term, term - 1.0)
              new_result = tf.where(should_stop, result, new_result)
              return (
                  should_stop,
                  index + 1,
                  new_term,
                  new_result,
                  result,
              )
  
          (_, _, _, negative_recurrence_result, _) = tf.while_loop(
              cond=lambda stop, *_: tf.reduce_any(~stop),
              body=hypergeometric_negative_a_recurrence,
              loop_vars=(
                  tf.zeros(broadcast_shape, dtype=tf.bool),
                  tf.cast(1.0, dtype=dtype),
                  t - 1.0,
                  second_result,
                  first_result,
              ),
          )
  
          positive_recurrence_num_iterations = tf.where(
              num_iterations > 0, num_iterations, numpy_dtype(0)
          )
  
          # We use recurrence 15.2.10 in [1]:
          # w * 2F1(a, b, c, z) + x * 2F1(a + 1, b, c, z) = y 2F1(a - 1, b, c, z)
          # Where, w, x and y are coefficients for the recurrence (as specified
          # in [1]).
          def hypergeometric_positive_a_recurrence(
              should_stop, index, term, result, previous_result
          ):
              t = term
              new_result = -(
                  (2 * t - c + (b - t) * z) * result
                  + (c - t) * previous_result
              ) / (t * (z - 1.0))
              should_stop = index >= positive_recurrence_num_iterations
              new_term = tf.where(should_stop, term, term + 1.0)
              new_result = tf.where(should_stop, result, new_result)
              return (
                  should_stop,
                  index + 1,
                  new_term,
                  new_result,
                  result,
              )
  
          (_, _, _, positive_recurrence_result, _) = tf.while_loop(
              cond=lambda stop, *_: tf.reduce_any(~stop),
              body=hypergeometric_positive_a_recurrence,
              loop_vars=(
                  tf.zeros(broadcast_shape, dtype=tf.bool),
                  tf.cast(1.0, dtype=dtype),
                  t + 1.0,
                  second_result,
                  first_result,
              ),
          )
          return tf.where(
              num_iterations > 0,
              positive_recurrence_result,
              negative_recurrence_result,
          )
  
file_path: probability/tensorflow_probability/python/math/hypergeometric.py
imports: import functools
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 5 for calling a global function with example usage: _hyp2f1_large_a(a, b, c, z) and returns: tf, should_stop,  unknown,  new_term,  new_result,  result, should_stop,  unknown,  new_term,  new_result,  result