A function that an optimization function calls at each iteration of its algorithm is known as an output function. An output function is typically used to provide graphical output, record the history of the data generated by the algorithm, or terminate the process based on the data at the current iteration.