Hewlett-Packard Enterprise (HPE 0.24%) and IBM (IBM -8.25%) have been major rivals in the enterprise hardware and software markets for decades. Both stocks are also considered slow-growth "mature" tech plays owned for stability instead of growth. Let's take a closer look at these two tech giants to see which is the better long-term buy at current prices.

Image source: Getty Images.

Understanding HPE's business model

HPE split with HP Inc. (HPQ 0.11%), which retained HP's PC and printing businesses, late last year. HPE generates most of its revenue from four main divisions -- the enterprise group (51% of revenues last quarter), enterprise services (37%), software (6%), and financial services (6%).

The enterprise group unit provides IT infrastructure solutions, the enterprise services unit provides IT consulting services, the software unit provides automated IT solutions, and the financial services unit provides financing options and scalable IT solutions like consumption-based pricing.

Even before splitting with HP, HPE focused on downsizing its businesses. In a stunning move, it exited the competitive public cloud market last October. Earlier this year, HPE announced plans to spin off and merge its struggling IT services unit with Computer Science Corp. (CSC) in an $8.5 billion deal. In September, it announced it would also spin off and merge "non-core" assets like application delivery management, big data, and enterprise security with Micro Focus International in an $8.8 billion deal.

Those spinoffs, along with other cost-cutting measures, resulted in hundreds of layoffs. However, HPE is still making strategic acquisitions of higher-growth, data-driven businesses like supercomputer maker SGI, which it recently acquired for $275 million.

Understanding IBM's business model

IBM's top line is split between five units -- cognitive solutions (22% of revenues last quarter), global business services (22%), technology services and cloud platforms (45%), systems (8%), and global financing (2%).

Cognitive solutions include its solutions software and transaction processing software; global business services cover its IT consulting services, global process services, and application management; and tech and cloud platforms include its infrastructure services, tech support, and integration software. Systems include its high-end servers, mainframes, and OS software, and the financing arm handles financing and used product sales.

Like HPE, IBM has been streamlining its business by divesting slower-growth units like its desktop PC, low-end server, and chipmaking businesses. But unlike HPE, IBM is more aggressively focused on bulking up its higher-growth "strategic imperatives" businesses (cloud, analytics, security, mobility, social) with acquisitions. Big Blue has already acquired a dozen companies in 2016 to strengthen those businesses -- which posted 16% annual sales growth last quarter and accounted for 40% of its trailing-12-month revenue.

How fast are HPE and IBM growing?

HPE and IBM are both struggling to grow their top lines amid sluggish enterprise spending, currency headwinds, and tough competition from nimbler rivals. HPE's sales fell 6.5% annually last quarter, and analysts expect its revenues to fall 1% next year. IBM has reported 18 consecutive quarters of year-over-year sales declines, and analysts expect its revenue to fall about 2% this year and another 0.3% next year.

But on the bottom line, HPE's earnings are expected to improve 4% this year and 7% next year thanks to aggressive cost-cutting measures, divestments, and buybacks. IBM's earnings are expected to fall 10% this year, due to a drastic reduction in buybacks and higher investments in its strategic imperatives, but possibly rebound 3% next year.

Which stock is a better income play?

HPE returned $2.9 billion to shareholders -- mostly through $2.7 billion in buybacks -- during the first three quarters of the year. HPE believes its cash position in fiscal 2017 will be strengthened considerably by over $1 billion in cash and debt transfers from CSC and a $2.5 billion cash dividend from Micro Focus. This means its current forward yield of 1%, which pales in comparison to HP's 3.3% yield, might get a big increase next year.

IBM returned $6.6 billion to its shareholders over the past three quarters with $4 billion in dividends and the rest in buybacks. Big Blue currently pays a forward yield of 3.6%, and it has hiked that dividend annually for 16 years.

The valuations and the verdict....

HPE currently trades at 10 times earnings, which is lower than IBM's P/E of 13 and the industry average of 21 for IT services providers. HPE also has a P/S ratio of 0.7, which is much lower than IBM's P/S ratio of 1.8.

It's a close call, but HPE's more streamlined business model, stronger earnings growth, and lower valuation make it a more compelling buy than IBM. IBM remains a solid income play for conservative investors, but I believe its stock currently has less upside potential than HPE's.