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

Or maybe not, see #7838