![903600ac417f978ea72b1d42480b7c76](https://f.cloud.github.com/assets/202816/1311614/9edece94-3212-11e3-9d2a-22bef4e35bea.png)

Since the weights are normalized to 1 then the ratio there reduces to just `1 / (1 - power(weights, 2).sum())` where the denominator is `fact`. But that formula assumes the weights are normalized to 1 otherwise you need to divide the `power(weights, 2).sum()` term by `weights_sum**2` and then again divide the dot product by `weights_sum`. We could instead let `fact = (1. - power(weights, 2).sum() / weights_sum**2) * weights_sum` here and avoid the normalization of `weights`.