Randomized Forward Mode of Automatic Differentiation For Optimization Algorithms