@gokceneraslan a division by a positive number is well-conditioned therefore I think it is quite safe to to divide by `log(2)`.
akingatwork opened this issue · 1 comments
akingatwork commented
@gokceneraslan a division by a positive number is well-conditioned therefore I think it is quite safe to to divide by `log(2)`.
_Originally posted by @lewlin in numpy/numpy#14969 (comment)
557833663_numpy/numpy#14969 (comment)
In [215]: import mpmath
In [216]: mpmath.mp.dps = 50
In [217]: x = 1.5e-24
In [218]: y = mpmath.log(mpmath.mp.one + x, b=2)
In [219]: y
Out[219]: mpf('2.1640425613334450784151339045869271953211073610684447e-24')
In [220]: float(y)
Out[220]: 2.1640425613334452e-24In [221]: def log2_1p(x):
...: return np.log1p(x) / 0.6931471805599453
...:
In [222]: log2_1p(x)
Out[222]: 2.1640425613334452e-24
rkern commented
It looks like you intended to reply to an issue in another repository instead of opening a new issue here.