import math


def kimura_distance(transitions, transversions):
    """Calculate Kimura 2 parameter distance.

    Parameters
    ----------
    transitions : float
        Fraction of transitions
    transversions : float
        Fraction of transversions
    """

    return -0.5 * math.log((1 - 2*transitions - transversions) *
                           math.sqrt(1 - 2*transversions))