added gamma_q to math lib, fwd/rev autodiff, and manual