presto-main/src/main/java/io/prestosql/cost/ComparisonStatsCalculator.java/ComparisonStatsCalculator/averageExcludingNaNs
class ComparisonStatsCalculator:    private static double averageExcludingNaNs(double first, double second)
    {
        if (isNaN(first) && isNaN(second)) {
            return NaN;
        }
        if (!isNaN(first) && !isNaN(second)) {
            return (first + second) / 2;
        }
        return firstNonNaN(first, second);
    }