Improved the formatting of docsim_cosine.cc
Reimplemented cosine similarity.