def mag_single_power_law(mag, phi_star, mag_ref, alpha):
    """Evaluate a power law luminosity function as a function as a function
    of magnitude

    :param mag: Magnitude
    :type mag: float or np.ndarray
    :param phi_star: Normalization of the power law at a value of mag_ref
    :type phi_star: float
    :param mag_ref: Reference magnitude of the power law
    :type mag_ref: float
    :param alpha: Slope of the power law
    :type alpha: float
    :return: Value of the broken double power law at a magnitude of M
    :rtype: float or np.ndarray
    """

    A = pow(10, 0.4 * (alpha + 1) * (mag - mag_ref))

    return phi_star / A