code: def _f_cash_root(x, counts, bkg, model):
      
      return np.sum(model * (counts / (x * model + bkg) - 1.0))
docs: Function to find root of. Described in Appendix A, Stewart (2009).
  
      Parameters
      ----------
      x : float
          Model amplitude.
      counts : `~numpy.ndarray`
          Count map slice, where model is defined.
      bkg : `~numpy.ndarray`
          Background map slice, where model is defined.
      model : `~numpy.ndarray`
          Source template (multiplied with exposure).