Relational operators take precedence over the logical operators.
For example:
IF(0.0<x .AND. x<1.0) y=1.0/x
.NOT. takes precedence over .AND.
.AND. takes precedence over .OR.
When in doubt insert extra brackets.