Warren Buffett’s Berkshire Hathaway recently accumulated a $1 billion stake in Apple. Maybe you’re wondering why, given that Buffett famously avoids technology stocks in favor of industrial companies, but the numbers speak for themselves.

With Apple Inc. AAPL, -3.17% , the legendary investor seems to be the voice of reason again. The gadget maker’s stock jumped 3.7% on Monday after Berkshire Hathaway’s BRK.B, +0.07% stake was announced, paring a decline in the past year to 27%.

In late April, Apple reported its first-ever decline in iPhone sales and a deep slump in China, once its fastest growth market. Anticipating Apple’s troubles, billionaire investors Carl Icahn and David Tepper unloaded their shares in the Cupertino, Calif.-based company.

Apple’s stock closed at $90.52 on Friday, trading for only 10.9 times the consensus 2016 earnings estimate among analysts polled by FactSet. A year ago, the stock was trading at 14.4 times.

ROIC tells the story

In December, we considered which companies might be able to continue handing outsized returns to investors based on returns on invested capital (ROIC) and the likelihood that the companies would continue to produce goods and services that people really want or need. (FactSet defines ROIC as earnings divided by the sum of the carrying value of a company’s common stock, preferred stock, long-term debt and capitalized lease obligations.)

Return on equity (ROE) is also a useful figure for stock investors, because it represents their portion of a company’s performance. But ROIC estimates management’s efficiency in allocating all types of money.

Apple’s return on invested capital for its fiscal second quarter was 27.5%. That was down from 31.2% a year earlier. Among the 228 companies in the S&P 1500’s technology sector for which this information is available from FactSet, Apple ranked 13th for the most recent quarter, which isn’t bad for a company that some people say is in its death throes. Remember that any quarter can greatly skew a company’s ROIC because of one-time events that distort earnings.

Here are the 10 S&P 1500 tech companies with the highest five-year average returns on invested capital:

Here are price-to-earnings ratios for the group, based on consensus current-year estimates:

So Apple ranks ninth for five-year ROIC, and investors currently believe the stock is only worth 11.3 times 2016 earnings. That P/E is only slightly higher than that of International Business Machines Corp. IBM, -1.72% .

IBM has been going through a painful multiyear transition as it tries to catch up in cloud services. Apple is at the worst period in its two-year product cycle and is facing heady competition in China.

Take a look at Apple’s five-year chart:

FactSet

You can see that there have been plenty of painful periods for Apple’s shareholders over the past five years. Memories tend to be short, and every time the stock heads south, there’s hysteria about the company’s supposed imminent demise.

It remains to be seen how big a hit the iPhone 7 will be, but there’s no question that Apple’s sales are still huge, despite the apparent failure of the Apple Watch.

Berkshire’s Buffett sees value in Apple’s stock. Do you? Quite a bit depends on whether the company can continue putting out products with features people are willing to pay a premium for. This is where your own analysis comes into play.

Also see:22 U.S. companies that just keep getting more profitable