The sampling variance of a d value is:
$$\left(\frac{n-1}{n-3}\right)\left(\frac{n_{1}+n_{2}}{n_{1}n_{2}}+\frac{d^{2}}{2(n_{1}+n_{2})}\right)$$
When groups 1 and 2 are of equal size, this reduces to
$$var_{e}=\left(\frac{n-1}{n-3}\right)\left(\frac{4}{n}\right)\left(1+\frac{d^{2}}{8}\right)$$
This can be corrected for bias by first correcting the d value (see correct_d_bias
) prior to estimating the error variance.