Fix arithmetic optimization, add access optimization condition