Income taxes (Tables)
12 Months Ended
Dec. 31, 2016
Income Tax Disclosure [Abstract]  
Schedule of Components of Income (Loss) Before Income Taxes
The components of income (loss) before income taxes were as follows (in thousands): 
 
Years Ended December 31,
 
2016
 
2015
 
2014
United States
$
(129,864
)
 
$
(7,702
)
 
$
84,161

Foreign
60,258

 
19,122

 
42,990

Income (loss) before income taxes
$
(69,606
)
 
$
11,420

 
$
127,151

Schedule of Provision for Income Taxes
The provision for income taxes consisted of the following (in thousands):
 
Years Ended December 31,
 
2016
 
2015
 
2014
Current tax provision (benefit):
 
 
 
 
 
U.S. federal
$
(131
)
 
$
383

 
$
6,105

State
(792
)
 
1,201

 
2,136

Foreign
54,076

 
63,692

 
56,029

Total current
53,153

 
65,276

 
64,270

Deferred tax provision (benefit):
 
 
 
 
 
U.S. federal
62,672

 
(29,962
)
 
12,434

State
2,306

 
(484
)
 
(753
)
Foreign
6,629

 
4,716

 
3,091

Total deferred
71,607

 
(25,730
)
 
14,772

Provision for income taxes
$
124,760

 
$
39,546

 
$
79,042

Schedule of Reasons for the Difference Between Effective Tax Rates and U.S. Statutory Rate
The reasons for the differences between these effective tax rates and the U.S. statutory rate of 35% are as follows (in thousands):
 
Years Ended December 31,
 
2016
 
2015
 
2014
Income taxes at U.S. federal statutory rate of 35%
$
(24,362
)
 
$
3,998

 
$
44,503

Net state income taxes
(1,841
)
 
466

 
976

Foreign taxes
38,211

 
38,052

 
32,991

Foreign tax credits
(9,492
)
 
(17,398
)
 
(10,942
)
Research and development credits
(1,024
)
 
(24,938
)
 

Unrecognized tax benefits
4,051

 
6,187

 
403

Valuation allowances
123,892

 
38,284

 
17,846

Proceeds from sale of joint venture assets
(3,641
)
 
(5,315
)
 
(5,162
)
Capital contributions or distributions related to Spin-off
(2,887
)
 
(77
)
 

Other
1,853

 
287

 
(1,573
)
Provision for income taxes
$
124,760

 
$
39,546

 
$
79,042

Schedule of Tax Effects of Temporary Differences
The tax effects of temporary differences that give rise to deferred tax assets and deferred tax liabilities are as follows (in thousands):
 
December 31,
 
2016
 
2015
Deferred tax assets:
 
 
 
Net operating loss carryforwards
$
172,851

 
$
134,448

Foreign tax credit carryforwards
81,510

 
72,019

Research and development credit carryforwards
31,251

 
31,251

Alternative minimum tax credit carryforwards
5,055

 
5,145

Deferred revenue
52,229

 
44,821

Other
50,797

 
46,045

Subtotal
393,693

 
333,729

Valuation allowances
(318,887
)
 
(186,993
)
Total deferred tax assets
74,806

 
146,736

Deferred tax liabilities:
 
 
 
Property, plant and equipment
(64,876
)
 
(73,491
)
Other
(15,615
)
 
(9,654
)
Total deferred tax liabilities
(80,491
)
 
(83,145
)
Net deferred tax assets (liabilities)
$
(5,685
)
 
$
63,591

Reconciliation of Beginning and Ending Amount of Unrecognized Tax Benefits
A reconciliation of the beginning and ending amount of unrecognized tax benefits (including discontinued operations) is shown below (in thousands):
 
Years Ended December 31,
 
2016
 
2015
 
2014
Beginning balance
$
14,943

 
$
8,356

 
$
9,033

Additions based on tax positions related to prior years
3,140

 
6,448

 

Additions based on tax positions related to current year
256

 
261

 

Reductions based on lapse of statute of limitations
(102
)
 
(122
)
 
(215
)
Reductions based on tax positions related to prior years

 

 
(462
)
Ending balance
$
18,237

 
$
14,943

 
$
8,356