def precision_from_tpr_fpr(tpr, fpr, positive_prior):
    """
    Computes precision for a given positive prevalence from TPR and FPR
    """
    return (positive_prior * tpr) / ((positive_prior * tpr) + ((1 - positive_prior) * fpr))