New Sum of Powers Log Function
|
03-30-2021, 10:26 PM
(This post was last modified: 04-01-2021 11:59 AM by Albert Chan.)
Post: #12
|
|||
|
|||
RE: New Sum of Powers Log Function
Even faster version, eliminated second LambertW, by taylor series approximation.
W(x+h) ≈ W(x) + W'(x) * h w*e^w = x (w+1)*e^w dw = dx dw/dx = e^-w / (w+1) = w/(w*x+x) Code: def guess3(n,s): To speed up search, solvex use log scale. With secants method, and tolerance of 1e-5, we expected 5*1.6 = 8 "correct" decimals. ("correct" from solving root of formula point of view, not actual x) Code: RHS = lambda p,n: ((n+1)**(p+1)-1)/(p+1) - ((n+1)**p-1)/2 + p*((n+1)**(p-1)-1)/12 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)