reintroduced `factor` in `__trigsimp` instead of `_mexpand` to fix a bug in
test_essential.py