Yes, I suspect you are right. I didn&#39;t look into that in much detail, although I did try exchanging &quot;(2 ^ 50000000)&quot; with &quot;(1 `shiftL` 50000000)&quot;; but that didn&#39;t make any difference.<br><br>Uwe<br>
<br><div class="gmail_quote">On Fri, Feb 15, 2008 at 9:21 AM, Ryan Ingram &lt;<a href="mailto:ryani.spam@gmail.com">ryani.spam@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Thu, Feb 14, 2008 at 8:23 PM, Uwe Hollerbach &lt;<a href="mailto:uhollerbach@gmail.com">uhollerbach@gmail.com</a>&gt; wrote:<br>
&gt; &nbsp;Stefan&#39;s routine is, as expected, much much faster still: I tested the<br>
&gt; &nbsp;first two routines on numbers with 5 million or so bits and they took<br>
&gt; &nbsp;~20 seconds of CPU time, whereas I tested Stefan&#39;s routine with<br>
&gt; &nbsp;numbers with 50 million bits, and it took ~11 seconds of CPU time.<br>
<br>
</div>This seems wrong to me; that routine should take a small constant<br>
amount of time. &nbsp;I suspect you are measuring the time to construct the<br>
50-million bit numbers as well. &nbsp;If you constructed a single number<br>
and called this routine on it several times I am sure you would get<br>
far different results, with the first routines taking ~7-11s each and<br>
Stefan&#39;s GHC/GMP-magic taking almost nothing.<br>
<font color="#888888"><br>
 &nbsp;-- ryan<br>
</font></blockquote></div><br>