The Nasdaq composite gained 62 points to finish at 2,204.44. The Dow Jones industrial average picked up 29 points to close at 10,591.22.
"You go from being scared to own stocks to being scared to not own stocks," said Charles Lemonides, chief investment officer at M&R Capital Management. "Pessimism reaches such a peak, and then psychology turns on a dime--for no apparent reason. But that's how markets behave. The selling gets too extreme, and the move gets well ahead of what makes sense."
Some of Tuesday's optimism may have derived from a report that U.S. citizens' productivity, a key measure of rising living standards, slowed to a 2.2 percent rate of growth in the fourth quarter as the economy weakened. The figure was slightly ahead of the 2 percent analysts were expecting.
Yahoo shrugged off a downgrade from Goldman Sachs, moving up 19 cents to $22.38. The rating cut came as a new analyst took over coverage of the stock and banished it from Goldman's recommended list.
America Online Time Warner gained $2.74 to $46.54. Amazon.com lost 75 cents to $11.88, while eBay and CMGI moved up $2.31 and 22 cents a share, respectively.
A handful of semiconductor stocks gained ground Tuesday despite warnings that sales and earnings will miss estimates this quarter. Varian gained $3 to $34.50 while TriQuint Semiconductor and Xilinx moved up $1 and $1.94 a share, respectively.
Intel picked up $1.13 to $31.50. Advanced Micro Devices rallied up $1.62 to $24.75, and IBM finished up $1.09 to $106.
Veritas shot up $7.94 to $67.75 after it said it's confident about its outlook for the quarter and growth projections for the year.
Microsoft jumped $2 to $59.44. Oracle added 63 cents to $17.63, and Sun Microsystems tacked on $1.31 to $22.25.
Among widely held PC stocks, Dell Computer closed up $2.75 to $26.19; Compaq Computer rose $2.10 to $22.17; Gateway added 90 cents to $16.97, and Apple Computer finished up $1.13 to $21.50.
Siebel Systems plunged $4.63 to a 52-week low of $29 after being slapped with two downgrades a day after the company said its senior vice president of sales was leaving. Analysts were split on the company's long-term prospects.
New Focus shares dropped $2.38 to $18.88 just after Monday's sales warning. Analysts cut their estimates but remained bullish for the longer-term.
Staff and Reuters contributed to this report.