c==d&e==f is a "common subexpression". If it is precalculated:
the assignment statements will run in half the time. Especially because generate and replace spend a significant amount of time in single-threaded mode, the time in such statements can be significant. If the common subexpression can be given a meaningful name, this also enhances the readability of the program.