Add a numerical component to the algebraic equivalence check.  This rejects expressions which are "obviously different" which take a significant time for the simplifier to establish as being different.
Merge branch 'master' of github.com:maths/moodle-qtype_stack