Possible speedup for unit_math.sum function.