human
I wrote the below code

    def while_zoom(phi_rec, a_rec, a_lo, a_hi, phi_hi, phi_lo, derphi_lo, a_star, val_star, valprime):
        dalpha = (a_hi - a_lo)
        a = TT.switch((dalpha < zero), a_hi, a_lo)
        b = TT.switch((dalpha < zero), a_lo, a_hi)
        cchk = (delta1 * dalpha)
        a_j_cubic = _cubicmin(a_lo, phi_lo, derphi_lo, a_hi, phi_hi, a_rec, phi_rec)
        qchk = (delta2 * dalpha)
        a_j_quad = _quadmin(a_lo, phi_lo, derphi_lo, a_hi, phi_hi)
        cond_q = lazy_or('condq', TT.isnan(a_j_quad), (a_j_quad > (b - qchk)), (a_j_quad < (a + qchk)))
        a_j_quad = TT.switch(cond_q, (a_lo + (numpy.asarray(0.5, dtype=theano.config.floatX) * dalpha)), a_j_quad)
        cond_c = lazy_or('condc', TT.isnan(a_j_cubic), TT.bitwise_or((a_j_cubic > (b - cchk)), (a_j_cubic < (a + cchk))))
        a_j = TT.switch(cond_c, a_j_quad, a_j_cubic)
        phi_aj = phi(a_j)
        derphi_aj = derphi(a_j)
        stop = lazy_and('stop', TT.bitwise_and((phi_aj <= (phi0 + ((c1 * a_j) * derphi0))), (phi_aj < phi_lo)), (abs(derphi_aj) <= ((- c2) * derphi0)))
        cond1 = TT.bitwise_or((phi_aj > (phi0 + ((c1 * a_j) * derphi0))), (phi_aj >= phi_lo))
        cond2 = ((derphi_aj * (a_hi - a_lo)) >= zero)
        phi_rec = ifelse(cond1, phi_hi, TT.switch(cond2, phi_hi, phi_lo), name='phi_rec')
        a_rec = ifelse(cond1, a_hi, TT.switch(cond2, a_hi, a_lo), name='a_rec')
        a_hi = ifelse(cond1, a_j, TT.switch(cond2, a_lo, a_hi), name='a_hi')
        phi_hi = ifelse(cond1, phi_aj, TT.switch(cond2, phi_lo, phi_hi), name='phi_hi')
        a_lo = TT.switch(cond1, a_lo, a_j)
        phi_lo = TT.switch(cond1, phi_lo, phi_aj)
        derphi_lo = ifelse(cond1, derphi_lo, derphi_aj, name='derphi_lo')
        a_star = a_j
        val_star = phi_aj
        valprime = ifelse(cond1, nan, TT.switch(cond2, derphi_aj, nan), name='valprime')
        return ([phi_rec, a_rec, a_lo, a_hi, phi_hi, phi_lo, derphi_lo, a_star, val_star, valprime], theano.scan_module.scan_utils.until(stop))
    maxiter = n_iters
    delta1 =...

What's a good function header?
assistant
#Here's a good function header.

def _zoom(a_lo, a_hi, phi_lo, phi_hi, derphi_lo, phi, derphi, phi0, derphi0, c1, c2, n_iters=10, profile=False):