Next Diff = (Average Diff over the last N blocks) * (150 seconds) * N / (Actual Seconds for last N blocks)
where N is a number between 144 and 4032.
The "clever" part is that N gets smaller when the diff changes quickly and N gets larger when the diff is stable. The idea would be that when there is a quick change in hash rate, it reacts quickly. When the hash rate is stable, it reacts slowly.
The problem is the first part of the algorithm has momentum. This is one of the things that caused so much trouble with the transition at block 42,000. Even after the MP switched off around block 42130, the difficulty kept climbing for about 70 more blocks (which took 2 days).
For example, if N is 144 and the coin-hoppers mine a fast 50 coins and switch off the coin, those coins will still be counted in the average used for the next difficulty while the faithful have to grind on 94 coins themselves.
The change in direction will also increase N, causing the permitted change to be smaller, and allowing those 50 fast-mined coins to linger even longer, forcing the faithful miners to spend even more time trying to create even more blocks necessary to bring difficulty back down.
The idea was clever, but not practically applied. If instead of using block counts for PastBlockMin and PastBlockMax, he had used Time (i.e. PastSecondsMin and PastSecondsMax), then used blocks/hour instead of hours (seconds) per block for the calculation. That way if the coin slows down to 2-4 blocks per hour, it doesn't take days of grinding to get the 50-100 blocks needed to push the fast blocks out of the window of consideration.
Hopefully, I am wrong and it stays profitable to mine for the faithful and keeps producing blocks. Unfortunately, I think that every time it gets marginally profitable to mine, MP, MC and CC will slap it down and create problem like it had with block 42,000 where transactions don't confirm and 2 guys are stuck mining it for days waiting for it to recover, only to get slapped down and have to repeat the cycle.
Your math is off if that's the conclusion you are coming to. Obviously we'll see how it plays out in production...but to me it seems like a smart formula that will adapt well while also keeping things more consistent and under control. There might be some slow blocks still in there...but as soon as they're found the difficulty will start to plunge rapidly.
Anyway, the die is cast, and we will all start finding out tomorrow. Hopefully, Friday the 13th is not unlucky for MEC.