[UPDATE 4:30 p.m. EDT] Tesla missed profit expectations, losing more than expected, but it generated more revenue and wider margins than forecasted. It also sold more cars, sending the stock price up in after-market trading. Click here for the results.

Original story begins here:

Tesla is cutting its losses, literally.

The Palo Alto, Calif.-based maker of the acclaimed Model S luxury electric car is expected to report a smaller loss in its second quarter ending June 30 after spending heavily last year to streamline its production and boost sales.

Analysts polled by Thomson Reuters see Tesla Motors Inc. (NASDAQ:TSLA) losing $18.8 million, or 17 cents per share, on $383 million in revenue when it reports its earnings after markets close on Wednesday.

The company founded by inventor and entrepreneur Elon Musk a decade ago reported its first quarterly profit after taxes, of $11.2 million, in the first three months of this year, thanks in part to $68 million in revenue generated from the sale of carbon credits under California’s compliance offset program.

But despite falling back into the red, Tesla has narrowed its losses from the same quarter last year, when it lost $79 million on a meager $30 million in revenue. The company said it sold about 4,750 Model S sedans in the first quarter and has said it would reach a milestone of more than 20,000 unit sales by the end of the year.

“Everything Tesla has accomplished in the past six months – getting their NUMMI plant [Tesla’s Fremont, Calif.-based manufacturing facility] up to speed and paying off their government loans early – suggests they are capable of sustained growth versus flash-in-the-pan results we’ve seen from other electric car makers in recent years,” Karl Brauer, senior analyst at automotive vehicle valuation company Kelley Blue Book, told International Business Times.

What should investors look for in today’s earnings report? Tesla doesn’t report monthly sales figures like other automakers do, so look for guidance on second-quarter and future sales volume. Musk told The Detroit News in an interview last month that his company is churning out 400 cars per week to fulfill U.S. orders, a rate necessary for the company to meet its goal of selling at least 20,000 cars by the end of the year. The key to Tesla’s long-term success will be maintaining and then quickly boosting that production rate. The introduction of the Model X mid-sized crossover next year should help.

Also look for gross margin — how much the company makes on the sale of each car — which Tesla says will hit 25 percent by the end of the year. Analysts estimate margins will increase in the second quarter by 1.4 percentage points to 18.8 percent, largely thanks to an increase in the price of options. Tesla’s target consumers – buyers of pricey luxury cars – are thought to be less likely to balk at price increases for add-ons, and it allows the company to expand margins without changing the starting price of about $71,000 for the 60kWh base Model S. Recent price increases include $1,000 more for the panoramic roof. The recent margin-expanding adjustments to the numerous options has led to some backlash on Tesla's Forum website.

The company plans to double its production rate by the end of next year as it embarks on global expansion. The Model S recently went on sale in Europe and is on its way to China, the world’s largest auto market with a rapidly expanding base of luxury-auto buyers, where a showroom is expected to be opened in Beijing’s tony Parkview Green Mall before the end of December. Any indication of an increase in weekly output will be welcomed by Tesla bulls because it would suggest the company will hit or exceed expected sales volume for the year.

The company’s stock price spiked 183 percent in the second quarter, topping $100 toward the end of May after it announced it paid off its $451.8 million Department of Energy loan nine years ahead of schedule. Investors had other reasons to cheer over the past quarter – namely the announcement of an aggressive expansion of Tesla's supercharger network and the unveiling of its quick-swap battery system.

Regarding those carbon credits that helped Tesla post its first profit in the first quarter: The California Air Resources Board could decide later this year to cut off bonus credits Tesla has been receiving for committing to a way to offer quick refueling with its 90-second battery-swap system.

Dave Clegern, a CARB spokesman, told IBTimes that the change isn’t directed at Tesla but rather to prevent companies from collecting credits on technology they have yet to implement.

“There are potentially other companies and manufacturers that could come forward asking for carbon credits for technology they haven’t yet implemented that they might not implement,” Clegern told IBTimes. “The reason why Tesla came through was because they showed enough progress in the technology, and we didn’t have grounds to deny their request. However, if you look at what they’re doing – building these supercharger networks – they’re obviously in it for the long run. They’re not doing his just to get some credits from CARB. They’re doing it to sell cars.”

The change to the CARB bonus-credit loophole, however, will reduce Tesla’s revenue from the sale of carbon credit offsets. How this will affect the company’s ability to turn a small profit in the fourth quarter, as analysts and the company both expect, will probably be revealed some time in the third quarter.

The eventful second quarter has rocketed the company’s stock price, and opinions seem significantly divided on just how much Tesla is worth right now, considering that it was trading below $40 just four months ago.

“I think the exuberance for Tesla is over the top. There’s probably a lot of speculation going on, people hoping that they’ll get bought,” Michelle Krebs, senior analyst for automotive pricing and information provider Edmunds.com, told IBTimes in an interview last month after a Goldman Sachs auto industry report suggested the company’s stock was overpriced.

“There’s always been the thinking that since Toyota is an investor they would eventually swallow it up,” she added. “Or, because Daimler is an investor, they would eventually swallow it up. It’s a little overheated. The electric car business is limited and Tesla has one expensive model right now.”

In 2009, Daimler AG (FRA:DAI), the German maker of Mercedes-Benz and Smart cars, bought 10 percent of Tesla for $50 million about a year before it went public. Toyota Motor Corporation (TYO:7203), the world’s top auto company by sales volume, bought $50 million in Tesla shares when the company went public in July 2010 and the stock was worth about $20 a share. The company’s stock price closed Tuesday at $142.15.

The Goldman Sachs report by auto analyst Patrick Archambault said Tesla’s stock should be worth between $58 and $113 per share – depending on three scenarios of future sales volume of up to 250,000 units per year by 2018. The news shaved more than 14 percent off Tesla’s stock on July 16.

But then two days later Dougherty & Co. analyst Andrea James helped boost the rebound in stock price by suggesting Tesla would be headed to $200 a share based on an assumption that it would “eventually” sell up to 500,000 units a year at a 25 percent margin. (See the full interview with James on Bloomberg TV here.)

Whether Tesla is the future of luxury electric cars or an experiment destined to fail — history is littered with failed automotive startups — is a story that's yet to be completed. But the story so far has gotten lot more interesting in recent months.