code: def bessel_iv_ratio(v, z, name=None):
      """Computes `I_{v} (z) / I_{v - 1} (z)` in a numerically stable way.
  
      Let I(v, z) be the modified bessel function of the first kind. This computes
      the ratio of I(v, z) / I(v - 1, z). This can be more numerically stable
      and faster than computing the ratio directly.
  
      This uses a continued fraction approximation attributed to Gauss for
      computing this quantity in the limit where z <= v, and a continued fraction
      approximation attributed to Perron for z > v.
  
      Args:
        v: value for which `I_{v}(z) / I_{v - 1}(z)` should be computed. Expect
          v > 0.
        z: value for which `I_{v}(z) / I_{v - 1}(z)` should be computed. Expect
          z > 0.
        name: A name for the operation (optional).
          Default value: `None` (i.e., 'bessel_iv_ratio').
  
      Returns:
        I(v, z) / I(v - 1, z).
  
      #### References
      [1]: Walter Gautschi and Josef Slavik. On the Computation of Modified
           Bessel Function Ratios. http://www.jstor.com/stable/2006491
      """
      with tf.name_scope(name or "bessel_iv_ratio"):
          dtype = dtype_util.common_dtype([v, z], tf.float32)
          v = tf.convert_to_tensor(v, dtype=dtype)
          z = tf.convert_to_tensor(z, dtype=dtype)
          return _bessel_iv_ratio_custom_gradient(v, z)
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import custom_gradient
  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 9 for calling a global function with example usage: bessel_iv_ratio(v, z, name) and returns: _bessel_iv_ratio_custom_gradient