



Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
| Original | 26.1 |
|---|---|
| Target | 0.4 |
| Herbie | 12.5 |
if c < -1.8506614466369815e+150Initial program 44.1
Simplified44.1
rmApplied add-sqr-sqrt44.1
Applied *-un-lft-identity44.1
Applied times-frac44.1
Simplified44.1
Simplified28.2
rmApplied associate-*l/28.1
Simplified28.1
Taylor expanded around -inf 13.3
Simplified13.3
if -1.8506614466369815e+150 < c < 6.560820932670249e+185Initial program 20.1
Simplified20.1
rmApplied add-sqr-sqrt20.1
Applied *-un-lft-identity20.1
Applied times-frac20.2
Simplified20.1
Simplified12.4
rmApplied associate-*l/12.2
Simplified12.2
rmApplied *-un-lft-identity12.2
Applied associate-/l*12.3
if 6.560820932670249e+185 < c Initial program 44.6
Simplified44.6
rmApplied add-sqr-sqrt44.6
Applied *-un-lft-identity44.6
Applied times-frac44.6
Simplified44.6
Simplified30.7
rmApplied associate-*l/30.7
Simplified30.7
Taylor expanded around inf 12.2
Final simplification12.5
herbie shell --seed 2019022 +o rules:numerics
(FPCore (a b c d)
:name "Complex division, real part"
:herbie-target
(if (< (fabs d) (fabs c)) (/ (+ a (* b (/ d c))) (+ c (* d (/ d c)))) (/ (+ b (* a (/ c d))) (+ d (* c (/ c d)))))
(/ (+ (* a c) (* b d)) (+ (* c c) (* d d))))
Time bar (total: 15.3s)Debug log
| 49.0ms | 270× | body | 80 | valid |
| 10.0ms | (/ (+ (* a c) (* b d)) (+ (* c c) (* d d))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 26.8b
Found 3 expressions with local error:
| 26.8b | (/ (fma a c (* b d)) (fma d d (* c c))) |
| 0.3b | (fma a c (* b 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-exp-log |
| 5× | add-cbrt-cube |
| 3× | add-log-exp |
| 3× | associate-/l* |
| 3× | log1p-expm1-u |
| 3× | associate-/r* |
| 3× | pow1 |
| 3× | expm1-log1p-u |
| 2× | fma-udef |
| 1× | div-inv |
| 1× | div-exp |
| 1× | frac-2neg |
| 1× | clear-num |
| 1× | cbrt-undiv |
| 3.0ms | (/ (fma a c (* b d)) (fma d d (* c c))) |
| 0.0ms | (fma a c (* b d)) |
| 0.0ms | (fma d d (* c c)) |
| 80.0ms | (/ (fma a c (* b d)) (fma d d (* c c))) |
| 39.0ms | (fma a c (* b d)) |
| 26.0ms | (fma d d (* c c)) |
| 203.0ms | (/ (* (* (fma a c (* b d)) (fma a c (* b d))) (fma a c (* b d))) (* (* (fma d d (* c c)) (fma d d (* c c))) (fma d d (* c c)))) |
| 33.0ms | (/ (* (cbrt (fma a c (* b d))) (cbrt (fma a c (* b d)))) (* (cbrt (fma d d (* c c))) (cbrt (fma d d (* c c))))) |
| 15.0ms | (/ (sqrt (fma a c (* b d))) (cbrt (fma d d (* c c)))) |
| 15.0ms | (/ (sqrt (fma a c (* b d))) (sqrt (fma d d (* c c)))) |
| 15.0ms | (/ (sqrt (fma a c (* b d))) (sqrt (fma d d (* c c)))) |
8 alts after pruning (7 fresh and 1 done)
Merged error: 16.4b
Found 4 expressions with local error:
| 16.2b | (/ (fma d b (* a c)) (hypot d c)) |
| 0.5b | (fma d b (* a c)) |
| 0.2b | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 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× | pow1 |
| 4× | add-log-exp |
| 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× | cbrt-unprod |
| 2× | rec-exp |
| 2× | cbrt-undiv |
| 1× | fma-udef |
| 1× | *-commutative |
| 1× | associate-*r/ |
| 1× | associate-*l/ |
| 1× | pow-prod-down |
| 1× | frac-2neg |
| 1× | clear-num |
| 1× | hypot-udef |
| 1× | frac-times |
| 5.0ms | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 3.0ms | (/ (fma d b (* a c)) (hypot d c)) |
| 0.0ms | (hypot d c) |
| 0.0ms | (fma d b (* a c)) |
| 121.0ms | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 84.0ms | (/ (fma d b (* a c)) (hypot d c)) |
| 43.0ms | (fma d b (* a c)) |
| 26.0ms | (hypot d c) |
| 472.0ms | (* (* (* (/ 1 (hypot d c)) (/ 1 (hypot d c))) (/ 1 (hypot d c))) (* (* (/ (fma d b (* a c)) (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) (/ (fma d b (* a c)) (hypot d c)))) |
| 224.0ms | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 137.0ms | (/ (* (* (fma d b (* a c)) (fma d b (* a c))) (fma d b (* a c))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
| 125.0ms | (* (* (* (/ 1 (hypot d c)) (/ 1 (hypot d c))) (/ 1 (hypot d c))) (/ (* (* (fma d b (* a c)) (fma d b (* a c))) (fma d b (* a c))) (* (* (hypot d c) (hypot d c)) (hypot d c)))) |
| 103.0ms | (+ (log (/ 1 (hypot d c))) (- (log (fma d b (* a c))) (log (hypot d c)))) |
12 alts after pruning (10 fresh and 2 done)
Merged error: 7.6b
Found 4 expressions with local error:
| 16.2b | (/ (fma c a (* b d)) (hypot d c)) |
| 0.3b | (fma c a (* b d)) |
| 0.1b | (/ (/ (fma c a (* b 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× | div-inv |
| 6× | associate-/r* |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | div-exp |
| 4× | cbrt-undiv |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 2× | frac-2neg |
| 2× | clear-num |
| 1× | associate-/l/ |
| 1× | fma-udef |
| 1× | hypot-udef |
| 6.0ms | (/ (/ (fma c a (* b d)) (hypot d c)) (hypot d c)) |
| 3.0ms | (/ (fma c a (* b d)) (hypot d c)) |
| 0.0ms | (fma c a (* b d)) |
| 0.0ms | (hypot d c) |
| 91.0ms | (/ (/ (fma c a (* b d)) (hypot d c)) (hypot d c)) |
| 80.0ms | (/ (fma c a (* b d)) (hypot d c)) |
| 38.0ms | (fma c a (* b d)) |
| 27.0ms | (hypot d c) |
| 287.0ms | (/ (/ (* (* (fma c a (* b d)) (fma c a (* b d))) (fma c a (* b d))) (* (* (hypot d c) (hypot d c)) (hypot d c))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
| 190.0ms | (/ (* (* (/ (fma c a (* b d)) (hypot d c)) (/ (fma c a (* b d)) (hypot d c))) (/ (fma c a (* b d)) (hypot d c))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
| 150.0ms | (/ (/ (* (cbrt (fma c a (* b d))) (cbrt (fma c a (* b d)))) (* (cbrt (hypot d c)) (cbrt (hypot d c)))) 1) |
| 148.0ms | (/ (* (* (fma c a (* b d)) (fma c a (* b d))) (fma c a (* b d))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
| 126.0ms | (/ (/ (* (cbrt (fma c a (* b d))) (cbrt (fma c a (* b d)))) 1) (* (cbrt (hypot d c)) (cbrt (hypot d c)))) |
10 alts after pruning (8 fresh and 2 done)
Merged error: 2.5b
Found 4 expressions with local error:
| 16.3b | (/ (hypot d c) (fma c a (* b d))) |
| 0.3b | (fma c a (* b d)) |
| 0.2b | (/ 1 (/ (hypot d c) (fma c a (* b d)))) |
| 0.1b | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (hypot d c)) |
| 33× | times-frac |
| 29× | add-cube-cbrt |
| 29× | *-un-lft-identity |
| 29× | add-sqr-sqrt |
| 19× | associate-/r* |
| 16× | add-exp-log |
| 8× | associate-/l* |
| 8× | div-inv |
| 8× | add-cbrt-cube |
| 6× | div-exp |
| 5× | associate-/r/ |
| 5× | pow1 |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | rec-exp |
| 4× | expm1-log1p-u |
| 3× | frac-2neg |
| 3× | clear-num |
| 2× | cbrt-undiv |
| 1× | associate-/l/ |
| 1× | inv-pow |
| 1× | pow-flip |
| 1× | fma-udef |
| 8.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (hypot d c)) |
| 5.0ms | (/ (hypot d c) (fma c a (* b d))) |
| 2.0ms | (/ 1 (/ (hypot d c) (fma c a (* b d)))) |
| 0.0ms | (fma c a (* b d)) |
| 108.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (hypot d c)) |
| 91.0ms | (/ 1 (/ (hypot d c) (fma c a (* b d)))) |
| 78.0ms | (/ (hypot d c) (fma c a (* b d))) |
| 29.0ms | (fma c a (* b d)) |
| 365.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (sqrt (hypot d c))) |
| 347.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (cbrt (hypot d c))) |
| 341.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (sqrt (hypot d c))) |
| 327.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (cbrt (hypot d c))) |
| 257.0ms | (/ (/ 1 (/ (hypot d c) (fma c a (* b d)))) (hypot d c)) |
10 alts after pruning (7 fresh and 3 done)
Merged error: 2.5b
28.9% (10.0b remaining)
Error of 12.5b against oracle of 2.5b and baseline of 16.5b
| 795.0ms | 8447× | body | 80 | valid |