Open tk-yoshimura opened 1 month ago
While this should get fixed have you tried Boost.QVM (https://www.boost.org/doc/libs/1_86_0/libs/qvm/doc/html/index.html)? I believe it has a much richer set of support than our quaternions (which is the oldest part of the library)
Thank you for sharing about QVM.
Here is how I discovered this problem. While implementing complex Bessel functions, I encountered a similar problem with the division of the micro-norm. I verified that boost does not have a similar flaw and reported it because it seems to have the same mistake in quaternion and octonion.
Overflow or underflow occurs when the divisor is a giant or minute number in quaternion and octanion division.
The following code, which is expected to yield 1, unexpectedly yields NaN.
I consider exponential normalization to be necessary in the following code.
denominator
underflows or overflows whenrhs
is a minute or huge number.Quaternion: https://github.com/boostorg/math/blob/c3afa49c9a66523bd9be47888088337d0229a7cb/include/boost/math/quaternion.hpp#L398-L420
Octanion: https://github.com/boostorg/math/blob/c3afa49c9a66523bd9be47888088337d0229a7cb/include/boost/math/octonion.hpp#L561-L654