Hey!
Besides all the study guides Renegade One mentions, I'd say your first step is CALM DOWN. I don't know how your grades were in school, but everybody can panic and not test well. I think you need to be good to yourself and take a good bit longer than the 31-day limit before retaking the test.
Cramming is very hit or miss and 8 hours a day is kind of ridiculous. That + your stress = you having delirious dreams for 2 weeks and go into the test not being able to point out a picture of a cat.
As a lot of people have said, time is the hardest part of the test. You should do the practice tests and time yourself so you learn the pace you need to keep. If time is an issue for you, have a strategy in mind once you're taking the test for real. Guess and skip questions you don't know or that are very long to go back to later.
Instead of looking around for tricks (like how to do math fast), make sure you understand the material thoroughly and conceptually first. For example, I've never taken a physics class, but I found Khan Academy's online course and went through it to learn the concepts in-depth:
http://www.khanacademy.org . You'll find a lot of math material here too.
Are you an audial learner? Do you like to listen to stuff? Because I'm a completely shameless geek, I listen to tons of podcasts, including this dude:
http://www.quickanddirtytips.com/math-dude . Look him up on iTunes if you want to, and he'll do 8 minute bits of math "tricks" and how-tos out loud. It's elementary to challenging and forces you to do a lot of math in your head - great while exercising!
What specifically were your problems when you took the test? It sounds like you were overwhelmed but what happened? Were the questions harder than expected, did you forget everything, did you run out of time? Etc. Figure out exactly what happened and work on fixing that. The study guides are actually harder than the test itself, I think, so make sure you know the key information rather than trying to memorize the gravity force of a 200 pound man on Mars (or whatever).
Study in a condition similar to the test site, like a library. Study where you're a little distracted too (I was interrupted a few times during my test). Doing things like chewing the same gum or popping the same mint can help you get "in the zone" - find what works for you.
Study 2-3 hours a day and in a month or two, or longer, call to schedule a retake.
As Officers, it'll be our responsibility to know our gouge even when under a lot of stress - so don't just cram to immediately forget it.
I hope some of that helps! Good luck!