see #611
I wouldn't be surprised if something quite simple was enough to get almost the best result in each case, for instance something like: if the expression is small (its size + number of symbols) then it is better to use ite, otherwise it is better to use proper branching.