The major loss of precision is from `sumSquares - sum*sum/count`, where a large number subtracts another. Changing the interface to `(count, avg, avgSquare)` would help avoid overflow but has nothing to do with precision. I agree with @etrain that we can improve it in a future PR.

The question is whether we should make `calculate(c0, c1)` and `calculate(count, sum, square)` a public method of `Impurity`. In either classification or regression, `Impurity` works like an accumulator. What we need is to describe how to process a label of type Double, how to merge two `Impurity` instances, and how to get impurity from an instance, which is very similar to `StatCounter`. It is strange to see Gini only implements the first but not the second, while Variance only implements the second but not the first. We probably need to reconsider the design here. For example, if we want to handle three classes in the future, we will run into a signature collision with `calculate(count, sum, squareSum)`.