Optimize vsqsum and vdot