I wonder if it makes sense to scan the expression to see if it `has` a `sec` or `csc`.  I wonder if a quick scan over the tree for these elements might be worth it to eliminate useless rules.  We could annotate each function with necessary terms and filter before application.