U.S. stocks erased losses as technology and energy shares rebounded from earlier declines sparked by data showing U.S. economy grew less than economists forecast.

U.S. stocks erased losses as technology and energy shares rebounded from earlier declines sparked by data showing the world’s largest economy grew less than economists forecast.

Apple Inc. and Hewlett-Packard Co. jumped at least 2.3% to pace a recovery in technology companies. J.C. Penney Co. climbed 14% as billionaire investor George Soros disclosed a passive stake in the retailer. Homebuilders added for a sixth straight day. Amazon.com Inc. slid 6.5% after saying it may post an operating loss in the second quarter. Starbucks Corp. dropped 0.5% as it reported sales that trailed analysts’ estimates.

The S&P 500 rose less than 0.1% to 1,585.47 at 3:38 p.m. in New York, erasing an earlier drop of as much as 0.5%. The Dow Jones Industrial Average increased 40.81 points, or 0.3%, to 14,741.61. Trading in S&P 500 stocks was 6.3% below the 30-day average at this time of day.

“Investors are tiptoeing into the waters and trying to figure out whether it’s too hot or too cold,” Frederic Dickson, who helps manage $32 billion as chief investment strategist at D.A. Davidson & Co. in Lake Oswego, Oregon, said by telephone. “The GDP number was disappointing, and we approach recent record highs, investors are a little more cautious, but we’re still winding up a fairly good week in equities.”

Gross domestic product rose at a 2.5% annual rate in the first quarter, lower than forecast, after a 0.4% fourth-quarter advance, Commerce Department figures showed today in Washington. The median estimate of 86 economists surveyed by Bloomberg called for a 3% gain. Consumer spending, the biggest part of the economy, climbed by the most since the fourth quarter of 2010.

Consumer Confidence

A separate report showed confidence among consumers fell in April to a three-month low as Americans grew more pessimistic about the outlook for the economy. The Thomson Reuters/University of Michigan final index of consumer sentiment slid less than forecast, to 76.4 from 78.6 a month earlier. The median projection in a Bloomberg survey was 73.5.

The S&P 500 rose 0.4% yesterday, extending its gains since April 18 to 2.8%, as companies reported earnings that beat estimates. The benchmark equity gauge has surged 134% from a 12-year low in 2009 as corporate earnings topped forecasts and the Federal Reserve embarked on three rounds of bond purchases to spur economic growth. The S&P 500 is up 2% this week, heading for a monthly gain of 1%.

Fed Stimulus

Fed policy makers have said they will maintain stimulus until the labor market improves “significantly.” The economy’s inability to sustain faster growth means central bankers will probably affirm a pledge to keep buying bonds when they meet next week. The Labor Department releases its monthly jobs report on May 3.

Global stocks rallied this week as speculation mounted the European Central Bank will cut rates on May 2. The majority of 61 economists in a Bloomberg News survey have predicted that the central bank will lower its benchmark rate to 0.5% from 0.75%.