Hewlett Packard has decided to continue making PCs after all.

In a stunning reversal of its August decision to spin off its PC division, HP will keep its stake in the personal computer business. The hardware giant had announced that it would kill of its smartphone and tablet products and would consider splitting the company in two. This idea was definitively scrapped when HP announced in a press release that it would keep its $40 billion its Personal Systems Group or PSG.

"HP objectively evaluated the strategic, financial and operational impact of spinning off PSG. It's clear after our analysis that keeping PSG within HP is right for customers and partners, right for shareholders, and right for employees," said Meg Whitman, HP president and chief executive officer. "HP is committed to PSG, and together we are stronger."

Whitman, a former eBay Inc. president had taken over as CEO of HP in September after HP's executive board removed Leo Apotheker from the position. Whitman had initially supported her predecessor's plan to move HP away from hardware to a focus on "enterprise information management." Apotheker's decision as well as the $10.3 billion deal to buy software company Autonomy Corp and killing off HP's TouchPad tablet just two months after its release had undermined investor confidence in the company. HP's stock plummeted 20% and customers questioned the direction HP was taking.

This time around, HP executives said the decision not to sell its PC division was after a lengthy analysis that involved Whitman and led by a small group in HP. The report showed that separating the PC business would have cost HP about $1.5 billion according to Hewlett Packard's finance chief, Cathie Lesjak. Setting up the PC division as a separate entity would have cost HP $1 billion a year.

"It slowly but surely became very clear that the math just wasn't going to work on this one," Lesjak said.

"If you try to hive a division off, it's really hard because you almost have to recreate the whole thing," Whitman said in the interview. She said she is also re-examining the webOS which HP had decided it would no longer support.

HP is also planning to go back to the tablet market despite the recent debacle with its TouchPad tablet. The company is working with Microsoft to release a tablet with Microsoft's new Windows 8 operating system.

"The market was created by Apple," Whitman said. "That doesn't mean there couldn't be a strong No. 2 player."