modify ordering of quadratic and binomial roots

This will merge #8237 with your PR while eliminating modifications to the trivial roots calculation.