The default polort level in 'Compute FIM' is 1, meaning a constant and linear trend are both used as baseline regressors. These are regressed out at the same time as the beta coefficient for the ideal regressor is computed -- there is none of this "detrend first and regress later" stuff in AFNI.
Thus, to duplicate the calculations exactly, you'd have to provide 3 regressors to THD_fitter, one being a constant, the second varying linearly in time, and the third being your ideal function.
By the way, you CAN set other baseline regressors ('orts') and the polort level in the interactive 'Compute FIM' with the 'Edit Ideal' sub-menu.