def pick_best(variants):
    '\n    Use the variant score and heuristics to return the variant with the best\n    trade-off between operation count reduction and working set increase.\n    '
    best = variants.pop(0)
    for i in variants:
        (best_flop_score, best_ws_score) = best.score
        if (best_flop_score == 0):
            best = i
            continue
        (i_flop_score, i_ws_score) = i.score
        delta = (i_ws_score - best_ws_score)
        if (((delta > 0) and ((i_flop_score / best_flop_score) > 100)) or ((delta == 0) and (i_flop_score > best_flop_score)) or ((delta < 0) and ((best_flop_score / i_flop_score) <= 100))):
            best = i
    (schedule, exprs, _) = best
    return (schedule, exprs)
Use the variant score and heuristics to return the variant with the best
trade-off between operation count reduction and working set increase.
def pick_best(variants):
    '\n    Use the variant score and heuristics to return the variant with the best\n    trade-off between operation count reduction and working set increase.\n    '
    best = variants.pop(0)
    for i in variants:
        (best_flop_score, best_ws_score) = best.score
        if (best_flop_score == 0):
            best = i
            continue
        (i_flop_score, i_ws_score) = i.score
        delta = (i_ws_score - best_ws_score)
        if (((delta > 0) and ((i_flop_score / best_flop_score) > 100)) or ((delta == 0) and (i_flop_score > best_flop_score)) or ((delta < 0) and ((best_flop_score / i_flop_score) <= 100))):
            best = i
    (schedule, exprs, _) = best
    return (schedule, exprs)