def lorentzian(x, a, x0, fwhm, offset):
    """ Compute Lorentzian function.
    http://mathworld.wolfram.com/LorentzianFunction.html
    The function is normalized not to its area, but to the amplitude a.

    Parameters
    ----------
    x : float
        parameter at which the Lorentzian function is computed
    a : float
        amplitude
    x0 : float
        offset on x-axis
    fwhm : float
        Full-width-at-half-maximum (FWHM)
    offset : float
        amplitude offset

    Returns
    -------
    float
        Value of Lorentzian function for x

    """
    return a * fwhm ** 2 / 4 / ((x - x0) ** 2 + (fwhm / 2) ** 2) + offset
