import math


def explicit_log_sum_exp(xs):
    """Log Sum Exp on a dict of values."""
    max_x = max(xs.values())
    total = 0
    for x in xs.values():
        total += math.exp(x - max_x)
    return max_x + math.log(total)