It seems as if this works even if `cos` isn't present in the final result.

    >>> (exp(z) - exp(-z)).rewrite(cos)
    2*sinh(z)

I'm not familiar enough with `rewrite` to know if this is definitely safe, but it looks okay to me.