Note the distinct-subexpression optimization to increase cache hit rate.