Natural logarithm of 2 [HP-15C/HP-42S/Free42 & others]
|
06-19-2022, 07:07 PM
Post: #37
|
|||
|
|||
RE: Natural logarithm of 2 [HP-15C/HP-42S/Free42 & others]
We can also use Paul's idea and use the Taylor series of:
\( \begin{align} \log\left(\frac{1+x}{1-x}\right) &= 2 x + 2 x^3 \frac{1}{3} + 2 x^5 \frac{1}{5} + 2 x^7 \frac{1}{7} + 2 x^9 \frac{1}{9} + 2 x^{11} \frac{1}{11} + \cdots \\ &= 2 x \left[1 + x^2 \frac{1}{3} + x^4 \frac{1}{5} + x^6 \frac{1}{7} + x^8 \frac{1}{9} + x^{10} \frac{1}{11} + \cdots\right] \\ \end{align} \) For \(x\) we solve the equation: \( \begin{align} \frac{1+x}{1-x} = \sqrt[16]{2} \end{align} \) This leads to: \( \begin{align} x = \frac{\sqrt[16]{2} - 1}{\sqrt[16]{2} + 1} \end{align} \) We could maybe increase \(16\) to further reduce \(x\) and thus speed up the summation. However we experience cancelation in the numerator. I haven't checked the influence yet. Thus for now \(16\) is just a wild guess. Initialization R00: \(x^2\) R01: \(32x\) 1 ENTER 2 SQRT SQRT SQRT SQRT + LASTX 1 - X<>Y / X↑2 STO 00 LASTX 32 * STO 01 Programs HP-42S: Code: 00 { 18-Byte Prgm } HP-15C: Code: 000 { } Examples 3.00002 R/S 0.6931471500554851572008806023721818 5.00002 R/S 0.693147180549725015633085213078373 7.00002 R/S 0.6931471805599415808474258676300801 9.00002 R/S 0.6931471805599453079863200827178153 11.00002 R/S 0.6931471805599453094166642087519808 13.00002 R/S 0.6931471805599453094172318905964119 15.00002 R/S 0.6931471805599453094172321213626303 17.00002 R/S 0.6931471805599453094172321214581366 19.00002 R/S 0.6931471805599453094172321214581768 2 LN 0.6931471805599453094172321214581766 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)