Rather than determining fee-rates for the mempool index scores and comparators manually in a rather tedious way (even involving floating-points), use the FeeFrac
class [1] to simplify and deduplicate the code. Note that though this is intended to be a refactoring PR, there might be subtle differences in behaviour due to floating-point arithmetic involved in the original code (to avoid overflows at the cost of precision loss), but these shouldn’t matter.
[1] introduced in PR #29242, commit ce8e22542ed0b4fa5794d3203207146418d59473