(s.Elapsed.TotalSeconds, r)
let rec loop (z : Complex)
elif iterations = maxIteration then
let rec loop (z : Complex)
if Complex.Abs(z) >= 2.0 then
elif iterations = maxIteration then
let rec loop (z : Complex)
* z.Imaginary >= 4.0 then
elif iterations = maxIteration then
let mandelbrotf (c : Complex) =
let rec loop zr zi iterations =
if zr * zr + zi * zi >= 4.0 then
elif iterations = maxIteration then
let mandelbrotfs (c : Complex) =
let rec loop zr zi iterations =
elif iterations = maxIteration then
[| for y in -1.2..0.15..1.2 do
for x in -2.0..0.07..0.9 do
Array.Parallel.map f coord
let mandel f = Array.map f coord
[ (mandelbrotc, "Complex")
"Complex, optimized Pow(z,2.0)")
"Complex, optimized Abs(z)")
(mandelbrotf, "Floating-point")
"Floating-point, common subexpression elimination") ]
let ((_, r), _) = List.head xs
result mandel " (serial)"
@ result mandelp " (parallel)"
"Results are not identical"
for ((t, _), txt) in r do
printfn "%6.3fs %s" t txt