presto-array/src/main/java/io/prestosql/array/IntBigArrays.java/IntBigArrays/med3
class IntBigArrays:    private static long med3(final int[][] x, final long a, final long b, final long c, IntComparator comp)
    {
        int ab = comp.compare(get(x, a), get(x, b));
        int ac = comp.compare(get(x, a), get(x, c));
        int bc = comp.compare(get(x, b), get(x, c));
        return (ab < 0 ?
                (bc < 0 ? b : ac < 0 ? c : a) :
                (bc > 0 ? b : ac > 0 ? c : a));
    }