3 ms·
Is there a recursive computation for logarithms just like subtraction or division ?
by agumonkey 2y ago
Is there a recursive computation for logarithms just like subtraction or division ?
- IIAOPSW 2y agoe^x = sum_n x^n/n! = 1 + x + (x^2)/2 + (x/3)/6... = 1 + x(1 + (x/2)(1 + (x/3)(1 +... exp(x,n) = 1 + (x/n)*exp(x,n+1) this gives you the exponential function as a recursion formula. Just set some condition for when to truncate. From there, a recursive function that does the exact opposite is easy enough. I'm sure there are optimizations you can do on top in the case that you don't get convergence within the first few terms.
- agumonkey 2y agoThanks that's the kind of process I was aiming at but was stuck early.