renamed cosine_sim to cosine_cmp (to keep consistence with minhash_cmp)