def single_fscore_PR(prec, rec, beta):
    """ Computes an F-score from a precision and recall score """
    betasq = beta ** 2
    if prec == 0.0 or rec == 0.0:
        return 0.0
    return (1 + betasq) / (1.0 / prec + betasq / rec)
