AD computation with Template Model Builder (TMB)