code: def _stdtr_computation(df, t):
      """Compute cumulative distribution function of Student T distribution."""
      dtype = dtype_util.common_dtype([df, t], tf.float32)
      numpy_dtype = dtype_util.as_numpy_dtype(dtype)
      half = numpy_dtype(0.5)
      one = numpy_dtype(1.0)
  
      df, t = [
          tf.convert_to_tensor(param, dtype=dtype) for param in (df, t)
      ]
      broadcast_shape = functools.reduce(
          ps.broadcast_shape, [ps.shape(df), ps.shape(t)]
      )
      df, t = [
          tf.broadcast_to(param, broadcast_shape) for param in (df, t)
      ]
  
      # For moderate df and relatively small t**2, or in case of large df, we use
      # asymptotic expansion [1, 2] to compute stdtr(df, t). The condition to use
      # it was specified by experimentation for np.float32 and was taken from [2,
      # page 249] for np.float64.
  
      if numpy_dtype == np.float32:
          use_asymptotic_expansion = (
              (df >= 10.0) & (tf.math.square(t) < (16.0 * df - 5.0))
          ) | (df > 30.0)
      else:
          use_asymptotic_expansion = (
              (df >= 100.0) & (tf.math.square(t) < (0.1 * df - 5.0))
          ) | (df > 1000.0)
  
      result = _stdtr_asymptotic_expansion(df, t, numpy_dtype)
  
      # Otherwise, we evaluate stdtr(df, t) using the regularized incomplete beta
      # function [3, page 323, equation 6.14.10]:
      #   stdtr(df, t) =
      #       0.5 * betainc(0.5 * df, 0.5, df / (df + t**2)), when t < 0
      #       1. - 0.5 * betainc(0.5 * df, 0.5, df / (df + t**2)), when t >= 0
      # To avoid rounding error when t**2 is small compared to df, we compute the
      # ratio df / (df + t**2) in the logarithmic space. If ratio > 0.99, we then
      # use the following symmetry relation:
      #   betainc(a, b, x) = 1 - betainc(b, a, 1 - x) .
  
      raw_ratio = t * tf.math.rsqrt(df)
      ratio = tf.math.exp(-numeric.log1psquare(raw_ratio))
      one_minus_ratio = tf.math.exp(
          -numeric.log1psquare(tf.math.reciprocal(raw_ratio))
      )
  
      # The maximum value for the ratio was set by experimentation.
      use_symmetry_relation = ratio > 0.99
      half_df = half * df
      a = tf.where(use_symmetry_relation, half, half_df)
      b = tf.where(use_symmetry_relation, half_df, half)
      x = tf.where(use_symmetry_relation, one_minus_ratio, ratio)
  
      y = special.betainc(a, b, x)
      result_betainc = half * tf.where(
          use_symmetry_relation, one - y, y
      )
      # Handle the case (t >= 0).
      result_betainc = tf.where(
          t >= 0.0, one - result_betainc, result_betainc
      )
  
      result = tf.where(
          use_asymptotic_expansion, result, result_betainc
      )
  
      # Determine if df is out of range (should return NaN output).
      result = tf.where(df <= 0.0, numpy_dtype(np.nan), result)
  
      return result
  
imports: import functools
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import special_math
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.math import generic
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math import numeric
  from tensorflow_probability.python.math import special
label_desc: Use image node_id 5 for calling a global function with example usage: _stdtr_computation(df, t) and returns: result