pub fn sum<T>(xs: &[T]) -> Twhere T: Zero + AddAssign + Copy,
Sums all the elements in a give vector.
Unrolls loops to facilitate vectorization.