



Bits error versus re




Bits error versus im
| Original | 37.7 |
|---|---|
| Target | 32.9 |
| Herbie | 13.8 |
Initial program 37.7
Initial simplification13.8
Final simplification13.8
herbie shell --seed 2018362 +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.2s)Debug log
2 alts after pruning (2 fresh and 0 done)
Merged error: 13.3b
Found 3 expressions with local error:
| 1.0b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 0.5b | (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:
| 173.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 49.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
| 23.0ms | (hypot re im) |
13 calls. Slowest were:
| 18.0ms | (sqrt (* (cbrt (fma (hypot re im) 2.0 (* re 2.0))) (cbrt (fma (hypot re im) 2.0 (* re 2.0))))) |
| 16.0ms | (sqrt (sqrt (fma (hypot re im) 2.0 (* re 2.0)))) |
| 9.0ms | (sqrt (fma (hypot re im) 2.0 (* re 2.0))) |
7 alts after pruning (6 fresh and 1 done)
Merged error: 13.1b
Found 4 expressions with local error:
| 1.0b | (fma (hypot re im) 2.0 (* re 2.0)) |
| 1.0b | (fma (hypot re im) 2.0 (* 2.0 re)) |
| 0.9b | (cbrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 0.9b | (cbrt (fma (hypot re im) 2.0 (* 2.0 re))) |
4 calls. Slowest were:
| 1.0ms | (cbrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 1.0ms | (cbrt (fma (hypot re im) 2.0 (* 2.0 re))) |
| 0.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
4 calls. Slowest were:
| 178.0ms | (cbrt (fma (hypot re im) 2.0 (* 2.0 re))) |
| 157.0ms | (cbrt (fma (hypot re im) 2.0 (* re 2.0))) |
| 53.0ms | (fma (hypot re im) 2.0 (* 2.0 re)) |
| 44.0ms | (fma (hypot re im) 2.0 (* re 2.0)) |
18 calls. Slowest were:
| 235.0ms | (+ (exp (* 1/3 (+ (log im) (log 2.0)))) (+ (* 0.3333333333333333 (* re (exp (* 1/3 (- (log 2.0) (* 2 (log im))))))) (* 0.05555555555555555 (* (pow re 2) (exp (* 1/3 (- (log 2.0) (* 5 (log im))))))))) |
| 179.0ms | (+ (exp (* 1/3 (+ (log im) (log 2.0)))) (+ (* 0.3333333333333333 (* re (exp (* 1/3 (- (log 2.0) (* 2 (log im))))))) (* 0.05555555555555555 (* (pow re 2) (exp (* 1/3 (- (log 2.0) (* 5 (log im))))))))) |
| 107.0ms | (exp (* 1/3 (- (+ (log (/ -1 re)) (log 1.0)) (* 2 (log (/ -1 im)))))) |
8 alts after pruning (7 fresh and 1 done)
Merged error: 13.1b
Found 4 expressions with local error:
| 7.8b | (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 (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:
| 130.0ms | (sqrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0))) |
| 49.0ms | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 30.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
| 25.0ms | (hypot re im) |
37 calls. Slowest were:
| 83.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))))) |
| 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)))) |
| 30.0ms | (sqrt (sqrt (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)))) |
13 alts after pruning (12 fresh and 1 done)
Merged error: 13.1b
Found 4 expressions with local error:
| 7.8b | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 7.8b | (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:
| 5.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:
| 45.0ms | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 39.0ms | (fma (* (sqrt (hypot re im)) (sqrt (hypot re im))) 2.0 (* re 2.0)) |
| 28.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
| 24.0ms | (* (sqrt (hypot re im)) (sqrt (hypot re im))) |
54 calls. Slowest were:
| 19.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)))) |
| 18.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)) |
13 alts after pruning (11 fresh and 2 done)
Merged error: 13.1b
0% (0.2b remaining)
Error of 13.8b against oracle of 13.6b and baseline of 13.8b