Post Reply 
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 }
01 0
02▸LBL 00
03 RCL× 00
04 RCL ST Y
05 IP
06 1/X
07 +
08 DSE ST Y
09 GTO 00
10 RCL× 01
11 END

HP-15C:
Code:
   000 {             } 
   001 {       44 25 } STO I
   002 {       43 35 } g CLx
   003 {    42 21  0 } f LBL 0
   004 {    45 20  0 } RCL × 0
   005 {       45 25 } RCL I
   006 {       43 44 } g INT
   007 {          15 } 1/x
   008 {          40 } +
   009 {    42  5 25 } f DSE I
   010 {       22  0 } GTO 0
   011 {    45 20  1 } RCL × 1

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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Natural logarithm of 2 [HP-15C/HP-42S/Free42 & others] - Thomas Klemm - 06-19-2022 07:07 PM



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