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