Hi Matthew,<br><br> Thank you very much for your prompt response! <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. 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 "by-hand" sqrt computation necessary, a performance penalty. <br>So the following code should be guaranteed to contain the mathematical value:
<br><br> (* assumes rounding down *)<br> fun sqrt (lo,hi) =<br> let <br> val lo' = Math.sqrt lo<br> val _ = up() <br> val hi' = Math.sqrt hi<br> in<br> down(); <br> (lo',hi')
<br> 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> <<a href="mailto:fluet@tti-c.org">fluet@tti-c.org</a>> 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>>> I'd hate to lose optimizations, as I switched from O'Caml because the<br>>> floating point computations were so much faster in my application.<br>><br>> My guess is that it wouldn't be that bad. I suspect that floating-point
<br>> operations susceptible to CSE are rare; certainly, much rarer than integer,<br>> 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. 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 MLton0 MLton1<br>barnes-hut 1.00 1.02<br>fft 1.00 0.96<br>hamlet
1.00 1.00<br>mandelbrot 1.00 1.00<br>matrix-multiply 1.00 1.03<br>nucleic 1.00 1.00<br>ray 1.00 1.01<br>raytrace 1.00 1.01<br>simple 1.00 1.00<br>tensor
1.00 1.00<br>tsp 1.00 1.03<br>tyan 1.00 1.00<br>vliw 1.00 0.99<br>zern 1.00 1.00<br><br></blockquote></div><br>