(28/48/50) Lambert W Function
|
03-31-2023, 04:06 PM
Post: #16
|
|||
|
|||
RE: (28/48/50) Lambert W Function
(03-27-2023 08:57 PM)Albert Chan Wrote: lua> x = sqrt(2*h/r) -- rough guess for e*h = (1+x)*log1p(x) - x I was curious why the 2 W's do not bracket true W(a) Doing a bit of error analysis, everything becomes clear. Ignoring error of division, we have: relerr(x = a/y) ≈ - relerr(y) ln(y*(1+ε)) ≈ ln(y) + ε ln(y*(1+ε)) / ln(y) ≈ 1 + ε/ln(y) relerr(ln(y)) ≈ relerr(y) / ln(y) 2 W's don't bracket true W(a) is because ln(y) ≈ x is negative. 2 W's have errors of the same sign. relerr(x) + x*relerr(ln(y)) ≈ -relerr(y) + relerr(y) ≈ 0 lua> x, lny = -0.9793607152032429, -0.9793607152084147 lua> (x + x*lny) / (1+x) -0.9793607149578298 Simply extrapolate for 0 error, we get good W(-0.3678) estimate. Actually, extrapolate for 0 error is equivalent to a Newton's step! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)