Hewlett-Packard and IBM (IBM 0.16%) are often seen as aging tech giants with stagnant growth. To shake off that stigma, HP recently split into two companies -- the enterprise-focused Hewlett-Packard Enterprise (HPE) and the PC and printer vendor HP Inc (HPQ -0.11%). That's also why IBM sold its PC and low-end server businesses to Lenovo, paid GlobalFoundries to take over its chip manufacturing business, and dumped other lower-margin businesses. Let's take a look at how HPE and IBM have fared after those changes, and if either stock has become a decent long-term investment.

Source: Hewlett-Packard Enterprise. Source: HPE.

HPE's strengths and weaknesses
During HP's final quarter as a single company, HPE's businesses all posted weak growth due to macro challenges across the enterprise market. Enterprise group revenue from hardware and related services rose 2% annually to $7.4 billion. Revenue from enterprise services, which were hurt by cloud competition and market share loss, slipped 9% to $5 billion. Software revenue declined 7% to $958 million, while financial services revenue fell 11% to $802 million. HPE's total revenue fell 4% annually to $14.1 billion, but still exceeded downbeat analyst estimates by $600 million.

Analysts expect HPE's revenue to decline 7% in fiscal 2016, due to the ongoing headwinds facing the enterprise market. HPE's earnings are only expected to grow less than 2% annually over the next five years. However, HPE intends to return over half of its estimated free cash flow in 2016 to shareholders with $400 million in dividends and the rest in buybacks. This indicates that its forward dividend yield of 1.6% could rise, and that its low forward P/E of 7 could be tightened up by a lower share count.

IBM's strengths and weaknesses
Last quarter, IBM posted its 15th straight quarter of annual sales declines. Tech services revenue fell annually 7.1% to $8.1 billion, business services revenue declined 9.9% to $4.3 billion, software revenue plunged 10.7% to $6.8 billion, and hardware revenue dipped 1.4% to $2.4 billion. Total revenue fell 8.5% to $22.06 billion, narrowly beating expectations by $20 million.

IBM's revenue from its higher-growth "strategic imperatives" businesses -- cloud, analytics, mobile, social, and security -- grew 10% annually. However, that represents a slowdown from 20% and 17% growth in the second and third quarters, respectively. For the full year, strategic imperatives revenue rose 17% and accounted for 35% of IBM's sales. However, these "strategic" businesses are all tucked into IBM's other slowing divisions, obfuscating IBM's underlying growth if those five businesses are excluded.

Looking ahead, analysts expect Big Blue's sales to fall 4.6% in fiscal 2016, but its earnings are expected to grow 7% annually over the next five years. IBM has slowed down its buybacks, but it still paid out $5 billion in dividends and bought back $4.5 billion in stock over in 2015 -- which used up nearly 70% of its free cash flow. IBM pays a forward annual yield of 3.9% and currently trades at 9 times forward earnings.

An IBM-powered data center. Source: IBM.

How are HPE and IBM different?
IBM and HPE's business units seem similar, but there are two key differences. First, HPE continues to sell x86 servers, which IBM no longer sells. Second, IBM remains invested in the public cloud market, but HP shuttered its public cloud platform Helion last October.

IBM exited the x86 server business because it was a low-margin one which couldn't compete against market leaders HP and Dell. Likewise, HP exited the public cloud business because it was too capital intensive to compete against top players like Amazon (AMZN 1.30%). However, both IBM and HPE remain invested in "hybrid cloud" services which bridge the gap between on-site private clouds and public cloud services. These solutions are popular with larger companies which aren't ready or willing to migrate all their data to the public cloud.

Which stock has a brighter future?
Both HPE and IBM are cheap relative to their industry peers, but I believe that IBM is a better investment because its strategic imperatives are growing in importance, it remains committed to strengthening its public cloud options against Amazon, and it pays a bigger dividend.

Meanwhile, HPE hasn't proven that it can thrive as a stand-alone business without the shared cash flows of HP. HPE is a market leader in x86 servers, but sales could continue slowing due to market competition and customized "white box" cloud servers. HPE's acquisition of Aruba Networks last year, which boosted its networking hardware presence, could be undermined by market leaders like Cisco . Lastly, HPE might regret its early exit from the public cloud market as services like IBM's Bluemix and Watson experience higher growth than its hybrid cloud efforts. Unless HPE can overcome those challenges, I think investors should stick with Big Blue for now.