Kahan, in Cross on page 14, shows that the angle between the true cross product and the one calculated using floating point arithmetic degrades as the angle between the two crossed vectors approaches zero or π, this angle measuring the error in the floating point calculation of the normal to the plane spanned by the crossed vectors. As the singularities are approached, the orthogonality of the floating point normal becomes more compromised. According to Kahan, the error is:
|sin(∠(t_true, t_float ))| ≤ u+(2/√3)u|csc(∠(t_1, t_2 ))|
where t_true is true orthogonal vector after taking the cross product, t_1⊗t_2, to infinite precision, whereas t_float is the result of the cross product using floating point arithmetic and u is the unit round off.
My question: is there a similar inequality for the sum of two vectors. That is, how far off from the true direction does the floating point vector sum get as the angle between the vectors to be added approaches zero or π? In my particular application, the vectors will be unit length.
Edit: I should add that the vector that is the sum of the two vectors will be normalized.
Take
cto be the computedv-wandeis the difference betweencand what you wanted to compute, namely(v+deltav) - (w+deltaw). Here,eaccounts for both roundoff error in computation and approximation error in your input.Take
rto be the ratio||e|| / ||c||. This must be less than one, otherwise we simply have no idea where the true solution is.By trigonometry, the angle between
candc+eisarccos(c^T (c+e) / sqrt(c^T c (c+e)^T (c+e))) = arccos((1 + alpha r) / sqrt(1 + 2 alpha r + r^2), where-1 <= alpha <= 1is the ratio ofe^T ctosqrt(c^T c e^T e). The cosine of the angle betweencandc+eis minimised whenalphais exactly-r, at which point the angle isarccos(sqrt(1 - r^2)) = arcsin(r).You can get the same result from the law of sines. Given a
cand a bound on||e||/||c||, the points that can reasonably bec+elie on a circle centred atcof radius||e||. The worstc+ewill be on the boundary and the line from the origin to the worstc+ewill make a right angle with the line fromc+etoc. Thus the angle oppositecis a right angle. By the law of sines, then,||e|| / sin(theta) = ||c||, from which the same result follows.