Consolidated dassl and residual functions.