Simplify precedence function