Merge pull request #1 from smichr/8237

8237: reverse when sign is -1, too
roots_quadratic in polyroots.py: returns appropriately sorted roots

Expressions like sorted(seq, key=default_sort_key) don't sort real
numbers in ascending order, because of default_sort_key implementation.
However, using a different key could produce errors for symbolic expressions.
Instead, one should try something like this:

list(ordered(seq, keys=[k1, default_sort_key]))

Where k1 is a key function that returns the item if the item is a real
number, but otherwise 0 (or any constant). This will cause symbolic
expressions to "tie", and then ordered will apply the default_sort_key
to them.
only do special sorting of real roots
Revert "only do special sorting of real roots"

This reverts commit 3a5529a3906c65f96f53056e46d0a4fa3f09a5c9.
Revert "roots_quadratic in polyroots.py: returns appropriately sorted roots"

This reverts commit 114a0dc9d2be9cd96925993c04b2fc7bf43fb46c.
only sort roots when needed
Revert "only sort roots when needed"

This reverts commit 59e4fd8b088610adf4a3ae4a6fed266e738cd9d6.
sort roots_trivial in same order as RootOf instances