IBM (IBM 0.16%) shareholders haven't had a lot to cheer about. The stock has underperformed the S&P 500 for the last 10-, five-, three-, and one-year periods. 

But just because a stock has underperformed doesn't mean investors should sell or avoid it entirely. According to legendary investor Warren Buffett, stocks represent pieces of businesses. So the best way to get a read on where a stock is heading is to look at how the business is performing and where management is investing for growth.

With that wisdom in mind, let's take a look at IBM.

A figurine of a man standing in front of an ascending stack of coins.

IMAGE SOURCE: GETTY IMAGES.

Why IBM has underperformed

The stock's underperformance seems to have put a lot of investors and analysts to sleep. Out of 25 analyst ratings on the stock, only seven recommend buying the shares, 15 recommending holding, and three recommend selling. When the company in question hasn't managed to grow revenue in 10 years and faces intense competition from several household names in technology, including Amazon.com, the ratings are not surprising. 

But when we look at where the business has been and what it's doing now, there are good reasons to believe IBM is beginning to turn a corner.

IBM has spent the last several years transitioning from legacy hardware to new software services that management expects to drive long-term growth. Since taking over in 2012, CEO Ginni Rometty has divested underperforming businesses that were contributing revenue but were unprofitable. In their place, Rometty made numerous acquisitions, which has positioned IBM in growth markets like mobile solutions and cloud.

Some transitions take time, especially for a company that does $80 billion in revenue every year -- they don't call IBM "Big Blue" for nothing. Shedding older assets, while nursing a limited market for aging business lines, has put pressure on IBM's revenue, which is why there hasn't been any growth. 

However, IBM's second-quarter earnings report may be starting to change some minds about the stock's prospects. Revenue was up 4% year over year on a reported basis, and up 2% excluding currency changes. Excluding currency, that's IBM's best quarter of growth in seven years. 

Big Blue is a sleeping growth machine 

IBM started to show improvement in the fourth quarter of 2017 when the company finally broke a long string of declining revenue growth. The company has now put together three consecutive quarters of top-line growth, and at least one analyst has already upgraded the stock based on the belief that IBM is on the verge of sustainable growth. 

The reason is IBM's soaring growth in cloud. Even with competition from major cloud providers like Amazon, Microsoft, and Alphabet, IBM's cloud revenue grew 23% year over year in the last quarter, and the segment generated $18.5 billion in revenue on a trailing-12-month basis. Cloud revenue now makes up 23% of IBM's revenue. 

Looking across the business, revenue derived from "Strategic Imperatives" was up 15% in the last quarter. That's the label management uses for areas that are expected to drive long-term growth, such as cloud, security, mobile, analytics, artificial intelligence, and blockchain. Altogether, revenue from these markets made up 48% of Big Blue's trailing-12-month revenue. 

IBM is still dependent on some hardware to drive growth, such as its mainframe business. This has been Big Blue's area of expertise for a long time. Its z14 server has enjoyed a strong upgrade cycle, with growth of more than 100% in the second quarter. The cycle will eventually flatten out, but systems revenue (which includes mainframes) made up only 11% of total revenue in the last quarter. 

As revenue from cloud and other strategic imperatives continues climbing as a percentage of total, prospects for sustainable top-line growth are looking better and better.

IBM shares are cheap

The nice thing about the stock's valuation right now is that it doesn't matter how much IBM grows. With a very low forward P/E multiple of only 10.8, any amount of growth should be enough to send shares higher from here. 

The stock's low P/E reflects analysts' expectations for minimal earnings growth. The consensus analyst estimate expects IBM to grow earnings less than 1% annually over the next five years. With the growth IBM is getting out of its strategic imperatives right now, it's a good bet IBM will beat those expectations. Currently analysts expect the company to grow non-GAAP earnings by 9% this year to $13.81.

To put a cherry on top, IBM also pays a generous dividend yield of 4.22%. Big Blue continues to distribute cash to shareholders while pouring billions of dollars out of free cash flow into high-growth opportunities.

Add all of that up and IBM looks like a compelling buy.