presto-main/src/main/java/io/prestosql/sql/planner/planprinter/HashCollisionPlanNodeStats.java/HashCollisionPlanNodeStats/computedWeightedStdDev
class HashCollisionPlanNodeStats:    private static double computedWeightedStdDev(double sumSquared, double sum, double totalWeight)
    {
        double average = sum / totalWeight;
        double variance = (sumSquared - 2 * sum * average) / totalWeight + average * average;
        // variance might be negative because of numeric inaccuracy, therefore we need to use max
        return sqrt(max(variance, 0d));
    }