reverse roots in inequalities; add tests