TERP calculation