import math


def probability_to_bayeselo(probability):
    """
    Takes a probability: P['win'], P['loss']
    Returns elo, draw_elo
    """
    assert (0 < probability['win'] < 1 and 0 < probability['loss'] < 1)
    elo = 200 * math.log10(
        probability['win'] / probability['loss']
        * (1 - probability['loss']) / (1 - probability['win'])
    )
    draw_elo = 200 * math.log10(
        (1 - probability['loss']) / probability['loss']
        * (1 - probability['win']) / probability['win']
    )
    return elo, draw_elo