The blue-chip Dow Jones industrial average gained 44.11 points, or 0.52 percent, to close at 8,494.27, having lost 88.08 points Tuesday. The tech-heavy Nasdaq composite index, meanwhile, soared 27.45 points, or 2.12 percent, to 1,320.25, after dropping 10.08 points in the previous session.
The broader New York Stock Exchange composite index increased by 2.10 points to 478.45, while the Standard & Poor's 500 index rose 5.98 points to 896.14. The American Stock Exchange composite index gained 9.64 points to 821.52, while the Wilshire 5000 Index ended up 65.47 points to 8,430.55.
Big Board volume was at an estimated 1.56 billion shares, while Nasdaq volume reached 1.58 billion shares.
The Fed's chairman's continued optimism about productivity gains in the United States in a speech to the American Enterprise Institute midday lifted market sentiment, which had been sagging earlier in the day.
"A significant step up in the growth of productivity appears to have persisted," Greenspan said.
His words lifted high-tech shares in particular, with chipmakers Intel Inc. and software giant Microsoft Corp. posting some of the biggest gains.
Non-tech issues also posted some gains unrelated to Greenspan's comments on productivity.
DuPont, the nation's largest chemical company, said earnings rose sharply on a more favorable tax rate and higher prices for some of its chemicals and plastics.
International Paper Co., a Dow component, reported a third-quarter profit, reversing last year's loss, on cost cuts stemming from its restructuring efforts.
On the retreating side, however, telecom equipment maker Lucent Technologies Inc. was hard-hit as it posted its 10th consecutive quarterly loss as its telephone company customers continued to slash spending.
Meanwhile, German-American automaker DaimlerChrysler said its net profit fell 22 percent in the third quarter, despite strong vehicle production levels and new cost controls.
Market gains were also capped after the Fed released its "beige book" early in the afternoon Wednesday that showed further deterioration in the U.S. economy, describing economic activity as "sluggish in September and early October."
"Retail sales were weak across the nation, including some declines in motor vehicle sales from very high levels," the Fed's Beige Book on current economic conditions said.
Manufacturing activity "had declined or grown more slowly" in most Federal Reserve districts.
Still, there were other positive developments on the macroeconomic front. St. Louis Federal Reserve Bank President William Poole said earlier in the day that the U.S. economy is growing modestly as it recovers slowly from recession.
"The overall economy is growing modestly, recovering all too slowly from last year's recession," Poole said in remarks prepared for delivery to a conference sponsored by the St. Louis Fed and the East St. Louis Action Research Project at the University of Illinois at Urbana-Champaign.
"Economic conditions vary substantially across regions and industries," Poole added in remarks that offered few details on his views of the economy or Fed policy. Instead, he focused on the role the central bank can play to foster successful community development efforts.
The regional Fed bank chief does not currently have a vote on the Fed's policy-setting panel.
Meanwhile, U.S. Treasury prices rose. The 10-year bond gained 6/32 to 101 4/32. Its yield, which moves in the opposite direction of its price, fell to 4.23 percent from 4.26 percent late Tuesday.
In Europe, stock prices ended lower in London, Frankfurt and Paris. The London International Stock Exchange's blue-chip FTSE-100 index lost 112.00 points, or 2.72 percent, to 4,006.90. The German DAX index fell 140.55 points, or 4.45 percent, to 3,015.42 and the French CAC-40 index lost 128.78 points, or 4.13 percent, to 2,992.23.
European stocks lost ground, pressured by weakness in the banking and oil sector. The banking sector came under pressure from profit-taking following its recent rebound.
Earlier in Asia, prices on the Tokyo Stock Exchange ended slightly higher, showing surprising resilience despite potentially damaging political debate on how Japan should be dealing with banks' massive non-performing loans. The blue-chip Nikkei-225 average, which fell 289.02 points Tuesday, rose 25.13 points, or 0.3 percent, to 8,714.52.
Analysts said the Nikkei recovered from its intraday low of 8,499.49, largely supported by public pension funds' sporadic buying as well as quiet, but steady buying of key blue chip shares by foreigners.
Unlike Tuesday's session, the Nikkei was not hurt by massive selling of futures. However, the index's gains were capped after it hit 8,758.67 about an hour before the closing bell.
Despite this surprising resilience, traders said the Nikkei is still walking on thin ice. How the market will fare depends on whether Prime Minister Junichiro Koizumi comes up with an effective safety net to prevent a financial meltdown as the government purges banks' non-performing loans.
But traders and fund managers generally welcomed signs the government is finally taking steps to undergo painful surgery on the nation's banking system. The Nihon Keizai Shimbun reported Bank and Economy Minister Heizo Takenaka will meet with heads of four megabanks later Wednesday to explain the bad-loan measures.
Takenaka was forced to postpone Tuesday's announcement of his project team's interim report due to strong opposition from ruling Liberal Democratic Party politicians. In addition to urging a stricter stance on banks' loan loss reserves and their calculation of capital, the report was expected to threaten the nationalization of some banks.
In trading, megabank shares fell on financial sector fears of Takenaka's bad-loan cleanup proposal.
Elsewhere in Asia, prices ended sharply higher on the Hong Kong Stock Exchange, lifted by strength in telecom issues. The blue-chip Hang Seng Index, which slipped 21.42 points Tuesday, jumped 255.71 points, or 2.7 percent, to 9,804.65.
The key index of 33 blue chips opened marginally lower at 9,545.66, then shrugged off weakness in U.S. markets and shot to a high of 9,809.51.
Meanwhile, prices on the Taiwan Stock Exchange rose to their highest level in one month. The Weighted Index, which lost 77.06 points Tuesday, jumped 203.42 points, or 4.6 percent, to 4,589.88.
Prices also ended higher on the South Korean Stock Exchange, lifted by strength in high technology issues. The key Kospi Composite Index, which dropped 13.90 points Tuesday, rose 18.16 points, or 2.8 percent, to 657.43.
Elsewhere around the Pacific region, prices ended higher on the Australian Stock Exchange. The blue-chip All Ordinaries Index, which rose 12.90 points Tuesday, rose 26.50 points, or 0.9 percent, to 2,987.20.