def imf_kroupa(x):
    """ Computes a Kroupa IMF

    Keywords
    ----------
    x : numpy vector
      masses

    Returns
    -------
    imf : numpy vector
      unformalized IMF
    """
    m1 = 0.08
    m2 = 0.5
    alpha0 = -0.3
    alpha1 = -1.3
    alpha2 = -2.3
    if x < m1:
        return x ** alpha0
    elif x >= m2:
        return x ** alpha2
    else:
        return x ** alpha1
