import math


def _fraction_difference(value, reference):
    """How much (what %age) does value differ to reference?"""

    if reference == 0.0:
        return value

    return math.fabs((value - reference) / reference)