Fixed bug in differentiation when slice can't occur.
Added gradient descent.
Added gradient descent test.