Refactor processing of inequalities with oo/-oo, fixes #7775