code: def cubic_minimizer(
      x_a, y_a, y_prime_a, x_b, y_b, x_c, y_c, bound_size_ratio=0.2
  ):
      """
      Finds the minimizer for a cubic polynomial that goes
      through the points (x_a, y_a), (x_b, y_b), and (x_c, y_c)
      with derivative at ``x_a`` of y_prime_a.
  
      Parameters
      ----------
      x_a : float or tensorflow variable
          First point ``a`` in the ``x`` axis.
  
      y_a : float or tensorflow variable
          Output from function ``y`` at point ``a``.
  
      y_prime_a : float or tensorflow variable
          Output from function ``y'`` (``y`` derivative) at point ``a``.
  
      x_b : float or tensorflow variable
          Second point ``b`` in the ``x`` axis.
  
      y_b : float or tensorflow variable
          Output from function ``y`` at point ``b``.
  
      x_c : float or tensorflow variable
          Third point ``c`` in the ``x`` axis.
  
      y_c : float or tensorflow variable
          Output from function ``y`` at point ``c``.
  
      bound_size_ratio : float
          Value control acceptable bounds for interpolation. If
          value is close to one of the points than interpolation
          result will be ignored. The bigger the ratio, the more
          likely it's going to reject interpolation. Value needs
          to be between ``0`` and ``1``. Defaults to ``0.1``.
  
      Returns
      -------
      object
          Tensorfow variable that after evaluation is equal to
          the point ``x`` which is a minimizer for the cubic function.
      """
  
      if not 0 <= bound_size_ratio < 1:
          raise ValueError(
              "The `bound_size_ratio` value should be a float "
              "number between 0 and 1, got {}"
              "".format(bound_size_ratio)
          )
  
      bound_size_ratio = asfloat(bound_size_ratio)
  
      from_a2b_dist = x_b - x_a
      from_a2c_dist = x_c - x_a
  
      denominator = (from_a2b_dist * from_a2c_dist) ** asfloat(2) * (
          from_a2b_dist - from_a2c_dist
      )
      tau_ab = y_b - y_a - y_prime_a * from_a2b_dist
      tau_ac = y_c - y_a - y_prime_a * from_a2c_dist
  
      alpha = (
          from_a2c_dist ** asfloat(2) * tau_ab
          - from_a2b_dist ** asfloat(2) * tau_ac
      ) / denominator
      beta = (
          from_a2b_dist ** asfloat(3) * tau_ac
          - from_a2c_dist ** asfloat(3) * tau_ab
      ) / denominator
      radical = beta ** asfloat(2) - asfloat(3) * alpha * y_prime_a
  
      minimizer = x_a + (-beta + tf.sqrt(radical)) / (
          asfloat(3) * alpha
      )
  
      return tf.where(
          sequential_or(
              # Handle bad cases
              radical < 0,
              tf.equal(x_a, x_b),
              tf.equal(x_a, x_c),
              tf.equal(x_b, x_c),
              tf.equal(alpha, 0),
              tf.is_nan(minimizer),
              tf.greater(
                  minimizer, x_b - bound_size_ratio * from_a2b_dist
              ),
              tf.less(
                  minimizer, x_a + bound_size_ratio * from_a2b_dist
              ),
          ),
          quadratic_minimizer(x_a, y_a, y_prime_a, x_b, y_b),
          minimizer,
      )
  
file_path: neupy/neupy/algorithms/minsearch/wolfe.py
imports: import tensorflow
  from neupy.utils import asfloat
label_desc: Use image node_id 5 for calling a global function with example usage: cubic_minimizer(x_a, y_a, y_prime_a, x_b, y_b, x_c, y_c, bound_size_ratio) and returns: tf