The formula is GDP = C + I + G + (X - M). Gross investment includes both replacement investment and net investment. Net investment only includes the addition to capital stock, excluding depreciation. Gross exports is just X, not X-M.