Two algorithms for computing the matrix cosine based on new Hermite approximations