Ln(x) using repeated square root extraction
03-05-2022, 08:39 PM
Post: #9
 Thomas Klemm Senior Member Posts: 1,688 Joined: Dec 2013
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
 « Next Oldest | Next Newest »

 Messages In This Thread Ln(x) using repeated square root extraction - Gerson W. Barbosa - 03-21-2016, 12:03 AM RE: Ln(x) using repeated square root extraction - Gerson W. Barbosa - 03-21-2016, 05:09 AM RE: Ln(x) using repeated square root extraction - Paul Dale - 03-21-2016, 07:11 AM RE: Ln(x) using repeated square root extraction - Thomas Klemm - 03-03-2022, 11:20 PM RE: Ln(x) using repeated square root extraction - Albert Chan - 03-06-2022, 12:04 AM RE: Ln(x) using repeated square root extraction - Dan C - 03-05-2022, 05:32 PM RE: Ln(x) using repeated square root extraction - Dan C - 03-05-2022, 05:53 PM RE: Ln(x) using repeated square root extraction - Dan C - 03-05-2022, 08:02 PM RE: Ln(x) using repeated square root extraction - Namir - 03-05-2022, 08:29 PM RE: Ln(x) using repeated square root extraction - Thomas Klemm - 03-05-2022 08:39 PM RE: Ln(x) using repeated square root extraction - Albert Chan - 03-06-2022, 12:50 AM RE: Ln(x) using repeated square root extraction - Thomas Klemm - 03-06-2022, 09:33 AM RE: Ln(x) using repeated square root extraction - Albert Chan - 03-09-2022, 07:47 PM RE: Ln(x) using repeated square root extraction - Thomas Klemm - 03-10-2022, 05:18 AM RE: Ln(x) using repeated square root extraction - Albert Chan - 03-10-2022, 03:17 PM

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