Improvements to inequality solving

fixes #8206 (please feel free to any others that are related that also work with these changes)
fixes #8518
I though, the algorithm below was much more generic, isn't?

But if you are really want this sanity check - we have a specific utility function to find singularities (or raise an error if it can't).  You may want to use this.

(Sorry for slow review of this pr.)