@Override
    public Value function(Function function, Value value) {
        // use the tensor implementation of max and min if the argument is a tensor
        if ( (function.equals(Function.min) || function.equals(Function.max)) && value instanceof TensorValue)
            return value.function(function, this);

        try {
            return mutable(function.evaluate(this.value, value.asDouble()));
        }
        catch (UnsupportedOperationException e) {
            throw unsupported("function " + function, value);
        }
    }
Create a double which is frozen at the outset.
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/DoubleValue.java