simplify(?) comparator function and use near float equality

maybe this is causing instability?

hopefully a no-op.

Auditors: rahul, nsanch