Gradient Based Optimization Algorithm Example In Programming