NEW YORK – When Standard & Poor’s downgraded the U.S.’s long-term credit rating from AAA to AA+ on Aug. 5, Washington went on the offensive.

President Barack Obama’s advisers blasted S&P. The administration’s friends and allies came out with guns blazing. The Securities and Exchange Commission is reportedly scrutinizing S&P’s procedures connected with the downgrade. And the Senate Banking Committee is said to be pondering an investigation — into what exactly, committee members haven’t said.

None of S&P’s detractors let us forget for one minute that this is the same S&P that slapped a AAA rating on collateralized subprime junk during the housing bubble, and that gave Enron Corp. and WorldCom Inc. investment-grade ratings shortly before each of them imploded.

What’s more, the U.S. Treasury found a $2 trillion error in S&P’s analysis, prompting Larry Summers, a former Obama economic adviser, to offer a rating of his own.

“S&P’s track record has been terrible and its arithmetic is worse,” Summers told CNN.

A pox on S&P’s house! Death to the messenger! In fact, the messenger was shot so early and often one might have missed the message amid all the gun smoke.

Unless the U.S. gets its fiscal house in order and aligns the promises it has made to retirees with tax rates that don’t stunt growth, the nation’s sovereign-debt rating is unlikely to contain the first letter of the alphabet at all.

As it turns out, the sharpshooters were wide of the target. S&P didn’t make an arithmetical error, as Summers would have us believe. Nor did the sovereign-debt analysts show “a stunning lack of knowledge,” as Treasury Secretary Timothy Geithner claimed.

Rather, they used a different assumption about the growth rate of discretionary spending, something the nonpartisan Congressional Budget Office does regularly in its long-term outlook.

CBO’s “alternative fiscal scenario,” which S&P used for its initial analysis, assumes discretionary spending increases at the same rate as nominal gross domestic product, or about 5 percent a year. CBO’s baseline scenario, which is subject to current law, assumes 2.5 percent annual growth in these outlays, which means less new debt over 10 years.

But S&P’s rating horizon is three to five years. The difference between the two assumptions amounts to a gap of about $250 billion in debt estimates for 2015: $14.5 trillion, or 79 percent of GDP, under the baseline scenario, versus $14.7 trillion, or 81 percent of GDP, under the alternative. (S&P includes federal, state and local government debt in its calculations.)

Over 10 years, the difference is, as Treasury says, $2 trillion and eight percentage points as a share of GDP.

In its response to the S&P downgrade, Treasury used the word “mistake” eight times, “error” five times, and other pejorative words three times — all in a 550-word memo. Just in case anyone missed the point.

To be sure, S&P’s critics have legitimate gripes. Was the credit rating company being too much of an activist in demanding $4 trillion of savings for the U.S. to maintain its AAA rating? Why didn’t S&P’s acceptance of a slower rate of spending produce a different outcome? Was the downgrade political? If so, is this a legitimate framework for assessing the creditworthiness of the U.S.?

These are all valid questions. Yet when the discussions between S&P and Treasury didn’t have the desired results, the administration set out to discredit the messenger.

Imperfect as that messenger may be, shooting him doesn’t minimize the message. Fiscal policy is on an unsustainable path, largely the result of entitlement spending exacerbated by the retirement of the baby boomers. We have a government that lives beyond its means and a political class that lacks the will to find a solution.

For example, “preserving Medicare as we know it,” as House Minority Leader Nancy Pelosi is wont to say, isn’t an option.

Medicare’s Hospital Insurance Trust Fund will be exhausted by 2024, according to the 2011 annual report from the program’s trustees. That’s five years earlier than they projected in 2010. Medicare has been running a cash-flow deficit, with expenditures exceeding income, since 2008.

The Social Security Trust Fund, which ran a cash-flow deficit excluding interest last year and is projected to run one this year, will be exhausted in 2036. (No, Virginia, there is no lockbox.)

The Republicans’ intransigence on revenue increases, no matter what the source, is another stumbling block.

As economist Art Laffer put it, “Who doesn’t want revenue increases” if they result from stronger economic and job growth? Almost everyone agrees the economy would get a boost from a more efficient tax system that eliminates loopholes and lowers corporate and individual income-tax rates.

In the meantime, just think if all the energy expended to discredit S&P had been put to better use. Maybe the Obama administration could have offered up its own plan to put the U.S. on a sustainable fiscal path — perhaps one that passes muster with S&P.

Caroline Baum is the author of “Just What I Said.”