Republicans are prepared to spend hundreds of billions of dollars to mitigate problems their own bill is creating.

The Senate health bill scales back financial assistance for people buying private coverage. It allows plans that do not comply with the law’s insurance regulations back on the market. And it ends generous federal funding for Obamacare’s Medicaid expansion, which has covered millions of the poorest Americans.

The consequences of these policy changes are dire: 22 million fewer people would have health insurance in 2026 and Medicaid’s budget would be slashed by $772 billion, versus Obamacare. That, unsurprisingly, makes many Republicans nervous and has surely contributed to the public’s overwhelming opposition to the Senate bill.

And this has left Senate Republicans in the somewhat awkward position of amending a bill to fix the problems that same bill creates. Republicans have already added $182 billion in stabilization funding to the plan and are reportedly ready to add $200 billion to partially offset the Medicaid expansion cuts.

Yet according to experts, it’s not nearly enough. The end result is still a cut in benefits for Americans affected by the changes, and millions more people becoming uninsured.

“The bill is pouring money into stability funding in an effort to offset destabilizing policy changes in the bill,” Caroline Pearson, senior vice president of Avalere Health, an independent consulting firm, said of the money for the private market. “However, the infusion of funding is insufficient to compensate.”

The problem is one of arithmetic, as another expert, Matt Fiedler of the Brookings Institution, put it in reference to the proposed Medicaid-focused funding. Republicans want to deeply cut federal spending on health insurance in order to cut taxes on the health care industry and repeal the law’s mandate penalties.

With those cuts in place, it is mathematically impossible to add enough money back to prevent reductions in federal aid.

“It does not matter what combination of federal funding streams are used to deliver that money,” Fiedler said. “It is impossible to overcome that basic arithmetic reality.”

The GOP bill destabilizes the insurance market, and then spends billions to stabilize it

Obamacare’s current market isn’t perfect. It has taken several years to get to anywhere near equilibrium and profitability for the participating insurers, and there are parts of the country where insurers refuse to sell coverage because they say costs are too high.

The Senate bill does include short-term funding — $50 billion over four years — to stabilize the market in the immediate future. Experts across the political spectrum agree more federal funding would help improve the health care law’s marketplaces.

The legislation also makes other changes to the private insurance market that would cause further destabilization. It repeals Obamacare’s requirement that every American buy health insurance or pay a penalty and replaces it with a new policy — a waiting period for going without coverage — that is also meant to encourage people to stay covered, but experts say it would be less effective.

The bill also scales back the federal tax subsidies people receive to buy private coverage, making it harder for Americans to sign up and balance the market with sick and healthy people. Insurance premiums would decrease in the long term, but out-of-pocket costs would rise, especially after the repeal of additional Obamacare subsidies that currently lower those costs for lower-income Americans.

Senate Republicans have added another provision, authored by Sen. Ted Cruz (R-TX), that would allow insurers to once again sell plans that do not comply with the health care law’s insurance regulations (allowing plans to once again charge sick people more and opt not to cover certain essential health benefits) as long as they also offer plans that do.

The result would be, according to outside experts, that healthier people would gravitate to the skimpier non-Obamacare coverage and sicker people would stick with the more robust Obamacare plans. Over time, that would drive up costs for the latter, sending the law’s marketplaces toward a death spiral.

Experts believe the cumulative effect of those changes — which have not yet been vetted by the Congressional Budget Office, with the inclusion of the Cruz plan — would be a less stable market than Obamacare currently has.

Republicans recognize this, and the bill includes new funding to attempt to offset these negative consequences. In addition to the $50 billion in short-term funding, the bill provides $132 billion in longer-term funding for states to stabilize their insurance markets.

Under the current plan, $70 billion of that long-term money is earmarked to offset the effects of the Cruz amendment and lower premiums for people who would see rising premiums in the Obamacare market. States can use the remaining $62 billion at their discretion, under the loose guidance that they should lower costs for high-risk patients or expensive services. They could, for example choose to pay for maternity care or mental health treatment separately from the usual health coverage.

But experts broadly agree that stabilization funding won’t be enough to offset the effects of the Cruz amendment and the other changes to the insurance market. It’s a math problem: The legislation cuts more than $400 billion in Obamacare funding for that market and adds less than $200 billion back in.

“The bill includes provisions that would destabilize the insurance market, and then includes a whole bunch of federal money to try to re-stabilize it,” Larry Levitt, senior vice president at the Kaiser Family Foundation, told me. “Even then, there's a good chance the federal money isn't enough.”

Republicans want to cut Medicaid expansion, and then spend less money on the same population

On the Medicaid side, the GOP bill would eventually end the generous federal funding for Obamacare’s Medicaid expansion — the federal government initially picked up 100 percent of the costs and is supposed to cover 90 percent indefinitely. Republicans want to lower that funding to the traditional Medicaid rate to closer to 50 percent; a number of states, perhaps most or all of them, would likely just end the expansion altogether.

The CBO has projected that 15 million fewer people would be enrolled in Medicaid in 2026, compared with Obamacare, and most of those losses would be from states ending the expansion. That’s been a big sticking point for a half-dozen Republican senators who represent states that expanded Medicaid, enough to block the bill so far.

In the past few days, those senators have been in talks with the Trump administration about some kind of compromise to assuage their concerns about cutting benefits for the people covered by Medicaid expansion. Details are scarce, but this is the general idea:

The Medicaid expansion population would be moved to private coverage

Some combination of Medicaid money, tax credits for insurance, and additional funding would be used to cover them

The money would be used to lower their premiums and out-of-pocket costs

About $200 billion in extra money could reportedly be added to the bill to make the plan work

First things first, this plan has big problems to fix. Medicaid has either no or nominal premiums and negligible cost sharing for its beneficiaries. The Republican bill is projected to lead to private insurance with $13,000 deductibles, according to the CBO; an individual who qualifies for Medicaid expansion could make $16,000 a year or less.

But this plan — colloquially called the Medicaid “wraparound” — runs into the same problem that the stabilization funding did: There simply isn’t enough money available to make up for the current cuts.

The CBO estimated that three-quarters of the $772 billion in Medicaid cuts would result from ending Medicaid expansion. It’s not at all clear how $200 billion, plus whatever states could get through the tax subsidies, would make up that difference.

“Even if Republicans devoted every dollar of the roughly $300 billion they have to work with to filling that gap, there is simply no way for them to achieve the same extent and quality of coverage as Medicaid expansion, at least not without a big increase in state spending on the program,” Fiedler at Brookings told me.

And Republicans still face the problems of moving these people from Medicaid, with that program’s minimal costs to the enrollee, to private coverage, where they must pay premiums, deductibles, and the like.

“In fact, it’s likely even worse than that because covering these individuals through private coverage is generally going to be more expensive than covering them through Medicaid,” Fiedler added.

The stabilization funding and Medicaid wraparound have one final flaw that makes them insufficient for replacing the funding that the Republican bill would cut: They would both expire after 2026.

After that, there would be no guarantees that the federal government would pick up the tab to cover the people affected by these changes.

“That means that however inadequate this approach might be in the short run,” Fiedler said, “it’s going to be completely worthless in the long run.”