code: def binary_search(func, x0, low=0.0, high=100.0):
      del x0  # unused
  
      def cond(state):
          low, high = state
          midpoint = 0.5 * (low + high)
          return (low < midpoint) & (midpoint < high)
  
      def body(state):
          low, high = state
          midpoint = 0.5 * (low + high)
          update_upper = func(midpoint) > 0
          low = jnp.where(update_upper, low, midpoint)
          high = jnp.where(update_upper, midpoint, high)
          return (low, high)
  
      solution, _ = lax.while_loop(cond, body, (low, high))
      return solution
  
imports: from functools import partial
  import re
  import unittest
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import jax
  from jax import lax
  from jax.ad_checkpoint import checkpoint
  from jax._src import test_util
  from jax import tree_util
  import jax.numpy
  import jax.scipy
  from jax import config
label_desc: Use image node_id 3 for calling a global function with example usage: binary_search(func, x0, low, high) and returns: solution, unknown, low,  high