Today's Updates(check post date):- Finished algorithm.. Planning to implement tomorrow/Sunday.
- Test case results below:
In these tests you will see a golden line which shows the difficulty under IDEAL situations (little to no randomization) under the CURRENT difficulty algorithm. It does not represent where the difficulty should be at any given hash-power(so don't be confused into thinking it means that).
These tests are performed with an initial difficulty and hash rate(to better model the switch) which is why you may see a little discrepancy at the beginning of the charts. The old difficulty algorithm performed a difficulty change every 60 blocks.. the new one performs a difficulty change on block. Further investigation on possible consensus issues with this will be investigated(if I have time to spare).
The blue line is the NEW algorithm with probable block times and the green line is the CURRENT difficulty algorithm with probable block times.
(IE: try to compare Blue vs Green)
First on the list is our current predicament.
Here you can see the new algorithm resists the attack's attempt to increase the difficulty artificially whereas the old algorithm ramps the difficulty up.

Next you may see the case where we have a fast linear drop. Here you can see that the difficulty does stutter a bit under the new algorithmn but remains BELOW what it would be with the current algorithm and then stabilizes with the hashpower.

Next you may see how the difficulty stabilizes well under a constant hashrate

Now you may see how the difficulty stays at the ideal level or below with a steady gain of hashrate.
The downward spikes are a very interesting property. These groups of <100 blocks of low difficulty can help ease network congestion and remove the current block size issue bitcoin is facing.

Now you may see that with sinusoidal gain, even with vast difficulty changes, it manages to match the hash power curve as the old difficulty algorithm did.

Now you may see that a slow linear drop handles much in the same way as a fast one. No strange deviations noted here imo.

Now you may see that in a step gain scenario, the new difficulty algorithm matches or beats the old one(on average) at any given hashpower for block solving time probability target time of 2 minutes.
