Stocks cut gains, with the Dow and Nasdaq briefly turning negative on Thursday, as an earlier bounce fizzled out on persistent worries over the recession-hit economy, fueled by fresh negative data.

Hewlett-Packard Co was the biggest drag on the Dow, falling more than 7 percent, the day after the technology bellwether gave a disappointing outlook.

The Dow Jones industrial average <.DJI> added 3.98 points, or 0.05 percent, to 7,559.61. The Standard & Poor's 500 Index <.SPX> gained 3.22 points, or 0.41 percent, to 791.64. The Nasdaq Composite Index <.IXIC> inched up 0.77 points, or 0.05 percent, at 1,468.74. Earlier the Nasdaq and S&P 500 had both risen by more than 1 percent.

(Reporting by Leah Schnurr; Editing by James Dalgleish)