simplify sorting of roots in _roots_trivial