import math


def wilson_significance(pval, alpha):
    """Wilson significance

    Parameters
    ----------
     pval : float
        P-value.
     alpha : float
        Type-I error threshold.

    Returns
    -------
     W : float
        Wilson significance: log10(alpha / pval).

    Notes
    -----
    The Wilson significance is defined to be log10(alpha / pval),
    where pval is the p-value and alpha is the Type-I error rate. It
    has the following properties:
     - When the result is statistically significant, W > 0.
     - The larger W, the stronger the evidence.
     - An increase in W of 1 corresponds to a 10x decrease in p-value.

    """
    try:
        W = math.log10(alpha) - math.log10(pval)
    except ValueError:
        W = 310.0

    return W