code: def first_step_size(
      atol,
      first_order_error_coefficient,
      initial_state_vec,
      initial_time,
      ode_fn_vec,
      rtol,
      safety_factor,
      epsilon=1e-12,
      max_step_size=1.0,
      min_step_size=1e-12,
  ):
      """Selects the first step size to use."""
      next_time = initial_time + epsilon
      first_derivative = ode_fn_vec(initial_time, initial_state_vec)
      state_dtype = initial_state_vec.dtype
      next_state_vec = initial_state_vec + first_derivative * epsilon
      second_derivative = (
          ode_fn_vec(next_time, next_state_vec) - first_derivative
      ) / epsilon
      tol = tf.cast(
          atol + rtol * tf.abs(initial_state_vec), state_dtype
      )
      # Local truncation error of an order one step is
      # `err(step_size) = first_order_error_coefficient * second_derivative *
      #                 * step_size**2`.
      # Choose the largest `step_size` such that `norm(err(step_size) / tol) <= 1`.
      norm = tf.norm(
          first_order_error_coefficient * second_derivative / tol
      )
      step_size = tf.cast(
          tf.math.rsqrt(norm), tf.abs(initial_state_vec).dtype
      )
      return tf.clip_by_value(
          safety_factor * step_size, min_step_size, max_step_size
      )
  
file_path: probability/tensorflow_probability/python/math/ode/bdf_util.py
imports: import collections
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 2 for calling a global function with example usage: first_step_size(atol, first_order_error_coefficient, initial_state_vec, initial_time, ode_fn_vec, rtol, safety_factor, epsilon, max_step_size, min_step_size) and returns: tf