Machine precision
Returns the squared Euclidean distance between two vectors.
Returns the squared Euclidean distance between two vectors. The following formula will be used if it does not introduce too much numerical error:
\|a - b\|_2^2 = \|a\|_2^2 + \|b\|_2^2 - 2 a^T b.When both vector norms are given, this is faster than computing the squared distance directly, especially when one of the vectors is a sparse vector.
the first vector
the norm of the first vector, non-negative
the second vector
the norm of the second vector, non-negative
desired relative precision for the squared distance
squared distance between v1 and v2 within the specified precision