fix error in Tang log algorithm