Improve arithmetic optimization