  We use a numerical code for accurate computation of the amplitude of linear
density perturbations and gravitational waves generated by single-field
inflation models to study the accuracy of existing analytic results based on
the slow-roll approximation. We use our code to calculate the coefficient of an
expansion about the exact analytic result for power-law inflation; this
generates a fitting function which can be applied to all inflationary models to
obtain extremely accurate results. In the appropriate limit our results confirm
the Stewart--Lyth analytic second-order calculation, and we find that their
results are very accurate for inflationary models favoured by current
observational constraints.
