Net loss results for the second quarter of 2013 were positively impacted by a $9.3 million tax benefit which resulted from the partial release of the valuation allowance held against Cray's deferred tax assets. The second quarter of 2012 operating results included a $139.1 million pre-tax gain, which resulted from the sale of the Company's interconnect hardware development programme to Intel Corporation.
All figures are based on U.S. GAAP unless otherwise noted. A reconciliation of GAAP measures to non-GAAP measures is included with the financial tables. Non-GAAP net loss, which adjusts for selected unusual and non-cash items, was $7.0 million or $0.19 per share for the second quarter of 2013, compared to non-GAAP net income of $12.8 million or $0.34 per share for the second quarter of 2012.
Revenue for the six-month period ended June 30, 2013 was $164.0 million compared with $196.5 million in the prior year period. Non-GAAP net loss for the first six months of 2013 was $15.4 million, compared to non-GAAP net income of $21.8 million for the prior year period.
Total gross profit margin for the second quarter of 2013 was 32% compared to 41% for the second quarter of 2012. Non-GAAP total gross profit margin for the second quarter of 2013 was 33% compared to 41% for the second quarter of 2012. For the second quarter of 2013, product margin was 24% and service margin was 54%. Product margin for the second quarter of 2013 was negatively impacted in part by higher than anticipated costs on a single, large installation. Without the additional costs associated with this installation, product margin for the quarter would have been 8 percentage points higher, at 32%, and total gross profit margin would have been 6 percentage points higher, at 38%.
Operating expenses for the second quarter of 2013 were $36.6 million, compared to $22.1 million in the prior year period. Second quarter of 2012 operating expenses benefited from $15 million in R&D co-funding credits related to the company's DARPA contract, which was completed in 2012. Non-GAAP operating expenses for the second quarter of 2013 were $35.0 million compared to $20.9 million in the prior year period.
The second quarter of 2013 operating results included $3.5 million for depreciation. Non-cash, pre-tax items excluded for non-GAAP purposes for the second quarter of 2013 were $0.6 million for amortization of acquired and other intangibles, $0.1 million for purchase accounting adjustments, and $1.6 million for stock compensation expense.
As of June 30, 2013, cash and investments totalled $253 million compared to $251 million as of March 31, 2013. Working capital increased during the second quarter to $285 million compared to $283 million at the end of the first quarter.
"We had a good second quarter, with continued progress across each of our different product offerings, and we ended the first half of the year ahead of our revenue track", stated Peter Ungaro, president and CEO of Cray. "Our supercomputing business continues to be strong, highlighted by several exciting new wins around the world in the last few months, including flagship wins at both the European Centre for Medium-Range Weather Forecasts and the ARCHER project for the UK national supercomputing facility. In Big Data, we recently launched our Cray Cluster Connect offering, a complete, end-to-end high performance storage solution for any x86 Linux cluster. On the analytics front, we had a number of exciting wins in our YarcData group, signing up new customers across several of our key market segments for our Urika real-time data discovery platform. We're in a strong competitive position right now and I'm really excited about the momentum we've built throughout our business. With an increase to our outlook today, we're anticipating strong revenue growth of more than 20% for the year and solid profitability."
While a wide range of results remains possible for 2013, Cray expects revenue to be approximately $520 million for the year. Revenue in the third quarter is expected to be about $90 million. For 2013, total gross profit margin is anticipated to be in the mid-30% range. Total operating expenses for 2013 are expected to be in the range of $160 million. Non-GAAP adjustments to pre-tax earnings are anticipated to be over $10 million in 2013, driven by stock-based compensation and acquisition related expenses. Based on this outlook, Cray expects to be profitable on a GAAP and non-GAAP basis for 2013.
Following a partial release of Cray's deferred tax asset valuation allowance in the second quarter of 2013, the company expects to record an income tax benefit for the year. Based on this outlook, due to Cray's substantial net operating loss carryforwards, the annual income tax provision is expected to be largely non-cash and the effective non-GAAP tax rate is expected to be 7-10%.
Actual results for any future period are subject to large fluctuations given the nature of Cray's business.
Recent highlights include the following: