convergence criteria for the scheme are specified in the template file: relerr, abserr and fmaxerr.
The absolute error at each iteration is given by The absolute error is necessary when the sequence of iterates is converging to zero, but is sensitive to changes in the scaling of .
The relative error is given by
Combining these we have which provides a reasonable stopping criteria for the Newton scheme. The logical variable xconv is used in the program to indicate if this condition has been satisfied.
A convergence criteria for the function is also implemented as A relative error test is not necessary since is converging to from (). The logical variable fconv is used in the program to indicate if this condition is satisfied. The convergence tests are performed in the do loop labelled 30 below.
The iteration is successfully completed when both fconv and xconv return true. For a discussion of convergence considerations, see [24]. The values given below are system-dependent (often depending on the precision of the architecture) and problem specific and may need to be adjusted accordingly. Specifying too strict a tolerance may result in unattainable bounds and for this purpose a maximum number of iterations is specified using the variable maxit.