



Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus d
| Original | 25.5 |
|---|---|
| Target | 0.4 |
| Herbie | 13.1 |
if d < -4.0745539003521706e+83Initial program 37.0
Simplified37.0
rmApplied add-sqr-sqrt37.0
Applied *-un-lft-identity37.0
Applied times-frac37.0
Simplified37.0
Simplified23.7
rmApplied associate-*r/23.7
Taylor expanded around -inf 17.8
Simplified17.8
if -4.0745539003521706e+83 < d < 1.4791269730391837e+143Initial program 18.5
Simplified18.5
rmApplied add-sqr-sqrt18.5
Applied *-un-lft-identity18.5
Applied times-frac18.5
Simplified18.5
Simplified11.5
rmApplied associate-*r/11.5
if 1.4791269730391837e+143 < d Initial program 43.1
Simplified43.1
rmApplied add-sqr-sqrt43.1
Applied *-un-lft-identity43.1
Applied times-frac43.1
Simplified43.1
Simplified27.8
rmApplied associate-*l/27.7
Simplified27.7
Taylor expanded around 0 14.3
Final simplification13.1
herbie shell --seed 2019010 +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.2s)Debug log
| 14.0ms | (/ (+ (* a c) (* b d)) (+ (* c c) (* d d))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 25.3b
Found 2 expressions with local error:
| 25.3b | (/ (fma a c (* b d)) (fma d d (* c c))) |
| 0.0b | (fma d d (* c c)) |
| 10× | add-cube-cbrt |
| 10× | *-un-lft-identity |
| 10× | add-sqr-sqrt |
| 9× | times-frac |
| 4× | add-exp-log |
| 4× | add-cbrt-cube |
| 3× | associate-/l* |
| 3× | associate-/r* |
| 2× | add-log-exp |
| 2× | log1p-expm1-u |
| 2× | pow1 |
| 2× | expm1-log1p-u |
| 1× | div-inv |
| 1× | fma-udef |
| 1× | div-exp |
| 1× | frac-2neg |
| 1× | clear-num |
| 1× | cbrt-undiv |
| 4.0ms | (/ (fma a c (* b d)) (fma d d (* c c))) |
| 0.0ms | (fma d d (* c c)) |
| 54.0ms | (/ (fma a c (* b d)) (fma d d (* c c))) |
| 18.0ms | (fma d d (* c c)) |
| 194.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)))) |
| 31.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))))) |
| 24.0ms | (/ (sqrt (fma a c (* b d))) (* (cbrt (fma d d (* c c))) (cbrt (fma d d (* c c))))) |
| 23.0ms | (/ (* (cbrt (fma a c (* b d))) (cbrt (fma a c (* b d)))) 1) |
| 21.0ms | (/ (sqrt (fma a c (* b d))) (sqrt (fma d d (* c c)))) |
10 alts after pruning (9 fresh and 1 done)
Merged error: 16.0b
Found 4 expressions with local error:
| 15.8b | (/ (fma d b (* a c)) (hypot d c)) |
| 0.2b | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 0.0b | (/ 1 (hypot d c)) |
| 0.0b | (fma d b (* a 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× | associate-/r* |
| 4× | add-log-exp |
| 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× | cbrt-unprod |
| 2× | frac-2neg |
| 2× | clear-num |
| 2× | cbrt-undiv |
| 1× | inv-pow |
| 1× | pow-flip |
| 1× | fma-udef |
| 1× | *-commutative |
| 1× | associate-*r/ |
| 1× | associate-*l/ |
| 1× | pow-prod-down |
| 1× | frac-times |
| 6.0ms | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 4.0ms | (/ 1 (hypot d c)) |
| 3.0ms | (/ (fma d b (* a c)) (hypot d c)) |
| 0.0ms | (fma d b (* a c)) |
| 126.0ms | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 97.0ms | (/ (fma d b (* a c)) (hypot d c)) |
| 45.0ms | (fma d b (* a c)) |
| 33.0ms | (/ 1 (hypot d c)) |
| 578.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)))) |
| 371.0ms | (* (/ 1 (hypot d c)) (/ (fma d b (* a c)) (hypot d c))) |
| 147.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))) |
| 121.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)))) |
| 109.0ms | (* 1 (/ (fma d b (* a c)) (hypot d c))) |
10 alts after pruning (10 fresh and 0 done)
Merged error: 6.3b
Found 4 expressions with local error:
| 15.8b | (/ (fma c a (* b d)) (hypot d c)) |
| 0.1b | (/ (/ (fma c a (* b d)) (hypot d c)) (hypot d c)) |
| 0.0b | (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 |
| 2× | hypot-udef |
| 1× | associate-/l/ |
| 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 | (hypot d c) |
| 0.0ms | (hypot d c) |
| 108.0ms | (/ (/ (fma c a (* b d)) (hypot d c)) (hypot d c)) |
| 81.0ms | (/ (fma c a (* b d)) (hypot d c)) |
| 40.0ms | (hypot d c) |
| 39.0ms | (hypot d c) |
| 352.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))) |
| 224.0ms | (/ (/ (* (cbrt (fma c a (* b d))) (cbrt (fma c a (* b d)))) (* (cbrt (hypot d c)) (cbrt (hypot d c)))) 1) |
| 212.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))) |
| 161.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))) |
| 152.0ms | (/ (/ (* (cbrt (fma c a (* b d))) (cbrt (fma c a (* b d)))) 1) (* (cbrt (hypot d c)) (cbrt (hypot d c)))) |
9 alts after pruning (9 fresh and 0 done)
Merged error: 2.4b
Found 4 expressions with local error:
| 15.9b | (* (/ 1 (hypot d c)) (fma d b (* a c))) |
| 0.1b | (/ (* (/ 1 (hypot d c)) (fma d b (* a c))) (hypot d c)) |
| 0.0b | (/ 1 (hypot d c)) |
| 0.0b | (fma d b (* a c)) |
| 17× | add-exp-log |
| 11× | add-cbrt-cube |
| 9× | add-cube-cbrt |
| 9× | *-un-lft-identity |
| 9× | add-sqr-sqrt |
| 7× | pow1 |
| 6× | associate-/r* |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | prod-exp |
| 4× | associate-*l* |
| 4× | expm1-log1p-u |
| 3× | div-inv |
| 3× | fma-udef |
| 3× | associate-*r* |
| 3× | div-exp |
| 3× | times-frac |
| 3× | rec-exp |
| 2× | cbrt-unprod |
| 2× | associate-*l/ |
| 2× | frac-2neg |
| 2× | clear-num |
| 2× | cbrt-undiv |
| 1× | associate-/l/ |
| 1× | inv-pow |
| 1× | associate-/l* |
| 1× | pow-flip |
| 1× | *-commutative |
| 1× | pow-prod-down |
| 1× | distribute-lft-in |
| 1× | distribute-rgt-in |
| 9.0ms | (/ (* (/ 1 (hypot d c)) (fma d b (* a c))) (hypot d c)) |
| 5.0ms | (* (/ 1 (hypot d c)) (fma d b (* a c))) |
| 1.0ms | (/ 1 (hypot d c)) |
| 0.0ms | (fma d b (* a c)) |
| 101.0ms | (/ (* (/ 1 (hypot d c)) (fma d b (* a c))) (hypot d c)) |
| 84.0ms | (* (/ 1 (hypot d c)) (fma d b (* a c))) |
| 41.0ms | (fma d b (* a c)) |
| 26.0ms | (/ 1 (hypot d c)) |
| 791.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)))) |
| 197.0ms | (- (log (* (/ 1 (hypot d c)) (fma d b (* a c)))) (log (hypot d c))) |
| 167.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))) |
| 142.0ms | (* (/ 1 (hypot d c)) (fma d b (* a c))) |
| 119.0ms | (/ (* (* (* (/ 1 (hypot d c)) (fma d b (* a c))) (* (/ 1 (hypot d c)) (fma d b (* a c)))) (* (/ 1 (hypot d c)) (fma d b (* a c)))) (* (* (hypot d c) (hypot d c)) (hypot d c))) |
9 alts after pruning (8 fresh and 1 done)
Merged error: 2.4b
21.6% (10.9b remaining)
Error of 13.1b against oracle of 2.2b and baseline of 16.1b