[BF] Fix bug in multiple_fast_inv.

Some computations were done outside the loop, but they depend
on values changing at each iteration.