I'm trying to bound the relative error that can accrue on just the vector component of the result of quaternion multiplication. If you can recall, a quaternion can encode a rotation by angle $\theta$ around some axis $u$:
$$\mathbf{q} = e^{\frac{\theta}{2}{(u_x\mathbf{i} + u_y\mathbf{j} + u_z\mathbf{k})}} = \cos \frac{\theta}{2} + (u_x\mathbf{i} + u_y\mathbf{j} + u_z\mathbf{k}) \sin \frac{\theta}{2}$$
And two quaternions multiplied together, $p=qr$ represent a composite rotation which is some angle around some other axis. The product still has the form above, so the magnitude of the vector component $||p_{xyz}|| = sin(\frac{\theta_{final}}{2})$
I'm trying to bound the relative error on that vector norm under quaternion multiplication, to show that you can recover the final rotation angle accurately.
In Algorithms for Manipulating Quaternions in Floating-Point Arithmetic (Joldeş, 2020), it's shown that you can bound the overall normwise relative error of quaternion multiplication, and that it's a relatively sedate ~5.75u.
I tried to replicate that derivation, but applied only to the vector norm. Some quick definitions first.
The product $p = qr$ has four components, defined as:
$$ p_0 = q_0r_0 - q_1r_1 - q_2r_2 - q_3r_3\\ p_1 = q_0r_1 + q_1r_0 + q_2r_3 - q_3r_2\\ p_2 = q_0r_2 - q_1r_3 + q_2r_0 + q_3r_1\\ p_3 = q_0r_3 + q_1r_2 - q_2r_1 + q_3r_0 $$
We also define some terms $M_n$ for condition number purposes: $$ M_0 = |q_0r_0| + |q_1r_1| + |q_2r_2| + |q_3r_3|\\ M_1 = |q_0r_1| + |q_1r_0| + |q_2r_3| + |q_3r_2|\\ M_2 = |q_0r_2| + |q_1r_3| + |q_2r_0| + |q_3r_1|\\ M_3 = |q_0r_3| + |q_1r_2| + |q_2r_1| + |q_3r_0| $$
We can proceed as in the Joldeş paper, but just with the vector component of the quaternion ($p_{123}$)
$$\frac{\Vert p_{123} - \hat{p_{123}}\Vert^2}{\Vert p_{123}\Vert^2} \le \frac{\sum_{n=1}^3 (|p_n|v + M_nw)^2}{p_1^2+p_2^2+p_3^3}$$
Where $u$ is the rounding unit, $v$ is $\frac{u}{u+1}$ and $w = 2v + 3v^3 + v^3$ (just explaining it doesn't really matter what these are).
Expanding out the quadratic up top: $$\le \frac{\sum_{n=1}^3 (|p_n|^2v^2 + 2M_nw|p_n|v + M_n^2w^2)}{p_1^2+p_2^2+p_3^3}$$
If we note that $|p_n| \le M_n$ by the triangle inequality, we can replace $|p_n|$ terms with $M_n$ in the numerator without affecting the bound:
$$\le v^2 + \frac{\sum_{n=1}^3 (M_n^2(2vw+w^2))}{p_1^2+p_2^2+p_3^3}$$
or:
$$\le v^2 + \frac{(2vw+w^2)(M_1^2 + M_2^2 + M_3^3)}{p_1^2+p_2^2+p_3^3}$$
At this point in the proof, Joldeş notes that all of the $\frac{M_n^2}{\sum{p_n}^2}$ terms have the same form:
$$ \frac{|\langle a,b\rangle|^2}{|a|^2|b|^2} $$
where $a$ and $b$ are just different rearrangements of the absolute values of the elements of $p$ and $q$
Thus, by Cauchy-Schwarz, all of those terms are $\le 1$ and fall out of the bound. That doesn't apply here since there's no $p_0^2$ term in the denominator, and I'm left sad that I don't have a nice relative error bound.
I think this is a deathblow because there's no way to get around the $q_0$ $r_0$ terms affecting the vector component and you can't bound the termwise error in general, but I wanted to see if someone else had an alternative justification to drop those terms in the bound, or perhaps an alternative approach altogether.