Implemented optimizations of division and diff operations.