Hi Matthew,<br><br>&nbsp; Thank you very much for your prompt response!&nbsp; <br><br>As for interval arithmetic, a main concern of mine is that <br>the sqrt function rounds correctly given the rounding mode, as specified<br>in IEEE754.&nbsp; This function is heavily used in my application, and some
<br>compilers have been known not to follow the standard in this regard. This<br>makes a &quot;by-hand&quot; sqrt computation necessary, a performance penalty.&nbsp; <br>So the following code should be guaranteed to contain the mathematical value:
<br><br>&nbsp; (* assumes rounding down *)<br>&nbsp; fun sqrt (lo,hi) =<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let <br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; val lo&#39; = Math.sqrt lo<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val _ = up() <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; val hi&#39; = Math.sqrt hi<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; down(); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (lo&#39;,hi&#39;)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br><br>Sadly the transcendental functions are not so specified, so I have no other<br>expectations of the math library.<br><br>Best,<br><br>Sean<br><br><div><span class="gmail_quote">On 7/26/07, <b class="gmail_sendername">
Matthew Fluet</b> &lt;<a href="mailto:fluet@tti-c.org">fluet@tti-c.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>&gt;&gt;&nbsp;&nbsp;I&#39;d hate to lose optimizations, as I switched from O&#39;Caml because the<br>&gt;&gt;&nbsp;&nbsp;floating point computations were so much faster in my application.<br>&gt;<br>&gt; My guess is that it wouldn&#39;t be that bad.&nbsp;&nbsp;I suspect that floating-point
<br>&gt; operations susceptible to CSE are rare; certainly, much rarer than integer,<br>&gt; array/vector, and tuple operations susceptible to CSE.<br><br>I checked in the change to the treatment of floating-point operations; it
<br>has a negligible effect on the floating-point intensive benchmarks.&nbsp;&nbsp;I<br>suspect that the performance improvement over OCaml mainly comes from<br>MLton using unboxed reals.<br><br>MLton0 -- ~/devel/mlton/mlton.svn.trunk/build/bin/mlton (* FP ops Functional *)
<br>MLton1 -- ~/devel/mlton/mlton.svn.trunk.fpops/build/bin/mlton (* FP ops DependsOnState *)<br>run time ratio<br>benchmark&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MLton0 MLton1<br>barnes-hut&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.00&nbsp;&nbsp; 1.02<br>fft&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.00&nbsp;&nbsp; 0.96<br>hamlet&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
1.00&nbsp;&nbsp; 1.00<br>mandelbrot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.00&nbsp;&nbsp; 1.00<br>matrix-multiply&nbsp;&nbsp; 1.00&nbsp;&nbsp; 1.03<br>nucleic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.00&nbsp;&nbsp; 1.00<br>ray&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.00&nbsp;&nbsp; 1.01<br>raytrace&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.00&nbsp;&nbsp; 1.01<br>simple&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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