def logsum_pair_table_interp(self, diff):
"""
Return the log1p term from precomputed table by interpolation.
Cf. Treba
Minimax log sum approximation might be even faster and more precise, TODO
:param diff: x-y or y-x
"""
index = -int(diff)
w = -diff - index
val1 = self.logsum_table[index]
val2 = self.logsum_table[index + 1]
return val1 + (w * (val2 - val1))
评论列表
文章目录