code: def _bisection_root_finder(fun, a, b, tol=1e-6, max_iter=100):
      if fun(a) * fun(b) >= 0:
          raise ValueError(
              "Function values at the interval endpoints must have opposite signs"
          )
  
      for _ in range(max_iter):
          c = (a + b) / 2
          if fun(c) == 0 or (b - a) / 2 < tol:
              return c
  
          if fun(c) * fun(a) < 0:
              b = c
          else:
              a = c
  
      raise RuntimeError("Bisection algorithm did not converge")
  
imports: from .base import FactorizedTensor
  import ivy
  from copy import deepcopy
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: _bisection_root_finder(fun, a, b, tol, max_iter) and returns: c