import math


def temp_its68(a, b, c, d, f0, f):
    """SBE equation for converting engineering units to Celcius according to IPTS-68.

    a, b, c, d, f0: coefficients given in calibration.
    f: frequency sampled by sensor.

    Original form from calib sheet dated 2012:
    Temperature IPTS-68 = 1/{a+b[ln(f0/f )]+c[ln2(f0/f)]+d[ln3(f0/f)]} - 273.15 (°C)

    """
    ITS68 = 1/(a +
        b * (math.log(f0/f)) +
        c * math.pow((math.log(f0/f)),2) +
        d * math.pow((math.log(f0/f)),3)
        ) - 273.15
    return ITS68