For gradual speed the math is relatively simple :) https://hastebin.com/hiyeludime.diff (factor would need tweaking, a maybe a non linear curve if it's better for balancing).
For the speed difference based on the direction, trigonometry should be your friend :)