NOTE: This is for a project I'm working on for fun, NOT production code.
So I'm working on a pet project that involves reading data in from a sensor and summing it up. The values are mostly floating point number mostly in the range (+/-)1 - (+/-)10 and the program is expected to run for at least 2-3 hours, and it collects around 1000 datapoints a second. The goal is to keep an accurate track of their sum, but after 3 hours or so there will be some drift in the calculation (which I would like to minimize).
So my main concern is that since the numbers can be positive and negative there will be too much cancellation that will ruin it, so what I was thinking of trying is to keep 2 kahan summations running, one for positive inputs and one for negative.
So for long runs can I expect this to lead to an increase in precision?