Talk:Nth root: Difference between revisions

Line 1:
== More effient implementation by computing the diffence first ==
Most implementations use x(k+1) = (x(k)*(n-1) + A/x(k)^n) / n, d = x(k+1)-x(k) instead of d = (A/x(k)^n - x(k) / n, x(k+1) = x(k) + d; This leads to inefficient algorithm and should be corrected (see implementation for for AWK, C and Octave). --[[User:Aschloegl]]
 
: There's no reason to believe that. At least in the C example, the bottleneck is likely the <code>pow_()</code> function, so calculating diff or x_k shouldn't make much of a difference. In fact, the C example compiled with <code>gcc -Ofast -msse</code> on my machine, looping over <code>root(x, 15)</code> a million times actually became marginally slower after your edit. I'll not revert the edit as the difference is small. You also forgot to change the return value. --[[User:Ledrug|Ledrug]] 12:57, 10 November 2012 (UTC)
 
==Comparison to Non-integer Exponentiation==
Anonymous user