When the Dow Jones Industrial Average was reformulated in September, former technology leader Hewlett-Packard (NYSE: HPQ) was quietly replaced. It was yet another tough blow for a firm that is on track for its third straight year of sales declines. CEO Meg Whitman, who was just celebrating her second full year at the company's helm, could not have been pleased.

But Whitman is surely getting the last laugh. Because against the odds, Hewlett-Packard has turned out to be one of the top-performing tech stocks of 2013. Shares have doubled in value, putting the S&P 500 Index's 25% gain to shame. More than $25 billion in market value has been added, and Whitman has less need to worry about job security.