cache residuals with check, add INFINITY macro if not defined
Merge branch 'master' into dense