Frechet derivative of cos(x) wrt exp(x)