def METHOD_NAME(self, arg, n_eff):
    # Numerical calculation of the inverse of `_G`.
    roots = []
    for val, neff in zip(arg, n_eff):
        func = lambda x: self._G(x, neff) - val  # noqa: _G_inv Traceback
        try:
            rt = brentq(func, a=0.05, b=200)
        except ValueError:
            # No root in [0.05, 200] (rare, but it may happen).
            rt = root_scalar(func, x0=1, x1=2).root.item()
        roots.append(rt)
    return np.asarray(roots)