Income taxes - Schedule of Reasons for the Difference Between Effective Tax Rates and U.S. Statutory Rate (Details) - USD ($)
$ in Thousands
12 Months Ended
Dec. 31, 2016
Dec. 31, 2015
Dec. 31, 2014
Income Tax Disclosure [Abstract]      
U.S. federal statutory rate (as a percent) 35.00% 35.00% 35.00%
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) 0
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) 0
Other 1,853 287 (1,573)
Provision for income taxes $ 124,760 $ 39,546 $ 79,042