NVIDIA was forced to recall 88,000 of its SHIELD tablets ahead of today's earnings report. Credit: NVIDIA. 

Shares of NVIDIA (NASDAQ:NVDA) were up more than 9% in late trading as investors cheered better-than-expected second-quarter results, and surprisingly good third-quarter revenue guidance. Here's a closer look at the fiscal Q2 totals versus Wall Street's projections:

NVIDIARevenueYOY GrowthEPSYOY Growth
Consensus estimate  $1,011.21 million  (8.3%)  $0.20  (33.3%)
Q2 actual  $1,153 million  4.5%  $0.34  13.3%
DIFFERENCE  $141.79 million  12.8%  $0.14  46.6%

Sources: S&P Capital IQ and NVIDIA press release. 

Commenting on the results, CEO Jen-Hsun Huang said in a press release:

Our strong performance in a challenging environment reflects NVIDIA's success in creating specialized visual computing platforms targeted at important growth markets. Our gaming platforms continue to be fueled by growth in multiple vectors -- new technologies like 4K and VR, blockbuster games with amazing production values, and increasing worldwide fan engagement in e-sports. We're working with more than 50 companies that are exploring NVIDIA DRIVE to enable self-driving cars. And our GPU-accelerated data center platform continues to make great strides in some of today's most important computing initiatives -- cloud-based virtualization and high performance computing applications like deep learning. Visual computing continues to grow in importance, making our growth opportunities more exciting than ever.

What went right: Cash is flowing nicely. Year over year, cash from operations jumped 69.8%, to $163 million, while free cash flow nearly doubled -- from $74 million to $139 million. All told, NVIDIA still has $4.5 billion in cash and short-term investments versus $1.4 billion in long-term debt. This is more than enough capital for management to keep paying dividends -- the stock yields 2% as of this writing -- while repurchasing stock -- $400 million worth in the second quarter.

What went wrong: NVIDIA took two major charges to earnings in Q2 that weren't reflected in most analysts' earnings estimates: $0.19 a share for winding down its Icera modem operations, and another $0.02 for expenses related to recalling an estimated 88,000 SHIELD tablets

What's next: Looking ahead, NVIDIA forecasts $1.18 billion in revenue, with a margin of error of plus or minus 2%. Gross margin is expected to come in between 56.2% and 56.5%, with a margin of error of 50 basis points. Net profits will suffer from $15 million to $25 million in restructuring charges.

Analysts tracked by S&P Capital IQ have the company generating $1,099.34 million in revenue, and $0.28 a share in profit after accounting for stock-based compensation and other noncash items. That compares with $1,225.38 million and $0.39 a share, respectively, in last year's fiscal Q3.

Longer term, analysts have NVIDIA growing earnings by an average of 11.64% annually during the next three to five years. 

In the meantime, investors should pay close attention to efforts to diversity the business. The SHIELD tablet may have had its problems, but it isn't a bad idea. Evidence of successful diversification is key to NVIDIA's long-term growth and profitability.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.