Test template scalar type with Eigen::AutoDiffScalar.