Do we use the tolerance on gradient or the f values?
On gradient values. Normally, the exact minimizer and minimum are not known, so the algorithm can’t run with f values.
Though in this case, we do know the solution, we do not use it for the algorithm, just for the study afterwards.