New Sum of Powers Log Function

03302021, 08:35 PM
Post: #11




RE: New Sum of Powers Log Function
(03302021 01:44 AM)Albert Chan Wrote: If we have LambertW, we can get a much better guess, without solver. We could estimate the dropped term, and add it back. Code: def guess2(n,s): Above estimated x has similar error as roughx(n,s), but twice as fast. (on my machine) (03302021 01:44 AM)Albert Chan Wrote: Turns out, LambertW 1 branch is the one we need. Illustrate the reason, by example: >>> n, s = 100, 1000 >>> t = log(n+.5) >>> p = lambertw(t/s,1) / t # W1 resulted p >>> p, (n+.5)**p/p, .5**p/p (1.60037803179321, 1000.0, 0.2060704060225) >>> >>> p = lambertw(t/s, 0) / t # W0 resulted p >>> p, (n+.5)**p/p, .5**p/p (0.00100464230172027, 1000.0, 994.686243766351) Both solved p, for s = (n+.5)**p/p. But, the assumption that last term can be dropped is false for W0 

« Next Oldest  Next Newest »

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