This is not that uncommon when optimizing code. Your program is slow so you profile it, and find out that f() takes 99% of the time. So you work a lot to optimize f(), and re-profiling shows that now f() takes 98% of the time. Doesn't seem that impressive after all the work you've put into optimizing f(), but your program is actually twice as fast :)
[deleted]
orig_time = 100
orig_not_f = 0.01 * orig_time = 1
new_f = 0.98 * new_total
new_total = new_f + orig_not_f
new_total = 0.98 * new_total + orig_not_f
new_total - 0.98 * new_total = orig_not_f
0.02 * new_total = 1
new_total = 1 / 0.02 = 50