Hewlett-Packard might need to spin out its printer and computer units.

And investing in higher margin software and services, a la IBM, could turn out to be exactly the right diagnosis for what ails the Palo Alto tech giant.

But think of Apotheker as a doctor who correctly diagnoses an illness but lacks the bedside manner and skills to deliver the cure.

Like when Leo paid $11.1 billion for British software company Autonomy, which HP now says was nearly $9 billion too much, inflated by creative accounting that is currently being investigated by the FBI.

Analysts at UBS and Technology Business Research aren’t saying that Leo was right. But they endorse his prescription.

“HP Software continues to be the promising component of HP’s financial performance and future outlook, growing 15 percent year to year to $1.2 billion in the quarter,” Technology Business Research analyst Jillian Mirandi wrote.

Software revenue is only 4 percent of HP’s total sales, but Mirandi wrote that it has the best operating margin, growth prospects and hot targets: IT and cloud management, big data analytics and meaning-based computing (Autonomy).

UBS analysts Steven Milunovich and Peter Christiansen were banging the drum for an HP breakup before the huge Autonomy write-down and a $6.9 billion fourth-quarter loss was posted on Nov. 20.

They argue that if HP breaks into two separate businesses — one selling printers and personal computers and the other selling products to businesses — the stock is worth $20 a share, about two-thirds more than its current value.

The question is whether the current team of HP doctors, led by Meg Whitman, have the stomach for the surgery.

So far, they don’t appear to want to open up the patient. But after five straight quarters of declining revenue, investors and analysts are losing patience.