How many spell slots you get is reading a matrix - it is not a calculation or a die roll. Therefore, you only lose your highest level spell prepared. You don't "calculate the number of slots you get based off of caster level" by an equation - you look at the chart. Therefore, you still have the spell slots from which to cast the spells.
Now, when you go to cast the fireball, you have to calculate your caster level. which is 4th. So, you CAN cast the fireball - albeit only at 4th caster level - for 4d6.
This is critical at the highest levels of the game - when the chief Necromancer bad guy manages to sling the following in one round... with haste up (he got the drop on us - and the initiative...) drops a time stop - rolling a 3 on the duration.
The nasty spells that followed were most unkind -
The Party cleric got 2 horrid wiltings and a quickened fireball - enough to kill her...
The Ranger/rogue and the "conventional" rogue got ensuing swarm of energy spells...
For Me - the GM had something extra nasty -
2 energy drains and a quickened enveneration
He got lucky - and rolled 3,2,3,4,2 - for a total of 13 negative energy levels on My 17th level diviner/loremaster.
I thought for sure I was as good as dead - but I wasn't. We looked at the rules - realized this nice loophole - and as I had a feeblemind prepared - you can guess what I threw at Him...
It hit - thankfully.
The other two players made short work of the now bumbling necromancer - and I knew I had to move fast. Teleport time to get to an NPC cleric off My emergency scroll (which was a dangerous roll to make - but necessary) - who then bailed us out, and brought back our buddy from the lands beyond the next day.
The GM told us what the Necromancer would have done had that feeblemind NOT worked. We figured out real fast that had that feeblemind not worked - we would have been one dead band of adventurers for sure.
Lesson learned by party rogues - check for alarm spells as traps.