def computeAuc(fpr, tpr):
    """Compute AUC from FPR and TPR values using numerical integration with the trapezoidal rule with non-uniform grid"""

    # Initialize AUC
    auc = 0

    # Compute integral
    for i in range(1, len(fpr)):
        auc += (tpr[i] + tpr[i - 1]) * (fpr[i] - fpr[i - 1]) / 2

    return auc