Use Double.compare() when comparing doubles. Also, check for constant
vectors.