



Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 26.1 |
|---|---|
| Target | 0.3 |
| Herbie | 7.1 |
if c < -1.8988337831022309e+177Initial program 43.4
Simplified43.4
rmApplied add-sqr-sqrt43.4
Applied *-un-lft-identity43.4
Applied times-frac43.4
Simplified43.4
Simplified29.8
rmApplied associate-*l/29.8
Simplified29.8
Taylor expanded around -inf 11.7
Simplified11.7
if -1.8988337831022309e+177 < c < 2.599647374459235e+114Initial program 19.6
Simplified19.6
rmApplied add-sqr-sqrt19.6
Applied *-un-lft-identity19.6
Applied times-frac19.6
Simplified19.6
Simplified12.1
rmApplied associate-*r/12.1
rmApplied sub-neg12.1
Applied distribute-lft-in12.1
Simplified4.2
if 2.599647374459235e+114 < c Initial program 41.9
Simplified41.9
rmApplied add-sqr-sqrt41.9
Applied *-un-lft-identity41.9
Applied times-frac41.9
Simplified41.9
Simplified27.0
rmApplied associate-*r/27.0
Taylor expanded around 0 16.4
Final simplification7.1
herbie shell --seed 2019022 +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: 18.5s)Debug log
| 25.0ms | 267× | body | 80 | valid |
| 60.0ms | (/ (- (* b c) (* a d)) (+ (* c c) (* d d))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 28.1b
Found 3 expressions with local error:
| 28.1b | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 0.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 |
| 7.0ms | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 2.0ms | (- (* b c) (* a d)) |
| 0.0ms | (fma d d (* c c)) |
| 63.0ms | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 29.0ms | (- (* b c) (* a d)) |
| 17.0ms | (fma d d (* c c)) |
| 478.0ms | (- (* (* b c) (* b c)) (* (* a d) (* a d))) |
| 250.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)))) |
| 194.0ms | (- (pow (* b c) 3) (pow (* a d) 3)) |
| 44.0ms | (/ (* (cbrt (- (* b c) (* a d))) (cbrt (- (* b c) (* a d)))) (* (cbrt (fma d d (* c c))) (cbrt (fma d d (* c c))))) |
| 38.0ms | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
9 alts after pruning (9 fresh and 0 done)
Merged error: 16.8b
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.2b | (- (* b c) (* a d)) |
| 0.0b | (hypot d c) |
| 20× | add-cube-cbrt |
| 20× | *-un-lft-identity |
| 20× | add-sqr-sqrt |
| 18× | times-frac |
| 16× | add-exp-log |
| 13× | associate-*r* |
| 11× | add-cbrt-cube |
| 6× | add-log-exp |
| 6× | pow1 |
| 4× | log1p-expm1-u |
| 4× | prod-exp |
| 4× | associate-*l* |
| 4× | expm1-log1p-u |
| 3× | associate-/l* |
| 3× | div-inv |
| 3× | div-exp |
| 3× | associate-/r* |
| 2× | associate-/l/ |
| 2× | flip-- |
| 2× | cbrt-unprod |
| 2× | flip3-- |
| 2× | rec-exp |
| 2× | cbrt-undiv |
| 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× | frac-2neg |
| 1× | sub-neg |
| 1× | clear-num |
| 1× | hypot-udef |
| 1× | frac-times |
| 10.0ms | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
| 6.0ms | (/ (- (* b c) (* a d)) (hypot d c)) |
| 2.0ms | (- (* b c) (* a d)) |
| 0.0ms | (hypot d c) |
| 98.0ms | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
| 89.0ms | (/ (- (* b c) (* a d)) (hypot d c)) |
| 28.0ms | (- (* b c) (* a d)) |
| 23.0ms | (hypot d c) |
| 430.0ms | (- (* (* b c) (* b c)) (* (* a d) (* a d))) |
| 264.0ms | (- (pow (* b c) 3) (pow (* a d) 3)) |
| 219.0ms | (* 1 (/ (- (* b c) (* a d)) (hypot d c))) |
| 186.0ms | (/ (* (* (- (* b c) (* a d)) (- (* b c) (* a d))) (- (* b c) (* a d))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
| 98.0ms | (* (* (* (/ 1 (hypot d c)) (/ 1 (hypot d c))) (/ 1 (hypot d c))) (/ (* (* (- (* b c) (* a d)) (- (* b c) (* a d))) (- (* b c) (* a d))) (* (* (hypot d c) (hypot d c)) (hypot d c)))) |
10 alts after pruning (10 fresh and 0 done)
Merged error: 4.5b
Found 4 expressions with local error:
| 16.5b | (/ (- (* c b) (* a d)) (hypot d c)) |
| 0.2b | (- (* c b) (* a d)) |
| 0.1b | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 0.0b | (hypot d c) |
| 84× | times-frac |
| 54× | add-cube-cbrt |
| 54× | *-un-lft-identity |
| 54× | add-sqr-sqrt |
| 16× | associate-/l* |
| 11× | add-exp-log |
| 11× | add-cbrt-cube |
| 6× | add-log-exp |
| 6× | div-inv |
| 6× | associate-/r* |
| 4× | log1p-expm1-u |
| 4× | div-exp |
| 4× | cbrt-undiv |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 3× | associate-/l/ |
| 3× | div-sub |
| 2× | flip-- |
| 2× | flip3-- |
| 2× | frac-2neg |
| 2× | clear-num |
| 1× | prod-diff |
| 1× | diff-log |
| 1× | fma-neg |
| 1× | sub-neg |
| 1× | hypot-udef |
| 7.0ms | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 6.0ms | (/ (- (* c b) (* a d)) (hypot d c)) |
| 2.0ms | (- (* c b) (* a d)) |
| 0.0ms | (hypot d c) |
| 63.0ms | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 62.0ms | (/ (- (* c b) (* a d)) (hypot d c)) |
| 27.0ms | (- (* c b) (* a d)) |
| 22.0ms | (hypot d c) |
| 351.0ms | (- (* (* c b) (* c b)) (* (* a d) (* a d))) |
| 337.0ms | (/ (/ (- (* c b) (* a d)) (sqrt (hypot d c))) (hypot d c)) |
| 332.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))) |
| 263.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))) |
| 176.0ms | (- (pow (* c b) 3) (pow (* a d) 3)) |
12 alts after pruning (12 fresh and 0 done)
Merged error: 4.5b
Found 4 expressions with local error:
| 16.6b | (* (/ 1 (hypot d c)) (- (* b c) (* a d))) |
| 0.2b | (- (* b c) (* a d)) |
| 0.1b | (/ (* (/ 1 (hypot d c)) (- (* b c) (* a d))) (hypot d c)) |
| 0.0b | (hypot d c) |
| 16× | add-exp-log |
| 11× | add-cbrt-cube |
| 8× | add-cube-cbrt |
| 8× | *-un-lft-identity |
| 8× | add-sqr-sqrt |
| 6× | add-log-exp |
| 6× | pow1 |
| 5× | associate-/l/ |
| 5× | flip-- |
| 5× | flip3-- |
| 4× | log1p-expm1-u |
| 4× | associate-*r/ |
| 4× | prod-exp |
| 4× | associate-*l* |
| 4× | frac-times |
| 4× | expm1-log1p-u |
| 3× | prod-diff |
| 3× | associate-*r* |
| 3× | div-exp |
| 3× | times-frac |
| 3× | distribute-lft-in |
| 3× | sub-neg |
| 3× | associate-/r* |
| 3× | distribute-rgt-in |
| 2× | div-inv |
| 2× | cbrt-unprod |
| 2× | associate-*l/ |
| 2× | rec-exp |
| 2× | cbrt-undiv |
| 1× | associate-/l* |
| 1× | *-commutative |
| 1× | pow-prod-down |
| 1× | diff-log |
| 1× | fma-neg |
| 1× | frac-2neg |
| 1× | clear-num |
| 1× | hypot-udef |
| 10.0ms | (/ (* (/ 1 (hypot d c)) (- (* b c) (* a d))) (hypot d c)) |
| 7.0ms | (* (/ 1 (hypot d c)) (- (* b c) (* a d))) |
| 2.0ms | (- (* b c) (* a d)) |
| 0.0ms | (hypot d c) |
| 90.0ms | (/ (* (/ 1 (hypot d c)) (- (* b c) (* a d))) (hypot d c)) |
| 83.0ms | (* (/ 1 (hypot d c)) (- (* b c) (* a d))) |
| 31.0ms | (hypot d c) |
| 26.0ms | (- (* b c) (* a d)) |
| 312.0ms | (* (- (* a d)) (/ 1 (hypot d c))) |
| 287.0ms | (* 1 (- (* (* b c) (* b c)) (* (* a d) (* a d)))) |
| 263.0ms | (* (/ 1 (hypot d c)) (- (pow (* b c) 3) (pow (* a d) 3))) |
| 236.0ms | (* (- (* a d)) (/ 1 (hypot d c))) |
| 207.0ms | (- (log (* (/ 1 (hypot d c)) (- (* b c) (* a d)))) (log (hypot d c))) |
10 alts after pruning (10 fresh and 0 done)
Merged error: 0.9b
32.1% (5.4b remaining)
Error of 7.1b against oracle of 1.7b and baseline of 9.6b
| 1.1s | 8441× | body | 80 | valid |