docstr: Tests that update works on a single line function.
docstr_tok: ["Tests","that","update","works","on","a","single","line","function","."]
code: def test_update_simple(self):
      """Tests that update works on a single line function."""
      # Example where trial point works as new left end point.
      wolfe_threshold = 1e-6
      x = np.array([0.0, 0.6, 1.0])
      y = np.array([1.0, 0.9, 1.2])
      dy = np.array([-0.8, -0.7, 0.6])
      fun = _test_function_x_y_dy(x, y, dy)
  
      val_a = fun(0.0)
      val_b = fun(1.0)
      val_trial = fun(0.6)
      f_lim = val_a.f + (wolfe_threshold * tf.abs(val_a.f))
  
      result = self.evaluate(
          hzl.update(fun, val_a, val_b, val_trial, f_lim)
      )
      self.assertEqual(
          result.num_evals, 0
      )  # No extra evaluations needed.
      self.assertTrue(result.stopped)
      self.assertTrue(~result.failed)
      self.assertAlmostEqual(result.left.x, 0.6)
      self.assertAlmostEqual(result.right.x, 1.0)
      self.assertLess(result.left.df, 0)  # Opposite slopes.
      self.assertGreaterEqual(result.right.df, 0)
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.gradient import value_and_gradient
  from tensorflow_probability.python.optimizer.linesearch.internal import hager_zhang_lib
label_desc: Use image node_id 2 for calling the HagerZhangLibTest obj's underlying member method code with example usage: obj.test_update_simple() without return types