Hewlett-Packard (HPQ -0.25%) has totally crushed the market in 2013. Shares of the venerable but troubled computing behemoth shot up 97%, more than tripling the 29% return of the S&P 500. Despite falling out of the Dow Jones Industrial Average this summer, HP shares rank within the 15 best performers among the S&P 500's ticker storm.

Image source: Hewlett-Packard.

How did HP pull off that impressive trick?

First of all, it helps to start from a low point. When HP's stock hit rock bottom in November 2012, investors had lost a heart-stopping 76% of their shares' value in a relentless 30-month slide. Shares could be bought for less than five times forward earnings. Trailing P/E ratios were meaningless at the time, because HP was running on negative earnings.

So HP came into 2013 under a heap of negative expectations. You know the drill: The PC is a dead market walking, HP's revolving door in the CEO office is unnerving, this is the turnaround story that never ends.

But HP surprised everybody by not growing impatient with CEO Meg Whitman, who recently started her third year at the job. Her turnaround strategy is still chugging along, and HP has exceeded Wall Street's earnings targets in three of the last four earnings reports.

This was a "fix-and-rebuild year" in Whitman's eyes. It was the second year of her five-year turnaround plan, focused on tightening up leaky operations and shoring up the balance sheet. Whitman is particularly proud of bringing the cash conversion cycle down from 21 days to 17 days in 2013, because it's proof of a newfound fiscal discipline.

So the 97% rally in 2013 was a return to Business Management 101. HP didn't deliver any mind-boggling technological breakthroughs, and is still not much of a force in the mobile market. Instead, the company turned inward.

If Whitman's five-year plan works out perfectly, HP will become a new take on the IBM (IBM -0.89%) business model by 2016. With a core focus on software and services, the revamped HP would sell everything to everybody, especially in the corporate market where margins are high and the PC market has seemingly eternal life. IBM itself has perfected HP's target model and is moving on to refine it, but you could definitely pick worse role models than Big Blue.

But that's three years away, at best. In 2013, HP's laser focus on efficiency helped the company deliver some solid results, and has nearly doubled share prices in the process.