human
Give me a Python program to calculate    the    matching    s_min    that    has    has    eqn7(S_max)    =\n                                eqn7(S_min)    here given the following:
I wrote the below code

    from mpmath import mpf, factorial, findroot, fsum, power, exp, quad
    N = mpf(N)
    B = mpf(B)
    CL = mpf(CL)
    def eqn8(N, B):
        sumterms = [(power(B, n) / factorial(n)) for n in range((int(N) + 1))]
        return (1.0 / (exp((- B)) * fsum(sumterms)))
    eqn8_res = eqn8(N, B)
    factorial_N = factorial(N)
    def eqn7(S, N, B):
        SpB = (S + B)
        return (eqn8_res * ((exp((- SpB)) * (SpB ** N)) / factorial_N))
    def eqn9_left(S_min, S_max, N, B):
        def eqn7NB(S):
            return eqn7(S, N, B)
        return quad(eqn7NB, [S_min, S_max])
    def find_s_min(S_max, N, B):
        u'\n                                Kraft,    Burrows    and    Nousek    suggest    to    integrate    from    N-B    in    both\n                                directions    at    once,    so    that    S_min    and    S_max    move    similarly    (see\n                                the    article    for    details).    Here,    this    is    implemented    differently:\n                                Treat    S_max    as    the    optimization    parameters    in    func    and    then\n                                calculate    the    matching    s_min    that    has    has    eqn7(S_max)    =\n                                eqn7(S_min)    here.\n                                '
        y_S_max = eqn7(S_max, N, B)
        if (eqn7(0, N, B) >= y_S_max):
            return 0.0
        else:
            def eqn7ysmax(x):
                return (eqn7(x, N, B) - y_S_max)
            return findroot(eqn7ysmax, ((N - B) / 2.0))
    def func(s):
        s_min = find_s_min(s, N, B)
        out = eqn9_left(s_min, s, N, B)
        return (out - CL)
    S_max = findroot(func, (N - B), tol=0.0001)
    S_min = find_s_min(S_max, N, B)
    return (float(S_min), float(S_max))

What's a good function header?
assistant
#Here is Python program to calculate    the    matching    s_min    that    has    has    eqn7(S_max)    =\n                                eqn7(S_min)    here.

def _mpmath_kraft_burrows_nousek(N, B, CL):