def calculate_performance_score(stat_arr, beta):
    """Calculate F beta, or precision or TPR

    Args:
        stat_arr (np.array): arr([tp, fp, fn])
        beta (int): non-negative int for F beta score
    Returns:
        Precision (float): for beta = 0
        F_beta (float): for 1 <= beta <= 100
        TPR (float): for > 100
    """
    tp, fp, fn = stat_arr[0], stat_arr[1], stat_arr[2]

    if beta > 100:
        numerator = tp
        denominator = tp + fn
    else:
        numerator = (1 + beta * beta) * tp
        denominator = (1 + beta * beta) * tp + beta * beta * fn + fp
    if denominator == 0:
        return 0.0
    else:
        return numerator / denominator