presto-main/src/main/java/io/prestosql/operator/aggregation/AggregationUtils.java/AggregationUtils/getCorrelation
class AggregationUtils:    public static double getCorrelation(CorrelationState state)
    {
        // This is defined as covariance(x, y) / (stdev(x) * stdev(y))
        double covariance = state.getC2();
        double stdevX = Math.sqrt(state.getM2X());
        double stdevY = Math.sqrt(state.getM2Y());

        // stdevX and stdevY deliberately not checked for zero because the result can be Infinity or NaN even
        // if they are both not zero
        return covariance / stdevX / stdevY;
    }