Ln(x) using repeated square root extraction
03-10-2022, 03:17 PM (This post was last modified: 03-12-2022 03:49 PM by Albert Chan.)
Post: #15
 Albert Chan Senior Member Posts: 2,356 Joined: Jul 2018
RE: Ln(x) using repeated square root extraction
(03-10-2022 05:18 AM)Thomas Klemm Wrote:  The first 3 terms of the Taylor series of this expression agree with those of $$\log\left(\frac{1+\varepsilon}{1-\varepsilon}\right)$$:

$$\frac{2\varepsilon}{9} \left( 4 + \frac{5}{1 - \frac{3\varepsilon^2}{5}} \right) = 2 \varepsilon + \frac{2\varepsilon^3}{3} + \frac{2\varepsilon^5}{5} + \frac{6\varepsilon^7}{25} + \frac{18\varepsilon^9}{125} + \mathcal{O}(\varepsilon^{11})$$
FYI, approximation formula based from atanh(ε) pade approximation:

atanh(ε) = ε + ε^3/3 + ε^5/5 + ... ≥ ε + (ε^3/3) / (1 - 3/5*ε^2)

Let d = 1 - 3/5*ε^2, we have ε^2/3 = 5/9*(1-d)

ε + (ε^3/3)/d = ε*(1 + 5/9*(1-d)/d) = ε/9*(9 + 5*(1/d-1)) = ε/9*(4 + 5/d)

ln((1+ε)/(1-ε)) = 2*atanh(ε) ≥ 2ε/9*(4 + 5/(1-3/5*ε^2))

(10-22-2021 02:15 PM)Albert Chan Wrote:  ln(n) ≈ g - g/(2.7 + 24/g^2) ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ , where g = (n-1)/√n (*)

We doubled accuracy if we use above formula instead (Bonus, less code steps)
Again, taylor series of ln((1+ε)/(1-ε)), using above formula for ln:

XCAS> g := (x-1)/sqrt(x)
XCAS> f := g - g/(27/10+24/g^2)
XCAS> series(f(x=(1+ε)/(1-ε)),ε,0,10)

2*ε + 2/3*ε^3 + 2/5*ε^5 + 123/400*ε^7 + 3217/12000*ε^9 + O(ε^11)

XCAS> (c - 6/25) / (c - 123/400) | c=2/7.

-2.09836065574
 « 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)