



Bits error versus re




Bits error versus im
| Original | 37.5 |
|---|---|
| Target | 32.6 |
| Herbie | 13.2 |
Initial program 37.5
Initial simplification13.2
Final simplification13.2
herbie shell --seed 2018360 +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: 8.5s)Debug log
2 alts after pruning (2 fresh and 0 done)
Merged error: 10.4b
Found 3 expressions with local error:
| 0.7b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.0b | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.0b | (hypot re im) |
3 calls. Slowest were:
| 1.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:
| 145.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 54.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 25.0ms | (hypot re im) |
13 calls. Slowest were:
| 16.0ms | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
| 15.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 14.0ms | (sqrt (* (cbrt (fma (hypot re im) 2.0 (* re 2.0))) (cbrt (fma (hypot re im) 2.0 (* re 2.0))))) |
7 alts after pruning (6 fresh and 1 done)
Merged error: 10.3b
Found 4 expressions with local error:
| 0.7b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.7b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.5b | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 0.2b | (sqrt (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 (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:
| 154.0ms | (* (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 143.0ms | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
| 56.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 51.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
48 calls. Slowest were:
| 409.0ms | (exp (* 1/4 (- (+ (log (/ -1 re)) (log 1.0)) (* 2 (log (/ -1 im)))))) |
| 199.0ms | (+ (* 0.03125 (* (pow re 2) (exp (* 1/4 (- (log 2.0) (* 7 (log im))))))) (+ (* 0.25 (* re (exp (* 1/4 (- (log 2.0) (* 3 (log im))))))) (exp (* 1/4 (+ (log im) (log 2.0)))))) |
| 114.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)))))) |
7 alts after pruning (5 fresh and 2 done)
Merged error: 10.3b
Found 4 expressions with local error:
| 5.1b | (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 | (sqrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0))) |
| 0.0b | (hypot re im) |
4 calls. Slowest were:
| 9.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
| 2.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:
| 144.0ms | (sqrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0))) |
| 55.0ms | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 38.0ms | (hypot re im) |
| 25.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
37 calls. Slowest were:
| 29.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)))) |
| 14.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))))) |
| 13.0ms | (sqrt (sqrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)))) |
11 alts after pruning (10 fresh and 1 done)
Merged error: 10.2b
Found 4 expressions with local error:
| 5.1b | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 5.1b | (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.5b | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
4 calls. Slowest were:
| 10.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
| 5.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)) |
4 calls. Slowest were:
| 44.0ms | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 42.0ms | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 39.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
| 39.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
54 calls. Slowest were:
| 33.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)))) |
| 17.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)))) |
| 6.0ms | (+ (* 2.0 re) (* 2.0 im)) |
11 alts after pruning (9 fresh and 2 done)
Merged error: 10.2b
0% (0.2b remaining)
Error of 13.2b against oracle of 13.0b and baseline of 13.2b