Small thing that will improve performance a bit: pre-compute `1 / Math.sqrt(ratnum)` before the loop, then multiply it by each `iifv`. Floating-point divides and square roots are slow, relatively speaking.