import math


def _variance_to_cutoff(distance_cutoff, similarity_cutoff):
    """Return variance that gives similarity_cutoff at distance_cutoff."""
    # log is natural
    return distance_cutoff**2 / (math.log(1.0 / similarity_cutoff))