Speed up the Vector math methods a bit.
Reduce the number of subroutine calls, and reduce the number of
times each piece of data has to be touched.
I have two very CPU-intensive tests in my AI project, which end
up calling a couple hundred thousand math ops during the course
of their execution. This patch speeds up those tests by about
12%.
Execution times for those two tests, before and after the patch
(in seconds):
07rules_ttt.t before: 29.02 28.63 29.18
07rules_ttt.t after: 25.83 25.21 25.36
10population.t before: 32.06 31.76 31.59
10population.t after: 27.74 28.04 27.34