code: def zoom(
      x_low,
      x_high,
      y_low,
      y_high,
      y_deriv_low,
      f,
      f_deriv,
      y0,
      y_deriv_0,
      c1,
      c2,
      maxiter=10,
  ):
      """
      Notes
      -----
      Part of the optimization algorithm in `scalar_search_wolfe2`.
  
      Parameters
      ----------
      x_low : float
          Step size
  
      x_high : float
          Step size
  
      y_low : float
          Value of f at x_low
  
      y_high : float
          Value of f at x_high
  
      y_deriv_low : float
          Value of derivative at x_low
  
      f : callable f(x)
          Generates computational graph
  
      f_deriv : callable f'(x)
          Generates computational graph
  
      y0 : float
          Value of f for ``x = 0``
  
      y_deriv_0 : float
          Value of the derivative for ``x = 0``
  
      c1 : float
          Parameter for Armijo condition rule.
  
      c2 : float
          Parameter for curvature condition rule.
  
      maxiter : int
          Maximum number of iterations. Defaults to ``10``.
      """
  
      def zoom_itertion_step(
          _,
          x_low,
          y_low,
          y_deriv_low,
          x_high,
          y_high,
          x_recent,
          y_recent,
          x_star,
      ):
          x_new = cubic_minimizer(
              x_low,
              y_low,
              y_deriv_low,
              x_high,
              y_high,
              x_recent,
              y_recent,
          )
  
          y_new = f(x_new)
          y_deriv_new = f_deriv(x_new)
  
          continue_searching_condition = sequential_or(
              y_new > (y0 + c1 * x_new * y_deriv_0),
              y_new >= y_low,
              tf.abs(y_deriv_new) > (-c2 * y_deriv_0),
          )
  
          condition1 = tf.logical_or(
              y_new > (y0 + c1 * x_new * y_deriv_0), y_new >= y_low
          )
          condition2 = y_deriv_new * (x_high - x_low) >= 0
  
          x_recent = tf.where(
              tf.logical_or(condition1, condition2), x_high, x_low
          )
          y_recent = tf.where(
              tf.logical_or(condition1, condition2), y_high, y_low
          )
          x_high = tf.where(
              condition1, x_new, tf.where(condition2, x_low, x_high)
          )
          y_high = tf.where(
              condition1, y_new, tf.where(condition2, y_low, y_high)
          )
  
          x_low = tf.where(condition1, x_low, x_new)
          y_low = tf.where(condition1, y_low, y_new)
          y_deriv_low = tf.where(condition1, y_deriv_low, y_deriv_new)
  
          x_star = x_new
  
          return [
              continue_searching_condition,
              x_low,
              y_low,
              y_deriv_low,
              x_high,
              y_high,
              y_recent,
              x_recent,
              x_star,
          ]
  
      zero = tf.constant(asfloat(0))
      x_recent = zero
      y_recent = y0
  
      outs = tf.while_loop(
          cond=lambda condition, *args: condition,
          body=zoom_itertion_step,
          loop_vars=[
              True,
              x_low,
              y_low,
              y_deriv_low,
              x_high,
              y_high,
              x_recent,
              y_recent,
              zero,
          ],
          back_prop=False,
          maximum_iterations=maxiter,
      )
      return outs[-1]
  
file_path: neupy/neupy/algorithms/minsearch/wolfe.py
imports: import tensorflow
  from neupy.utils import asfloat
label_desc: Use image node_id 6 for calling a global function with example usage: zoom(x_low, x_high, y_low, y_high, y_deriv_low, f, f_deriv, y0, y_deriv_0, c1, c2, maxiter) and returns: outs, list