numeric_grad doesn't work with functions that have scalars as input