@Override
    public TensorFunction<NAMETYPE> withArguments(List<TensorFunction<NAMETYPE>> arguments) {
        if ( arguments.size() != 2)
            throw new IllegalArgumentException("CosineSimilarity must have 2 arguments, got " + arguments.size());
        return new CosineSimilarity<>(arguments.get(0), arguments.get(1), dimension);
    }
Convenience for cosine similarity between vectors.
cosine_similarity(a, b, mydim) == sum(a*b, mydim) / sqrt(sum(a*a, mydim) * sum(b*b, mydim)).

@author arnej
vespajlib/src/main/java/com/yahoo/tensor/functions/CosineSimilarity.java