



Bits error versus re




Bits error versus im
| Original | 37.5 |
|---|---|
| Target | 32.8 |
| Herbie | 13.1 |
Initial program 37.5
Simplified13.1
Final simplification13.1
herbie shell --seed 2019005 +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: 11.6s)Debug log
1 calls. Slowest were:
| 27.0ms | (* 0.5 (sqrt (* 2.0 (+ (sqrt (+ (* re re) (* im im))) re)))) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 12.9b
Found 3 expressions with local error:
| 0.3b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.2b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.0b | (hypot re im) |
3 calls. Slowest were:
| 12.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 1.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.0ms | (hypot re im) |
3 calls. Slowest were:
| 131.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 34.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 24.0ms | (hypot re im) |
13 calls. Slowest were:
| 11.0ms | (+ (* 2.0 re) (* 2.0 im)) |
| 10.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 9.0ms | (sqrt (* (cbrt (fma (hypot re im) 2.0 (* re 2.0))) (cbrt (fma (hypot re im) 2.0 (* re 2.0))))) |
8 alts after pruning (7 fresh and 1 done)
Merged error: 12.8b
Found 4 expressions with local error:
| 0.4b | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 0.3b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.3b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.2b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
4 calls. Slowest were:
| 6.0ms | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 1.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
4 calls. Slowest were:
| 150.0ms | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 145.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 52.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 37.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
44 calls. Slowest were:
| 94.0ms | (* (* (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (* (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 18.0ms | (cbrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 18.0ms | (sqrt (* (cbrt (fma (hypot re im) 2.0 (* re 2.0))) (cbrt (fma (hypot re im) 2.0 (* re 2.0))))) |
6 alts after pruning (5 fresh and 1 done)
Merged error: 12.8b
Found 4 expressions with local error:
| 0.3b | (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 0.3b | (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 0.3b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.3b | (fma (hypot re im) 2.0 (* re 2.0)) |
4 calls. Slowest were:
| 32.0ms | (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 13.0ms | (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 0.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
4 calls. Slowest were:
| 273.0ms | (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 153.0ms | (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) |
| 55.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 39.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
70 calls. Slowest were:
| 347.0ms | (exp (* 1/8 (- (+ (* 3 (log (/ -1 re))) (log 1.0)) (* 6 (log (/ -1 im)))))) |
| 258.0ms | (* (* (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (* (* (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (* (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))))) |
| 232.0ms | (* (* (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (* (* (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))))) (* (sqrt (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))))) |
6 alts after pruning (4 fresh and 2 done)
Merged error: 12.8b
Found 4 expressions with local error:
| 7.5b | (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.2b | (sqrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0))) |
| 0.0b | (hypot re im) |
4 calls. Slowest were:
| 5.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
| 1.0ms | (sqrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0))) |
| 0.0ms | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
4 calls. Slowest were:
| 151.0ms | (sqrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0))) |
| 35.0ms | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 28.0ms | (hypot re im) |
| 26.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
37 calls. Slowest were:
| 30.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)))) |
| 24.0ms | (sqrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0))) |
| 19.0ms | (sqrt (* (cbrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0))) (cbrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0))))) |
11 alts after pruning (9 fresh and 2 done)
Merged error: 12.7b
0% (0.2b remaining)
Error of 13.1b against oracle of 12.9b and baseline of 13.1b