The subroutines for each optimizing method are presented next. All the subroutines have been given the same name, calc, due to all of them using the same framework from Appendix A.1. The different stepsize determiners, or in the case of the Conjugate Gradients method, the two updating formulas, used by the different optimizing methods are included in the respective subroutine of that method. The one(s) not in use are just being commented out by starting the line with ``!!$''. The different subroutines are ordered in the same way as the optimizing methods were ordered in Table 5.3 and 5.5, and are as follows: