US economy posts largest gain in nearly four years