Natural logarithm of 2 [HP-15C/HP-42S/Free42 & others]
|
11-14-2019, 05:34 PM
Post: #24
|
|||
|
|||
RE: Natural logarithm of 2 [HP-15C/HP-42S/Free42 & others]
Another way to speedup log(2) calculations is to use ... uh ... log(2)
Let r = roughly the value of log(2) log2 = r + log2 - r = r + log(2 exp(-r)) Last term should be tiny: log(2 exp(-r)) = log(1 + ε) = 2 atanh(x) With r = 0.6931471805599453, x = ε/(ε+2) ≈ 4.7e-18 → atanh(x) converge very quickly, +35 decimal digits per loop. Code: OPTION ARITHMETIC DECIMAL_HIGH |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)