@ScalarFunction("quantile_at_value")
    @Description("Given an input x between min/max values of qdigest, find which quantile is represented by that value")
    @SqlType(StandardTypes.DOUBLE)
    @SqlNullable
    public static Double quantileAtValueDouble(@SqlType("qdigest(double)") Slice input, @SqlType(StandardTypes.DOUBLE) double value)
    {
        return quantileAtValueBigint(input, doubleToSortableLong(value));
    }
@Test
    public void testQuantileAtValueDouble()
    {
        QuantileDigest qdigest = new QuantileDigest(1);
        ImmutableList.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9).stream()
                .mapToLong(FloatingPointBitsConverterUtil::doubleToSortableLong)
                .forEach(qdigest::add);
        functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), 5.6)", toHexString(qdigest)),
                DOUBLE,
                0.6);
        functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), -1.23)", toHexString(qdigest)),
                DOUBLE,
                null);
        functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), 12.3)", toHexString(qdigest)),
                DOUBLE,
                null);
        functionAssertions.assertFunction(format("quantile_at_value(CAST(X'%s' AS qdigest(double)), nan())", toHexString(qdigest)),
                DOUBLE,
                null);
    }