



Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 25.4 |
|---|---|
| Target | 0.4 |
| Herbie | 12.1 |
if d < -3.888992367226674e+174Initial program 44.7
Simplified44.7
rmApplied add-sqr-sqrt44.7
Applied *-un-lft-identity44.7
Applied times-frac44.7
Simplified44.7
Simplified29.6
rmApplied associate-*l/29.6
Simplified29.6
rmApplied *-un-lft-identity29.6
Applied associate-/l*29.6
Taylor expanded around -inf 13.0
if -3.888992367226674e+174 < d < 2.3163448447978856e+141Initial program 18.8
Simplified18.8
rmApplied add-sqr-sqrt18.8
Applied *-un-lft-identity18.8
Applied times-frac18.8
Simplified18.8
Simplified11.6
rmApplied associate-*l/11.5
Simplified11.5
rmApplied *-un-lft-identity11.5
Applied associate-/l*11.6
rmApplied associate-/r/11.6
Applied associate-/l*11.6
if 2.3163448447978856e+141 < d Initial program 43.0
Simplified43.0
rmApplied add-sqr-sqrt43.0
Applied *-un-lft-identity43.0
Applied times-frac43.0
Simplified43.0
Simplified27.7
rmApplied associate-*l/27.7
Simplified27.7
Taylor expanded around 0 13.7
Simplified13.7
Final simplification12.1
herbie shell --seed 2019002 +o rules:numerics
(FPCore (a b c d)
:name "Complex division, imag part"
:herbie-target
(if (< (fabs d) (fabs c)) (/ (- b (* a (/ d c))) (+ c (* d (/ d c)))) (/ (+ (- a) (* b (/ c d))) (+ d (* c (/ c d)))))
(/ (- (* b c) (* a d)) (+ (* c c) (* d d))))
Time bar (total: 24.8s)Debug log
1 calls. Slowest were:
| 52.0ms | (/ (- (* b c) (* a d)) (+ (* c c) (* d d))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 25.6b
Found 2 expressions with local error:
| 25.6b | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 0.3b | (- (* b c) (* a d)) |
2 calls. Slowest were:
| 12.0ms | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 4.0ms | (- (* b c) (* a d)) |
2 calls. Slowest were:
| 85.0ms | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 46.0ms | (- (* b c) (* a d)) |
37 calls. Slowest were:
| 683.0ms | (- (* (* b c) (* b c)) (* (* a d) (* a d))) |
| 367.0ms | (/ (* (* (- (* b c) (* a d)) (- (* b c) (* a d))) (- (* b c) (* a d))) (* (* (fma d d (* c c)) (fma d d (* c c))) (fma d d (* c c)))) |
| 339.0ms | (- (pow (* b c) 3) (pow (* a d) 3)) |
12 alts after pruning (12 fresh and 0 done)
Merged error: 16.7b
Found 4 expressions with local error:
| 16.5b | (/ (- (* b c) (* a d)) (hypot d c)) |
| 0.3b | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
| 0.3b | (- (* b c) (* a d)) |
| 0.0b | (/ 1 (hypot d c)) |
4 calls. Slowest were:
| 19.0ms | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
| 12.0ms | (/ (- (* b c) (* a d)) (hypot d c)) |
| 4.0ms | (- (* b c) (* a d)) |
4 calls. Slowest were:
| 113.0ms | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
| 104.0ms | (/ (- (* b c) (* a d)) (hypot d c)) |
| 30.0ms | (- (* b c) (* a d)) |
| 26.0ms | (/ 1 (hypot d c)) |
73 calls. Slowest were:
| 555.0ms | (- (* (* b c) (* b c)) (* (* a d) (* a d))) |
| 353.0ms | (* 1 (/ (- (* b c) (* a d)) (hypot d c))) |
| 310.0ms | (- (pow (* b c) 3) (pow (* a d) 3)) |
14 alts after pruning (14 fresh and 0 done)
Merged error: 6.3b
Found 4 expressions with local error:
| 16.5b | (/ (- (* c b) (* a d)) (hypot d c)) |
| 0.3b | (- (* c b) (* a d)) |
| 0.1b | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 0.0b | (hypot d c) |
4 calls. Slowest were:
| 9.0ms | (/ (- (* c b) (* a d)) (hypot d c)) |
| 7.0ms | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 2.0ms | (- (* c b) (* a d)) |
4 calls. Slowest were:
| 76.0ms | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 65.0ms | (/ (- (* c b) (* a d)) (hypot d c)) |
| 39.0ms | (- (* c b) (* a d)) |
| 23.0ms | (hypot d c) |
142 calls. Slowest were:
| 582.0ms | (/ (* (* (/ (- (* c b) (* a d)) (hypot d c)) (/ (- (* c b) (* a d)) (hypot d c))) (/ (- (* c b) (* a d)) (hypot d c))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
| 575.0ms | (- (* (* c b) (* c b)) (* (* a d) (* a d))) |
| 411.0ms | (/ (/ (* (* (- (* c b) (* a d)) (- (* c b) (* a d))) (- (* c b) (* a d))) (* (* (hypot d c) (hypot d c)) (hypot d c))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
15 alts after pruning (15 fresh and 0 done)
Merged error: 6.3b
Found 4 expressions with local error:
| 16.5b | (/ (hypot d c) (- (* c b) (* a d))) |
| 0.3b | (- (* c b) (* a d)) |
| 0.2b | (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) |
| 0.1b | (/ (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) (hypot d c)) |
4 calls. Slowest were:
| 5.0ms | (/ (hypot d c) (- (* c b) (* a d))) |
| 4.0ms | (/ (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) (hypot d c)) |
| 2.0ms | (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) |
4 calls. Slowest were:
| 107.0ms | (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) |
| 90.0ms | (/ (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) (hypot d c)) |
| 65.0ms | (/ (hypot d c) (- (* c b) (* a d))) |
| 25.0ms | (- (* c b) (* a d)) |
99 calls. Slowest were:
| 315.0ms | (/ (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) (hypot d c)) |
| 302.0ms | (/ (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) (hypot d c)) |
| 232.0ms | (- (log (/ 1 (/ (hypot d c) (- (* c b) (* a d))))) (log (hypot d c))) |
13 alts after pruning (13 fresh and 0 done)
Merged error: 1.5b
28.9% (9.8b remaining)
Error of 12.1b against oracle of 2.3b and baseline of 16.1b