2018 was an up-and-down year for the stock market. The S&P 500 climbed nearly 10% by late September, reaching an all-time high, but then plunged in the last three months of 2018 to end the year down 6%.

However, for General Electric (NYSE:GE) and JetBlue Airways (NASDAQ:JBLU), there was far more down than up last year. JetBlue stock plunged 28% in 2018, while GE shares lost more than half of their value during the year.

JBLU Chart

General Electric and JetBlue Airways 2018 Stock Performance, data by YCharts.

Yet the stocks' 2018 declines were driven to a large extent by investors panicking over short-term headwinds. General Electric and JetBlue both have substantial room for long-term earnings growth. Shares of both companies could potentially double over the next year or two as they address the problems that cropped up in 2018. That's why GE and JetBlue are my top two stocks to buy in 2019.

Stability is the key to a recovery at General Electric

Check out the latest GE earnings call transcript.

GE stock plunged in 2017 and 2018, primarily due to sharp deterioration in its power business' sales and profitability. Investors also grew worried about the GE Capital segment's potential liabilities. (In early 2018, GE Capital took a $9.5 billion pre-tax charge and announced that it would need to build up an additional $15 billion in reserves to offset higher-than-expected claims for some insurance policies on its books.)

Analysts expect GE to post adjusted earnings per share of $0.71 in 2018 -- just a sliver of the $2 target that management was clinging to as recently as 2017. Analysts expect some improvement in 2019, but they still expect earnings per share (EPS) to be unimpressive at $0.85.

A GE gas turbine.

Weak results in its power business have torpedoed GE's profitability. Image source: General Electric.

Yet there are several reasons for optimism. First, a series of spinoffs and asset sales -- plus the reduction of its dividend -- will allow GE to reduce its debt substantially. Two months ago, it completed the $3.25 billion sale of its distributed power business. Shortly thereafter, General Electric sold a significant chunk of its shares in Baker Hughes, a GE Company, raising nearly $4 billion. It will receive another $2.9 billion this quarter from the sale/spinoff of its transportation division.

Second, GE appears to be moving ahead with a plan to spin off its growing, highly profitable healthcare business by the end of 2019. The healthcare's segment profit surpassed $3.4 billion in 2017 and rose 8% year over year through the first nine months of 2018. A stand-alone GE Healthcare company could be worth more than $40 billion, or about $5 per GE share.

Most of that value will go directly to shareholders. But a spinoff also could assist General Electric's efforts to clean up its balance sheet. The healthcare company could take on a meaningful chunk of GE's debt and pension liabilities. GE also plans to sell a minority stake to outside investors, thereby raising additional cash.

Third, GE Aviation is a fast-growing, highly profitable, underappreciated asset. As the largest jet-engine manufacturer and servicer in the world, it's in prime position to benefit from strong growth in global air travel. Segment profit could double over the next decade, more than replacing the lost income and cash flow from the businesses GE is selling. The jet-engine business is complemented by GE's aircraft-leasing operation, which is set to earn about $1.2 billion in 2018.

As GE improves its balance sheet -- and if it can show signs of progress in stabilizing its power business -- the stock's valuation could improve significantly. It's hard to pinpoint the exact timing of a turnaround, but the healthcare and aviation businesses alone are probably worth twice GE's current market cap. As a result, GE stock could double in 2019, recovering most of its 2018 losses.

JetBlue is primed for explosive earnings growth

Check out the latest JetBlue Airways earnings call transcript.

JetBlue Airways was my top stock pick for 2018, and that didn't work out too well. Stiff competition and overcapacity in some of its markets held back its unit revenue growth for much of the year. Revenue per available seat mile (RASM) rose just 2% in the first nine months of 2018. Meanwhile, JetBlue's average fuel price shot up 34%.

A JetBlue plane preparing to land

JetBlue didn't live up to its full earnings potential last year. Image source: JetBlue Airways.

This has led to a sharp decline in the carrier's profit margin and EPS. JetBlue's projected 2018 adjusted EPS of $1.49 would be its worst result since 2014.

However, the outlook for 2019 is far better. First, between September and this month, JetBlue has eliminated a variety of underperforming flights. It's redeploying that capacity into its most profitable markets. Second, JetBlue increased its bag fees and some other fees in late August. These moves are already starting to have a positive impact, with RASM expected to rise 1.5% to 3.5% in the fourth quarter, despite tough year-over-year comparisons.

Third, cost trends are set to change dramatically in 2019. JetBlue's structural cost program and its plan to add seats to each of its A320s will lead to lower nonfuel unit cost growth. Even more importantly, the market price of jet fuel has plunged about 30% over the past three months. As things stand now, JetBlue's fuel costs would decline in 2019.

Thus, JetBlue's profit margin could improve significantly this year. Further refinement of its route network, additional cost savings, and the introduction of a "basic economy" product could drive further margin expansion in 2020. As a result, JetBlue predicted back in October that EPS would surge to $2.50-$3.00 by 2020 -- and its base-case scenario called for jet fuel costs of $2.33 per gallon compared to less than $2.00 per gallon today.

If fuel prices remain low, the high end of that 2020 earnings outlook would be achievable. And JetBlue has plenty of room for further earnings growth beyond 2020. Thus, it's not hard to imagine JetBlue stock doubling to more than $30 in 2019.

The upside far outweighs the risks

GE stock and JetBlue stock both appear to be severely undervalued today. Between the two, JetBlue is probably the safer bet. Of course, there are risks: An economic slowdown or another spike in oil prices could undermine JetBlue's EPS growth plan. However, the company has lots of potential paths to profit improvement and ample flexibility to adapt its business plan based on industry conditions.

General Electric stock carries greater risk. The GE Power business hasn't bottomed out yet, and the complexity of GE Capital means there could be more unexpected charges looming ahead. Yet GE's asset-sale activity is allowing it to improve its balance sheet, while the aviation segment's steady growth will provide a massive future profit stream that can be used to offset any unexpected losses at GE Capital and -- later on -- to reward shareholders for their patience.