GENSPECT: a line-by-line code with selectable interpolation error tolerance. Current line-by-line radiative transfer codes accelerate calculations by interpolating the line function where it varies slowly. This can increase calculation performance by a factor of 10 or more but causes a reduction in calculation accuracy. We present a new line-by-line algorithm that computes absorption coefficients to a specified percentage-error tolerance in a near minimal number of calculations. The algorithm employs a novel binary division of a calculation’s spectral interval, coupled with a pre-computed lookup table that predicts where it is appropriate to reduce the resolution of a particular line without exceeding the required error tolerance. Line contributions are computed piecewise across a cascaded series of grids which are then interpolated and summed to derive the absorption coefficient. The algorithm is coded in MATLAB as part of a toolbox of radiative transfer functions for the analysis of planetary atmospheres and laboratory experiments.