remove unsafe genfgrad
same pattern for gen_hessian_matmat_parametric