[Shootout-list] mandelbrot problem

Jon Harrop jon@ffconsultancy.com
Thu, 16 Jun 2005 01:29:13 +0100


On Thursday 16 June 2005 01:02, Stephen Weeks wrote:
> The mandelbrot benchmark is flawed because it uses floating point
> computations with exact comparisons to yield bits in the output and
> then requires an exact match on the output.

Do you mean it uses exact equality or inequality? If the latter then the 
problem can probably be resolved most easily by redefining the problem to 
avoid near integer floating point values. This will probably mean altering 
the area of the Argand diagram.

> In any case, it seems to me that the benchmark should either introduce
> some tolerance internally, so that the low-level compiler decisions
> are not exposed, or it should allow some tolerance in the output.

I considered this for my tracer: languages that can do so (g++, mlton) could 
use single-precision floating point. I ditched this idea for two reasons, the 
first of which is relevant here:

1. The output is not altered by a small, constant delta but, rather, the edges 
are moved. Thus, selecting an algorithm to determine the correctness of the 
result is non-trivial.

2. Performance was not altered in any seemingly logical way. Using single 
precision on AMD64 shows considerable slowdowns.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists