Embraer (NYSE:ERJ) shares tumbled again late last month, after the Brazilian aircraft manufacturer reported earnings that missed expectations (except for an unusually low tax rate).

ERJ Chart

Embraer 5-year stock performance, data by YCharts.

Embraer also cut its revenue guidance range for 2015 to $5.8 billion-$6.3 billion, down from $6.1 billion-$6.6 billion. All of the downside came from its defense segment, which has been hit hard by the Brazilian government's spending cutbacks. Embraer maintained its operating income guidance, though.

Embraer stock has now given up all of its gains from 2013 and 2014. However, the market seems to be overly pessimistic about Embraer's future prospects. Steady performance from its commercial airplanes and executive jets divisions along with easier comparisons should provide significant upside for the stock.

The quarter in brief
In Q2, revenue declined on a year-over-year basis in all three of Embraer's key business segments, but primarily in the commercial and defense segments. The company's operating margin also declined sharply, to 6.8%: down from 10.6% a year earlier. This drove a 45% year-over-year decline in operating income.

On the commercial airplanes side -- which represents more than half of Embraer's revenue -- it delivered 27 airplanes, compared to 29 in the year-earlier period. This drove most of the segment's $89 million revenue decline.

An unfavorable mix shift also affected the segment's results. In Q2 2014, Embraer delivered 13 of its larger E190 and E195 airplanes, along with 16 of the smaller E175. By contrast, the E175 constituted 22 of its 27 deliveries last quarter. The E175 brings in less revenue and typically has a lower profit margin for Embraer, contributing to the revenue and profit margin declines.

Embraer

The E175 is a less profitable model than its larger siblings. Image source: Embraer.

Meanwhile, the defense business was hit by two issues. First, the Brazilian government delayed the timetable for introducing Embraer's new KC-390 military transport jet. This will reduce Embraer's program development revenue for the next couple of years or so.

Second, the falling value of Brazil's real against the dollar meant that Embraer's Brazilian defense contracts will bring in less revenue. More immediately, it forces a cost base revision for accounting purposes: essentially a one-time charge marking up dollar-denominated costs to the new exchange rate. This charge was about $25 million in Q2, following a similar $30 million charge in Q1.

The future is brighter
Investors don't seem to realize that most of the factors holding back Embraer's profitability are transitory. As they fade in the coming months, Embraer's financial performance should bounce back.

First, on the commercial side, Embraer faces much easier comparisons going forward. In the first half of 2014, the larger E190 and E195 models made up 42% of Embraer's commercial deliveries. In the second half of the year, that dropped to 22% of the mix.

The E190 and E195 represent 34% of the firm backlog for current-generation E-Jets, or 28%, if you exclude 24 jets bound for JetBlue Airways that have been deferred until 2020 and beyond. This implies that Embraer's mix of deliveries should be somewhat better over the next two to three years than it has been in the last 12 months.

Second, on the defense side, Embraer's cost base revisions are essentially one-time items that will stop occurring when the real stops falling. With the real already having fallen sharply against the dollar in the past year, it is bound to stabilize eventually. That will remove a $55 million headwind that dragged down earnings in the first half of 2015.

Third, the cheaper real will provide a significant boost to Embraer's profitability. About 25% of Embraer's costs are real-denominated, but its commercial jets and executive jets are sold in dollars. This means that as the real declines in value, Embraer will earn higher margins in those segments.

The benefit of the cheaper real is already showing through in Embraer's ability to maintain its full-year earnings guidance despite the $55 million in cost base revision charges -- and more broadly, the impact from lower defense revenue. This benefit will continue to rise in the next few quarters as the cost reductions work their way through the supply chain. (Additionally, the real has fallen further against the dollar in recent weeks.)

Investors have dumped Embraer stock this year as its earnings have slumped. But the earnings trajectory is on pace to get a lot better in the second half of 2015 and in 2016. The future looks even brighter, as Embraer's next-generation E-Jets start arriving in 2018 and should generate significantly higher margins for the company. This makes the stock quite attractive at its current level.

Adam Levine-Weinberg owns shares of Embraer-Empresa Brasileira and is long January 2017 $17 calls on JetBlue Airways and long January 2016 $30 calls on Embraer-Empresa Brasileira. The Motley Fool recommends Embraer-Empresa Brasileira. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.