1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // This benchmark, taken from the shootuot, tests floating point performance.
11 func mandelbrot(n int) int {
13 const Zero float64 = 0
16 for y := 0; y < n; y++ {
17 for x := 0; x < n; x++ {
18 Zr, Zi, Tr, Ti := Zero, Zero, Zero, Zero
19 Cr := (2*float64(x)/float64(n) - 1.5)
20 Ci := (2*float64(y)/float64(n) - 1.0)
22 for i := 0; i < Iter && (Tr+Ti <= Limit*Limit); i++ {
29 if Tr+Ti <= Limit*Limit {
37 func BenchmarkMandelbrot200(b *testing.B) {
38 for i := 0; i < b.N; i++ {