Implemented cosine_similarity in C (buggy test results in tc_classifier)