You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUG: CubicOps - Recover precision for misorientations on cubic sym ops
In CubicOps::calculateMisorientationInternal, compute the explicit reduced
quaternion's vector components for each of the three sym-op candidates and
extract the angle as 2*atan2(|v|, w) instead of 2*acos(w).
The acos(w)-near-1 form was catastrophically ill-conditioned for cubic
misorientations that lie on a 4-fold (90° about c-axis), 3-fold (120° about
[111]), or 2-fold sym op. With float32-stored input quaternions promoted
to double, (qco.z()+qco.w())/sqrt(2) lands at ~1-1.7e-8 instead of 1.0;
acos then amplifies the ULP-level noise to ~2e-4 rad ≈ 0.02° residual.
The new form recovers the precision: explicit components like
(qco.z - qco.w) evaluate to exactly 0 in IEEE 754 when qco.z == qco.w,
regardless of upstream float32 truncation noise. The sqrt(1 - w*w) form
inherits the lost precision; the explicit-component form does not.
0 commit comments