sched: Fix and optimise calculation of the weight-inverse