def METHOD_NAME(y):
    pi_term = branching[0] * (g_pi(y, rs[0]) + g_0(y, rs[0]))
    # rest_terms = branching[1:]*(g_1(y,rs)+g_0(y,rs))
    rest_terms = [ branch * (g_1(y, r) + g_0(y, r)) for branch, r in zip(branching[1:], rs[1:]) ]
    return pi_term + np.sum(rest_terms)