boostorg / histogram

Fast multi-dimensional generalized histogram with convenient interface for C++14
Boost Software License 1.0
313 stars 74 forks source link

Fix variance calculation in accumulators::mean::operator+= #308

Closed HDembinski closed 3 years ago

HDembinski commented 3 years ago

The variance calculation of accumulators::mean::operator+= was broken. This was not caught by the corresponding test, since the test only checked the case when the two summed means were identical, where the faulty implementation happened to give the right answer.

The problem is fixed and a new test was added to check that the sum of two different mean accumulator states gives the same outcome as filling one accumulator with the data of both.