Simplify dot products in linregress