



Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
Results
| Original | 25.8 |
|---|---|
| Target | 0.5 |
| Herbie | 12.7 |
if c < -1.28107214851456e+205Initial program 41.6
Simplified41.6
rmApplied add-sqr-sqrt41.6
Applied *-un-lft-identity41.6
Applied times-frac41.6
Simplified41.6
Simplified30.2
rmApplied associate-*l/30.1
Simplified30.1
Taylor expanded around -inf 11.0
Simplified11.0
if -1.28107214851456e+205 < c < 2.1659330210719858e+133Initial program 20.6
Simplified20.6
rmApplied add-sqr-sqrt20.6
Applied *-un-lft-identity20.6
Applied times-frac20.6
Simplified20.6
Simplified12.8
rmApplied associate-*l/12.7
Simplified12.7
if 2.1659330210719858e+133 < c Initial program 42.3
Simplified42.3
rmApplied add-sqr-sqrt42.3
Applied *-un-lft-identity42.3
Applied times-frac42.3
Simplified42.3
Simplified27.2
rmApplied associate-*l/27.2
Simplified27.2
Taylor expanded around inf 13.8
Final simplification12.7
herbie shell --seed 2019010 +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: 35.3s)Debug log
| 45.0ms | (/ (- (* b c) (* a d)) (+ (* c c) (* d d))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 24.4b
Found 3 expressions with local error:
| 24.4b | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 0.0b | (- (* 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 |
| 12.0ms | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 4.0ms | (- (* b c) (* a d)) |
| 0.0ms | (fma d d (* c c)) |
| 96.0ms | (/ (- (* b c) (* a d)) (fma d d (* c c))) |
| 40.0ms | (- (* b c) (* a d)) |
| 23.0ms | (fma d d (* c c)) |
| 616.0ms | (- (* (* b c) (* b c)) (* (* a d) (* a d))) |
| 293.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)))) |
| 209.0ms | (- (pow (* b c) 3) (pow (* a d) 3)) |
| 75.0ms | (/ (- (* b c) (* a d)) (sqrt (fma d d (* c c)))) |
| 75.0ms | (/ (- (* b c) (* a d)) (cbrt (fma d d (* c c)))) |
10 alts after pruning (10 fresh and 0 done)
Merged error: 14.7b
Found 4 expressions with local error:
| 14.4b | (/ (- (* b c) (* a d)) (hypot d c)) |
| 0.2b | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
| 0.0b | (/ 1 (hypot d c)) |
| 0.0b | (- (* b c) (* a d)) |
| 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 |
| 14.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)) |
| 2.0ms | (/ 1 (hypot d c)) |
| 141.0ms | (* (/ 1 (hypot d c)) (/ (- (* b c) (* a d)) (hypot d c))) |
| 128.0ms | (/ (- (* b c) (* a d)) (hypot d c)) |
| 45.0ms | (- (* b c) (* a d)) |
| 42.0ms | (/ 1 (hypot d c)) |
| 612.0ms | (- (* (* b c) (* b c)) (* (* a d) (* a d))) |
| 323.0ms | (* 1 (/ (- (* b c) (* a d)) (hypot d c))) |
| 272.0ms | (- (pow (* b c) 3) (pow (* a d) 3)) |
| 222.0ms | (/ (* (* (- (* b c) (* a d)) (- (* b c) (* a d))) (- (* b c) (* a d))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
| 178.0ms | (+ (log (/ 1 (hypot d c))) (log (/ (- (* b c) (* a d)) (hypot d c)))) |
12 alts after pruning (12 fresh and 0 done)
Merged error: 5.5b
Found 4 expressions with local error:
| 14.4b | (/ (- (* c b) (* a d)) (hypot d c)) |
| 0.1b | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 0.0b | (- (* c b) (* a d)) |
| 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 |
| 9.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) |
| 79.0ms | (/ (- (* c b) (* a d)) (hypot d c)) |
| 77.0ms | (/ (/ (- (* c b) (* a d)) (hypot d c)) (hypot d c)) |
| 39.0ms | (hypot d c) |
| 39.0ms | (- (* c b) (* a d)) |
| 540.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))) |
| 471.0ms | (- (* (* c b) (* c b)) (* (* a d) (* a d))) |
| 366.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))) |
| 300.0ms | (- (pow (* c b) 3) (pow (* a d) 3)) |
| 229.0ms | (/ (/ (* (cbrt (- (* c b) (* a d))) (cbrt (- (* c b) (* a d)))) (* (cbrt (hypot d c)) (cbrt (hypot d c)))) 1) |
11 alts after pruning (10 fresh and 1 done)
Merged error: 5.5b
Found 4 expressions with local error:
| 8.1b | (/ (- (* c b) (* a d)) (sqrt (hypot d c))) |
| 6.6b | (/ (/ (- (* c b) (* a d)) (sqrt (hypot d c))) (hypot d c)) |
| 0.3b | (/ 1 (sqrt (hypot d c))) |
| 0.3b | (* (/ 1 (sqrt (hypot d c))) (/ (/ (- (* c b) (* a d)) (sqrt (hypot d c))) (hypot d c))) |
| 276× | times-frac |
| 159× | add-cube-cbrt |
| 159× | *-un-lft-identity |
| 159× | add-sqr-sqrt |
| 78× | sqrt-prod |
| 70× | associate-*r* |
| 30× | add-exp-log |
| 25× | associate-/l* |
| 20× | add-cbrt-cube |
| 15× | associate-/r* |
| 12× | div-inv |
| 10× | div-exp |
| 7× | cbrt-undiv |
| 7× | pow1 |
| 6× | prod-exp |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | associate-*l* |
| 4× | rec-exp |
| 4× | expm1-log1p-u |
| 3× | associate-/l/ |
| 3× | cbrt-unprod |
| 3× | div-sub |
| 3× | frac-2neg |
| 3× | clear-num |
| 2× | pow-flip |
| 1× | inv-pow |
| 1× | flip-- |
| 1× | *-commutative |
| 1× | associate-*r/ |
| 1× | associate-*l/ |
| 1× | pow-prod-down |
| 1× | pow1/2 |
| 1× | flip3-- |
| 1× | frac-times |
| 10.0ms | (* (/ 1 (sqrt (hypot d c))) (/ (/ (- (* c b) (* a d)) (sqrt (hypot d c))) (hypot d c))) |
| 8.0ms | (/ (- (* c b) (* a d)) (sqrt (hypot d c))) |
| 8.0ms | (/ (/ (- (* c b) (* a d)) (sqrt (hypot d c))) (hypot d c)) |
| 1.0ms | (/ 1 (sqrt (hypot d c))) |
| 94.0ms | (/ (- (* c b) (* a d)) (sqrt (hypot d c))) |
| 93.0ms | (* (/ 1 (sqrt (hypot d c))) (/ (/ (- (* c b) (* a d)) (sqrt (hypot d c))) (hypot d c))) |
| 92.0ms | (/ (/ (- (* c b) (* a d)) (sqrt (hypot d c))) (hypot d c)) |
| 37.0ms | (/ 1 (sqrt (hypot d c))) |
| 483.0ms | (- (* (* c b) (* c b)) (* (* a d) (* a d))) |
| 306.0ms | (+ (log (/ 1 (sqrt (hypot d c)))) (- (log (/ (- (* c b) (* a d)) (sqrt (hypot d c)))) (log (hypot d c)))) |
| 264.0ms | (* 1 (/ (- (* c b) (* a d)) (sqrt (hypot d c)))) |
| 256.0ms | (/ (/ 1 (sqrt 1)) (* (cbrt (hypot d c)) (cbrt (hypot d c)))) |
| 207.0ms | (* 1 (/ (/ (- (* c b) (* a d)) (sqrt (hypot d c))) (hypot d c))) |
11 alts after pruning (9 fresh and 2 done)
Merged error: 5.5b
34.7% (7.0b remaining)
Error of 12.7b against oracle of 5.7b and baseline of 16.4b