Concerning #686: Allowed moving out negation (justified by #555)
Concerning #688: Added OP_TWICE
Concerning #686: Added simplification sin^2 + cos^2 -> 1