example of optimize-by-tree-rewrite