<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-10-02 16:48 GMT+02:00 David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Sat, Oct 01, 2016 at 08:19:27PM +0000, <a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a> wrote:<br>
&gt; Nicolas Cellier uploaded a new version of Kernel to project The Trunk:<br>
&gt; <a href="http://source.squeak.org/trunk/Kernel-nice.1043.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/<wbr>trunk/Kernel-nice.1043.mcz</a><br>
&gt;<br>
&gt; ==================== Summary ====================<br>
&gt;<br>
&gt; Name: Kernel-nice.1043<br>
&gt; Author: nice<br>
&gt; Time: 1 October 2016, 10:19:12.37443 pm<br>
&gt; UUID: d29f9c07-edc8-4add-9b99-<wbr>e889fd2be32a<br>
&gt; Ancestors: Kernel-nice.1042<br>
&gt;<br>
&gt; Fix (10 raisedTo: 600) nthRoot: 300.<br>
&gt; It did incorrectly return 126.0 instead of 100.<br>
&gt;<br>
<br>
</span>Can you say anything about the underlying cause of this problem? I saw it<br>
in my 64-bit image, but not in my 32-bit image. The Kernel-nice.1042 update<br>
resolved the problem in my 64-bit image, but I find that when I revert<br>
to Kernel-tfel.1040, the problem does not come back. Strange...<br>
<br>
Thanks,<br>
Dave<br>
<br></blockquote><div>Hi Dave,<br></div><div>I don&#39;t see why there would be any difference between 32 and 64 bits image.<br></div><div>The problem lies in the Newton-Raphson algorithm:<br><br></div><div>xn+1 = xn - (f(xn)-y)/(f&#39;(xn))<br><br></div><div>for f(x) = x^p, the convergence is very slow when p is high because derivative is p*x^(p-1).<br></div><div>But we did store the integer part of decrement:<br><br></div><div>    delta := (guess * guessToTheNthMinusOne - self) // (guessToTheNthMinusOne * aPositiveInteger).<br><br></div><div>Initial guess is 128, delta=2, then 126 delta&lt;1, so the initial algorithm was stuck.<br><br></div><div>So I truncated xn+1 instead of truncating the delta and iterated until xn+1=xn. <br><br></div><div>But the correction above was wrong, because we can have guess and nextGuess from each side of nth-root, and never reach an integer fix point, but rather x(n+2)=x(n+1) - 1 and x(n+1) = x(n) + 1.<br></div><div><br> <br></div></div><br></div></div>