The geometric mean for some width $w$ is the $w$-th root of the product of the $w$ most recent data points.
$$ M_t = \sqrt[w]{x_t \otimes x_{t-1} \otimes \cdots \otimes x_{t-(w-1)} } $$
This can be calculated in a rolling fashion by dividing out factors as they exit and multiplying in factors as they arrive:
$$ M'_t = M'_{t-1} \otimes \sqrt[w]{x_{t} \oslash x_{t-w}} $$
(where $\otimes$ is IEEE-754 floating point multiplication and $\oslash$ is IEEE-754 floating point division).
However, due to the limitations of IEEE-754 floating point precision, $M'_t$ can drift arbitrarily far from $M_t$ over time. Is it possible to correct for this drift such that $M'_t$ stays within a fixed relative bound of $M_t$ indefinitely in better than $O(w)$ per increment, and if so, how?
(Obviously, in practice, $w$ will be reasonably small, and it's necessary to keep a buffer of the $w$ most recent data points anyway, so it'll be simpler and likely faster just to recompute the proper geometric mean each time. But I'm interested in the math and process of a “proper” rolling solution.)