



Bits error versus re




Bits error versus im
| Original | 37.7 |
|---|---|
| Target | 33.0 |
| Herbie | 12.9 |
Initial program 37.7
Simplified12.9
Final simplification12.9
herbie shell --seed 2019008 +o rules:numerics
(FPCore (re im)
:name "math.sqrt on complex, real part"
:herbie-target
(if (< re 0) (* 0.5 (* (sqrt 2) (sqrt (/ (* im im) (- (sqrt (+ (* re re) (* im im))) re))))) (* 0.5 (sqrt (* 2.0 (+ (sqrt (+ (* re re) (* im im))) re)))))
(* 0.5 (sqrt (* 2.0 (+ (sqrt (+ (* re re) (* im im))) re)))))
Time bar (total: 10.3s)Debug log
1 calls. Slowest were:
| 19.0ms | (* 0.5 (sqrt (* 2.0 (+ (sqrt (+ (* re re) (* im im))) re)))) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 13.6b
Found 3 expressions with local error:
| 0.5b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.0b | (hypot re im) |
| 0.0b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
3 calls. Slowest were:
| 2.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.0ms | (hypot re im) |
3 calls. Slowest were:
| 132.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 62.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 38.0ms | (hypot re im) |
13 calls. Slowest were:
| 19.0ms | (sqrt (* (cbrt (fma (hypot re im) 2.0 (* re 2.0))) (cbrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 14.0ms | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
| 7.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
5 alts after pruning (4 fresh and 1 done)
Merged error: 13.5b
Found 4 expressions with local error:
| 8.3b | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 0.5b | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
| 0.0b | (hypot re im) |
| 0.0b | (hypot re im) |
4 calls. Slowest were:
| 10.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
| 0.0ms | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 0.0ms | (hypot re im) |
4 calls. Slowest were:
| 43.0ms | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 36.0ms | (hypot re im) |
| 27.0ms | (hypot re im) |
| 25.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
33 calls. Slowest were:
| 32.0ms | (* (* (* (sqrt (hypot re im)) (sqrt (hypot re im))) (sqrt (hypot re im))) (* (* (sqrt (hypot re im)) (sqrt (hypot re im))) (sqrt (hypot re im)))) |
| 5.0ms | (+ (* 2.0 re) (* 2.0 im)) |
| 3.0ms | (* (hypot re im) (hypot re im)) |
8 alts after pruning (6 fresh and 2 done)
Merged error: 13.4b
Found 4 expressions with local error:
| 9.6b | (fma (* (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) (sqrt (sqrt (hypot re im)))) 2.0 (* re 2.0)) |
| 0.4b | (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) |
| 0.2b | (* (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) (sqrt (sqrt (hypot re im)))) |
| 0.1b | (sqrt (sqrt (hypot re im))) |
4 calls. Slowest were:
| 14.0ms | (* (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) (sqrt (sqrt (hypot re im)))) |
| 5.0ms | (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) |
| 1.0ms | (sqrt (sqrt (hypot re im))) |
4 calls. Slowest were:
| 115.0ms | (sqrt (sqrt (hypot re im))) |
| 115.0ms | (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) |
| 47.0ms | (fma (* (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) (sqrt (sqrt (hypot re im)))) 2.0 (* re 2.0)) |
| 35.0ms | (* (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) (sqrt (sqrt (hypot re im)))) |
69 calls. Slowest were:
| 105.0ms | (* (* (* (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im))))) (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im))))) (* (* (sqrt (sqrt (hypot re im))) (sqrt (sqrt (hypot re im)))) (sqrt (sqrt (hypot re im))))) |
| 91.0ms | (* (* (* (* (sqrt (hypot re im)) (sqrt (hypot re im))) (sqrt (hypot re im))) (* (* (sqrt (sqrt (hypot re im))) (sqrt (sqrt (hypot re im)))) (sqrt (sqrt (hypot re im))))) (* (* (sqrt (sqrt (hypot re im))) (sqrt (sqrt (hypot re im)))) (sqrt (sqrt (hypot re im))))) |
| 50.0ms | (+ (* 1/8 (* (pow re 2) (pow (/ 1 (pow im 7)) 1/4))) (pow im 1/4)) |
13 alts after pruning (12 fresh and 1 done)
Merged error: 13.4b
Found 4 expressions with local error:
| 8.4b | (fma (* (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) (* (fabs (cbrt (sqrt (hypot re im)))) (sqrt (cbrt (sqrt (hypot re im)))))) 2.0 (* re 2.0)) |
| 0.5b | (cbrt (sqrt (hypot re im))) |
| 0.5b | (cbrt (sqrt (hypot re im))) |
| 0.4b | (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) |
4 calls. Slowest were:
| 17.0ms | (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) |
| 2.0ms | (cbrt (sqrt (hypot re im))) |
| 2.0ms | (cbrt (sqrt (hypot re im))) |
4 calls. Slowest were:
| 145.0ms | (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) |
| 138.0ms | (cbrt (sqrt (hypot re im))) |
| 131.0ms | (cbrt (sqrt (hypot re im))) |
| 123.0ms | (fma (* (* (sqrt (hypot re im)) (sqrt (sqrt (hypot re im)))) (* (fabs (cbrt (sqrt (hypot re im)))) (sqrt (cbrt (sqrt (hypot re im)))))) 2.0 (* re 2.0)) |
47 calls. Slowest were:
| 271.0ms | (+ (* 2.0 re) (+ (* 0.8333333333333334 (* (pow (/ 1 (pow im 7)) 1/6) (* (pow re 2) (fabs (pow (hypot re im) 1/6))))) (* 2.0 (* (pow (pow im 5) 1/6) (fabs (pow (hypot re im) 1/6)))))) |
| 54.0ms | (+ (pow im 3/4) (* 3/8 (* (pow re 2) (pow (/ 1 (pow im 5)) 1/4)))) |
| 51.0ms | (* (* (* (sqrt (hypot re im)) (sqrt (hypot re im))) (sqrt (hypot re im))) (* (* (sqrt (sqrt (hypot re im))) (sqrt (sqrt (hypot re im)))) (sqrt (sqrt (hypot re im))))) |
11 alts after pruning (10 fresh and 1 done)
Merged error: 13.4b
0% (0.2b remaining)
Error of 12.9b against oracle of 12.7b and baseline of 12.9b