Creates a lookup table betwen the vectors x and y. If x is not in increasing order, the vectors are sorted before being stored.