def _compute_hedges_correction_factor(n1, n2):
    """
    Computes the bias correction factor for Hedges' g.

    See https://en.wikipedia.org/wiki/Effect_size#Hedges'_g

    Returns
    -------
        j: float

    References
    ----------
    Larry V. Hedges & Ingram Olkin (1985).
    Statistical Methods for Meta-Analysis. Orlando: Academic Press.
    ISBN 0-12-336380-2.
    """
    from scipy.special import gamma
    from numpy import sqrt, isinf
    import warnings
    df = n1 + n2 - 2
    numer = gamma(df / 2)
    denom0 = gamma((df - 1) / 2)
    denom = sqrt(df / 2) * denom0
    if isinf(numer) or isinf(denom):
        df_sum = n1 + n2
        denom = 4 * df_sum - 9
        out = 1 - 3 / denom
    else:
        out = numer / denom
    return out
