import math


def log10sumexp(log10_probs):
    """Returns log10(sum(10^log10_probs)) computed in a numerically-stable way"""

    m = max(log10_probs)

    return m + math.log10(sum(pow(10.0, x-m) for x in log10_probs))