def get_f_score(prec, rec, beta=1):
    """ Compute F_beta score.

    The formula is F_beta = (1+beta**2)*prec*rec/((beta**2)*prec + rec)

    Args:
        prec (float): Precision
        rec (float): Recall
        beta (float): Weighting of precision

    Returns:
        The F_beta score.
    """
    if prec + rec == 0:
        return 0
    else:
        return (1 + beta ** 2) * prec * rec / (beta ** 2 * prec + rec)