As with most things, there's a right time and a wrong time for a company to repurchase stock. While it generally sounds good from a public-relations perspective no matter the timing, a company that's enjoying a sky-high stock price could probably find better things to do with its free cash than buying back stock at historically high valuations.

IBM (NYSE:IBM) shareholders, however, needn't worry that their company's ongoing share-repurchasing  initiative is coming at ridiculously high prices, because its stock remains woefully inexpensive compared with its peers. The 14 million shares IBM has repurchased so far in 2017, let alone the 401.1 million since the end of 2008, haven't had the positive impact CEO Ginni Rometty and team had hoped for.

The classic IBM logo on a dark-colored wall.

Image source: IBM.

The upside

By the end of the second quarter report  on July 18, IBM had 939.6 million shares outstanding, down nearly 21 million from a year ago. Though IBM spent a whopping $1.4 billion on share buybacks last quarter, as well as another $1.4 billion in dividends, it still boasts cash and equivalents of $11.7 billion, well above last year's $7.83 billion.

As Rometty continues to transform IBM from old-school enterprise hardware to one of the leading cloud providers on the planet, it could be argued that its fairly aggressive repurchase efforts will eventually pay off. Buying back stock while IBM's stock price is under pressure is a sign of a management team confident in its future.

There are reasons for optimism, particularly the continued growth in IBM's critical strategic-imperatives results, which include cloud, data security, cognitive computing, and mobile solutions. Combined, the all-important group of cutting-edge technologies generated $8.8 billion of IBM's $19.3 billion in sales last quarter, equal to just shy of 46% of total revenue.

The highlight of IBM's second quarter was its $8.8 billion annual cloud-as-a-service revenue run rate. Software-as-a-service  (SaaS) and business-process-as-a-service (BPaaS) are expected to generate a combined $79.4 billion in revenue this year, and SaaS sales alone will nearly double to $75.7 billion in just three years.

IBM also generated $15.1 billion in cloud revenue the past 12 months, which puts it in rarefied  air with the likes of Microsoft (NASDAQ:MSFT) and its trailing 12 months of $18.1 billion in cloud sales. Similar to IBM, Microsoft is also targeting the SaaS and BPaaS market opportunities, and it's clearly working for both tech behemoths.

The downside

Instituting a share-buyback plan while a stock is under pressure makes sense, particularly if it positively affects the bottom line. With fewer shares outstanding, flat or even slightly lower revenue should result in comparatively solid per-share earnings results. But that's still not the case with IBM.

Despite its 21 million fewer shares compared with a year ago, let alone the 14 million fewer in 2017, IBM's per-share earnings excluding one-time items inched up just 1% to $2.97, versus last year's $2.62. By comparison, Microsoft is also in the midst of a share buyback, and it certainly helped its bottom line.

Last quarter, Microsoft's $89.5 billion in revenue was good for a 5% improvement, but with 123 million fewer shares available, its per-share earnings, excluding one-time items, soared 42% to $0.98. Keeping a good handle on expenses certainly played a key role in Microsoft's bottom-line results, but so, too, did its buyback initiative.

While it's true IBM's buyback efforts haven't had the positive impact some had hoped for, now is not the time to throw in the towel. Should investors be happy? Not yet, but with its stock down 12% this year and 10% the past 12 months, IBM investors will turn their frowns upside down in the long run.

Teresa Kersten is an employee of LinkedIn and is a member of The Motley Fool's board of directors. LinkedIn is owned by Microsoft. Tim Brugger has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.