Post Reply 
Ln(x) using repeated square root extraction
03-05-2022, 08:39 PM
Post: #9
RE: Ln(x) using repeated square root extraction
We experience cancellation when calculating \(\varepsilon = \sqrt[n]{x} - 1\).
The program was executed on free42 with 34 decimal digits of precision.
Thus this effect is not noticed.

It is a trade-off between coming close to \(1\) and how many terms to use in the Taylor series.

For a calculator like the HP-15C with 10 digits using \(n = 2^6\) might be the best choice.

For \(x = 2\) we end up with the following sequence of iterated square roots:

2.000000000
1.414213562
1.189207115
1.090507733
1.044273783
1.021897149
1.010889286

This leaves us with \(\varepsilon = 0.010889286\) and thus 5 terms of the Taylor series should be enough.
We notice the cancellation since we have now only 8 significant digits left.

Here's the program for the HP-15C or similar calculators:
Code:
   001 {          11 } √x̅
   002 {          11 } √x̅
   003 {          11 } √x̅
   004 {          11 } √x̅
   005 {          11 } √x̅
   006 {          11 } √x̅
   007 {           1 } 1
   008 {          30 } −
   009 {          36 } ENTER
   010 {          36 } ENTER
   011 {          36 } ENTER
   012 {           5 } 5
   013 {          10 } ÷
   014 {           4 } 4
   015 {          15 } 1/x
   016 {          34 } x↔y
   017 {          30 } −
   018 {          20 } ×
   019 {           3 } 3
   020 {          15 } 1/x
   021 {          34 } x↔y
   022 {          30 } −
   023 {          20 } ×
   024 {           2 } 2
   025 {          15 } 1/x
   026 {          34 } x↔y
   027 {          30 } −
   028 {          20 } ×
   029 {           1 } 1
   030 {          34 } x↔y
   031 {          30 } −
   032 {          20 } ×
   033 {           6 } 6
   034 {           4 } 4
   035 {          20 } ×

For \(x = 2\) we get:

0.6931471776

While for \(\ln(2)\) we get:

0.6931471806

This leaves us with a difference of:

0.0000000030
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Ln(x) using repeated square root extraction - Thomas Klemm - 03-05-2022 08:39 PM



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