



Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 25.7 |
|---|---|
| Target | 0.5 |
| Herbie | 12.7 |
if d < -2.5161194196285015e+141Initial program 43.3
Simplified43.3
rmApplied add-sqr-sqrt43.3
Applied *-un-lft-identity43.3
Applied times-frac43.3
Simplified43.3
Simplified26.7
rmApplied associate-*l/26.6
Simplified26.6
rmApplied *-un-lft-identity26.6
Applied associate-/l*26.7
Taylor expanded around -inf 14.2
if -2.5161194196285015e+141 < d < 1.679685344068761e+113Initial program 18.4
Simplified18.4
rmApplied add-sqr-sqrt18.4
Applied *-un-lft-identity18.4
Applied times-frac18.4
Simplified18.4
Simplified11.6
rmApplied associate-*l/11.5
Simplified11.5
if 1.679685344068761e+113 < d Initial program 40.5
Simplified40.5
rmApplied add-sqr-sqrt40.5
Applied *-un-lft-identity40.5
Applied times-frac40.5
Simplified40.5
Simplified25.7
rmApplied associate-*l/25.6
Simplified25.6
Taylor expanded around 0 16.3
Simplified16.3
Final simplification12.7
herbie shell --seed 2019016 +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: 27.1s)Debug log
| 274× | (pre true 80) |
| 274× | (body real 80) |
| 52.0ms | (/ (- (* b c) (* a d)) (+ (* c c) (* d d))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 26.5b
Found 3 expressions with local error:
| 26.5b | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 1.2b | (- (* b c) (* a d)) |
| 0.0b | (fma d d (* c c)) |
| 11× | add-cube-cbrt |
| 11× | *-un-lft-identity |
| 11× | add-sqr-sqrt |
| 9× | times-frac |
| 5× | add-log-exp |
| 5× | add-exp-log |
| 5× | add-cbrt-cube |
| 3× | associate-/l* |
| 3× | log1p-expm1-u |
| 3× | associate-/r* |
| 3× | pow1 |
| 3× | expm1-log1p-u |
| 2× | associate-/l/ |
| 2× | flip-- |
| 2× | flip3-- |
| 1× | div-inv |
| 1× | fma-udef |
| 1× | prod-diff |
| 1× | div-exp |
| 1× | div-sub |
| 1× | diff-log |
| 1× | fma-neg |
| 1× | frac-2neg |
| 1× | sub-neg |
| 1× | clear-num |
| 1× | cbrt-undiv |
| 6.0ms | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 2.0ms | (- (* b c) (* a d)) |
| 0.0ms | (fma d d (* c c)) |
| 68.0ms | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 43.0ms | (- (* b c) (* a d)) |
| 29.0ms | (fma d d (* c c)) |
| 555.0ms | (- (* (* b c) (* b c)) (* (* a d) (* a d))) |
| 298.0ms | (- (pow (* b c) 3) (pow (* a d) 3)) |
| 296.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)))) |
| 73.0ms | (/ (- (* b c) (* a d)) (cbrt (fma d d (* c c)))) |
| 50.0ms | (/ (- (* b c) (* a d)) (sqrt (fma d d (* c c)))) |
11 alts after pruning (11 fresh and 0 done)
Merged error: 16.8b
Found 4 expressions with local error:
| 16.5b | (/ (- (* b c) (* a d)) (hypot d c)) |
| 1.2b | (- (* b c) (* a d)) |
| 0.3b | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
| 0.0b | (/ 1 (hypot d c)) |
| 21× | add-cube-cbrt |
| 21× | *-un-lft-identity |
| 21× | add-sqr-sqrt |
| 18× | times-frac |
| 17× | add-exp-log |
| 13× | associate-*r* |
| 11× | add-cbrt-cube |
| 7× | pow1 |
| 6× | add-log-exp |
| 6× | associate-/r* |
| 4× | div-inv |
| 4× | log1p-expm1-u |
| 4× | prod-exp |
| 4× | associate-*l* |
| 4× | expm1-log1p-u |
| 3× | associate-/l* |
| 3× | div-exp |
| 3× | rec-exp |
| 2× | associate-/l/ |
| 2× | flip-- |
| 2× | cbrt-unprod |
| 2× | flip3-- |
| 2× | frac-2neg |
| 2× | clear-num |
| 2× | cbrt-undiv |
| 1× | inv-pow |
| 1× | pow-flip |
| 1× | *-commutative |
| 1× | associate-*r/ |
| 1× | associate-*l/ |
| 1× | pow-prod-down |
| 1× | prod-diff |
| 1× | div-sub |
| 1× | diff-log |
| 1× | fma-neg |
| 1× | sub-neg |
| 1× | frac-times |
| 7.0ms | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
| 7.0ms | (/ (- (* b c) (* a d)) (hypot d c)) |
| 2.0ms | (- (* b c) (* a d)) |
| 1.0ms | (/ 1 (hypot d c)) |
| 125.0ms | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
| 105.0ms | (/ (- (* b c) (* a d)) (hypot d c)) |
| 41.0ms | (/ 1 (hypot d c)) |
| 36.0ms | (- (* b c) (* a d)) |
| 426.0ms | (- (* (* b c) (* b c)) (* (* a d) (* a d))) |
| 309.0ms | (* 1 (/ (- (* b c) (* a d)) (hypot d c))) |
| 283.0ms | (- (pow (* b c) 3) (pow (* a d) 3)) |
| 216.0ms | (/ (* (* (- (* b c) (* a d)) (- (* b c) (* a d))) (- (* b c) (* a d))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
| 131.0ms | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
11 alts after pruning (11 fresh and 0 done)
Merged error: 6.0b
Found 3 expressions with local error:
| 16.5b | (/ (- (* c b) (* a d)) (hypot d c)) |
| 1.2b | (- (* c b) (* a d)) |
| 0.1b | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 84× | times-frac |
| 53× | add-cube-cbrt |
| 53× | *-un-lft-identity |
| 53× | add-sqr-sqrt |
| 16× | associate-/l* |
| 10× | add-exp-log |
| 10× | add-cbrt-cube |
| 6× | div-inv |
| 6× | associate-/r* |
| 5× | add-log-exp |
| 4× | div-exp |
| 4× | cbrt-undiv |
| 3× | associate-/l/ |
| 3× | log1p-expm1-u |
| 3× | div-sub |
| 3× | pow1 |
| 3× | expm1-log1p-u |
| 2× | flip-- |
| 2× | flip3-- |
| 2× | frac-2neg |
| 2× | clear-num |
| 1× | prod-diff |
| 1× | diff-log |
| 1× | fma-neg |
| 1× | sub-neg |
| 15.0ms | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 13.0ms | (/ (- (* c b) (* a d)) (hypot d c)) |
| 4.0ms | (- (* c b) (* a d)) |
| 110.0ms | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 108.0ms | (/ (- (* c b) (* a d)) (hypot d c)) |
| 44.0ms | (- (* c b) (* a d)) |
| 531.0ms | (- (* (* c b) (* c b)) (* (* a d) (* a d))) |
| 426.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))) |
| 398.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))) |
| 302.0ms | (- (pow (* c b) 3) (pow (* a d) 3)) |
| 267.0ms | (/ (/ (* (cbrt (- (* c b) (* a d))) (cbrt (- (* c b) (* a d)))) 1) (* (cbrt (hypot d c)) (cbrt (hypot d c)))) |
13 alts after pruning (12 fresh and 1 done)
Merged error: 5.9b
Found 4 expressions with local error:
| 16.6b | (/ (hypot d c) (- (* c b) (* a d))) |
| 1.2b | (- (* 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)) |
| 33× | times-frac |
| 29× | add-cube-cbrt |
| 29× | *-un-lft-identity |
| 29× | add-sqr-sqrt |
| 21× | associate-/r* |
| 16× | add-exp-log |
| 9× | associate-/r/ |
| 8× | associate-/l* |
| 8× | div-inv |
| 8× | add-cbrt-cube |
| 6× | add-log-exp |
| 6× | div-exp |
| 5× | pow1 |
| 4× | log1p-expm1-u |
| 4× | rec-exp |
| 4× | expm1-log1p-u |
| 3× | flip-- |
| 3× | flip3-- |
| 3× | frac-2neg |
| 3× | clear-num |
| 2× | cbrt-undiv |
| 1× | associate-/l/ |
| 1× | inv-pow |
| 1× | pow-flip |
| 1× | prod-diff |
| 1× | diff-log |
| 1× | fma-neg |
| 1× | sub-neg |
| 5.0ms | (/ (hypot d c) (- (* c b) (* a d))) |
| 4.0ms | (/ (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) (hypot d c)) |
| 3.0ms | (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) |
| 2.0ms | (- (* c b) (* a d)) |
| 139.0ms | (/ (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) (hypot d c)) |
| 125.0ms | (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) |
| 66.0ms | (/ (hypot d c) (- (* c b) (* a d))) |
| 27.0ms | (- (* c b) (* a d)) |
| 455.0ms | (/ (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) (hypot d c)) |
| 387.0ms | (/ (/ 1 (/ (hypot d c) (- (* c b) (* a d)))) (hypot d c)) |
| 298.0ms | (- (log (/ 1 (/ (hypot d c) (- (* c b) (* a d))))) (log (hypot d c))) |
| 294.0ms | (/ (* (cbrt (/ 1 (/ (hypot d c) (- (* c b) (* a d))))) (cbrt (/ 1 (/ (hypot d c) (- (* c b) (* a d)))))) (* (cbrt (hypot d c)) (cbrt (hypot d c)))) |
| 290.0ms | (/ (sqrt (/ 1 (/ (hypot d c) (- (* c b) (* a d))))) (sqrt (hypot d c))) |
13 alts after pruning (11 fresh and 2 done)
Merged error: 2.3b
24.3% (10.5b remaining)
Error of 12.7b against oracle of 2.2b and baseline of 16.0b
| 8500× | (pre true 80) |
| 8500× | (body real 80) |