def METHOD_NAME(lo, hi, orders, funcs):
    ret = []
    for i in range(len(orders)):
        coeffs = []
        order = orders[i]
        func = funcs[i]
        for j in range(order):
            s = 0.0
            for k in range(order):
                y = math.cos(math.pi * (k + 0.5) / order)
                x = 0.5 * (y * (hi - lo) + (hi + lo))
                f = func(x)
                s += f * math.cos(j * math.pi * (k + 0.5) / order)
            coeffs.append(s * 2.0 / order)
        ret.append(coeffs)
    return ret