HP Enterprise CEO Meg Whitman Flickr/HP/HP Deutschland Meg Whitman is one of the most generously compensated CEOs compared to most of her peers, according to a new report from UBS analyst Steven Milunovich.

She's especially paid better than one of her direct competitors, IBM CEO Ginni Rometty.

"In considering CEO compensation relative to market cap, the heads of Nimble, 3D Systems, and HP are better paid while IBM's Rometty is underpaid albeit following a couple difficult years," Milunovich wrote.

One of the things making Whitman's compensation package so sweet: a huge golden parachute.

Whitman would get nearly $91 million if HP gets acquired – more than double her peers – and $51 million if she's forced out (not fired for cause) – again, nearly double.

That compares to zip that Tim Cook gets in either situation and $0 for Rometty for an acquisition, or $14.6 million if she's terminated.

Here's the charts:

Calculating bonuses

IBM CEO Ginni Rometty Business Insider/Julie Bort It's also interesting what these CEOs and their executive teams need to do to get a bonus.

Whitman and team's cash bonus is weighted more towards cash flow than to improving revenue. The stock bonus is based on profit and stock performance (50/50), Milunovich reports. So she does well if she controls costs, even if she doesn't grow the top line.

IBM's Rometty and her team's cash bonus is "more dependent on profit and cash flow than on revenue," Milunovich writes. "We would like to see a bit more weight on revenue ... We've argued that IBM could use more of a growth mentality and should shrink in order to grow."

Where revenue is factored in, it's weighted toward growing revenue in IBM's "strategic" initiatives, the new areas that IBM is investing in that replace its older, shrinking business units. And for stock bonuses for IBM, its 70% profit and 30% cash flow. Again, IBM executives do well if they control costs.

In comparison, Apple, which recently posted the best quarter of any company ever, requires Cook and crew to perform equally well on revenue growth and profit for a cash bonus (weighted 50/50). Stock bonuses are based entirely on stock performance.