Musings on the HP-70
12-30-2023, 09:02 AM
Post: #3
 Thomas Klemm Senior Member Posts: 1,990 Joined: Dec 2013
RE: Musings on the HP-70
Natural Logarithm

Example

$$\log(1.2) = \log(1 + 0.2) \approx 0.182321557$$

Initialisation

DSP 9
-1
STO K
0.2
ENTER
ENTER
ENTER
11
STO M
÷

Loop

1
K
M+
÷
x<>y
-
×

Result

0.018181818
0.016363636
0.018949495
0.021210101
0.024329408
0.028467452
0.034306510
0.043138698
0.058038927
0.088392215
0.182321557

Explanation

\begin{aligned} \log(1+x) &= x-{\frac {x^{2}}{2}}+{\frac {x^{3}}{3}} - \cdots \\ &= x \cdot \left(\frac{1}{1} - x \cdot \left(\frac{1}{2} - x \cdot \left(\frac{1}{3} - \cdots \right) \right) \right) \end{aligned}

Python Program

Code:
x = 0.2 s = 0 for k in range(11, 0, -1):     s = x * (1 / k - s)     print(f"{s:>.9f}")

References
 « Next Oldest | Next Newest »

 Messages In This Thread Musings on the HP-70 - Thomas Klemm - 12-29-2023, 10:35 AM RE: Musings on the HP-70 - Thomas Klemm - 12-29-2023, 12:53 PM RE: Musings on the HP-70 - Thomas Klemm - 12-30-2023 09:02 AM

User(s) browsing this thread: 1 Guest(s)