There is a simple workaround for this:
https://en.wikipedia.org/wiki/Kahan_summation
It's usually only needed when adding billions of values together and the accumulated truncation errors would be at an unacceptable level.
There is a simple workaround for this:
https://en.wikipedia.org/wiki/Kahan_summation
It's usually only needed when adding billions of values together and the accumulated truncation errors would be at an unacceptable level.
Y += (X-Y) * alpha * dt
When dt is small and alpha is too, the right hand side can be too small to affect the 24bit mantissa of the left.
I prefer a 16/32bit fixed point version that guarantees convergene to any 16bit steady state. This happened in a power conversion system where dt=1/40000 and I needed a filter in the 10's of Hz.
OTOH, it’s easy to implement, so I have a couple of functions to do it easily, and I got quite a lot of use out of them. It’s probably overkill sometimes, but sometimes it’s useful.