The savings and loan crisis is deeper, wider and more long-lasting than expected and could cost taxpayers as much as $40 billion to resolve, a panel of experts told the Senate Banking Committee Thursday.

"It's going to take $40 billion of taxpayer money" to solve the thrift problems over the next two to three years, Bert Ely, president of Ely & Co. Inc. of Alexandria, Va., told senators Thursday.Estimates by the experts of money needed to solve the industry's problems ranged from $30 billion to $63 billion. Ely's was the most pessimistic prediction of the amount of taxpayer money that might be needed.

The Senate Banking hearing was called to hear from officials of the General Accounting Office and receive their audit of the Federal Savings and Loan Insurance Corp. for 1987.

The GAO report found that the FSLIC, which insures deposits up to $100,000 through industry-assessed fees, is in "precarious financial condition" and has a $17 billion liability just for the 200 insolvent institutions it has had to take over, testified Frederick Wolfe, director of the agency's Accounting and Financial Management Division.

Southwest thrifts could drain the FLSIC still further, Wolfe said, noting that they "are in worse shape than those in the rest of the country."

The Dallas Federal Home Loan Bank district, which includes 479 thrifts, reported negative net worth of $6.7 billion as of Dec. 31.

"It's getting worse, not better," said Sen. Donald Riegle, D-Mich., a committee member who stopped short of advocating the use of taxpayer money to fix the FSLIC's problems.

But Riegle stressed that depositors at weak institutions should not worry about the federal government's commitment to insuring up to $100,000 per account.

"Deposits are safe," he said. "That's written in stone."

Senators predicted that solutions _ which ranged from calls for tougher regulation and supervision to a massive taxpayer bailout _ would be put off until next year, when a new president will be in office.

"This administration is on automatic pilot," Riegle said.

But Sen. Phil Gramm, R-Texas, wasted no time signaling his views, saying flatly, "I am never going to support a taxpayer bailout, and this Congress will never support it."