Please see any [1] of [2] these [3] to understand why it isn't as simple as "Y - X > 0", considering things like where the repayments are coming from, comparing the nominal annualized return to Treasury bond rates, all the fraud that will never be accounted for, etc., etc. Even pro-bailout articles [4] have to include weasel phrases like "on a risk-adjusted basis, even [such and such proposed Y - X] isn’t that big a profit, given the huge downside the government had," speaking directly to my point of how it's hard to properly account for risk, which is what any other lender would have done. Arguably, since there weren't any competitors to the US government for providing bailout money, the interest rate we use to judge whether it was "profitable" should be sky high.
[1]: http://www.nationalreview.com/article/395822/overselling-tar...
[2]: http://www.huffingtonpost.com/2012/04/25/tarp-profit-a-myth_...
[3]: http://www.forbes.com/sites/halahtouryalai/2012/04/25/dont-b...
[4]: https://www.washingtonpost.com/business/economy/bailout-high...