



Bits error versus x




Bits error versus y
Results
| Original | 19.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 19.8
Simplified19.8
rmApplied add-sqr-sqrt19.8
Applied times-frac19.8
Simplified19.8
Simplified0.0
rmApplied add-log-exp0.0
Final simplification0.0
herbie shell --seed 2019022 +o rules:numerics
(FPCore (x y)
:name "Kahan p9 Example"
:pre (and (< 0 x 1) (< y 1))
:herbie-target
(if (< 0.5 (fabs (/ x y)) 2) (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) (- 1 (/ 2 (+ 1 (* (/ x y) (/ x y))))))
(/ (* (- x y) (+ x y)) (+ (* x x) (* y y))))
Time bar (total: 21.1s)Debug log
| 35.0ms | 256× | body | 80 | valid |
| 12.0ms | 256× | pre | 80 | true |
| 381.0ms | (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 19.0b
Found 2 expressions with local error:
| 19.0b | (/ (* (- x y) (+ y x)) (fma x x (* y y))) |
| 0.0b | (fma x x (* y y)) |
| 8× | associate-/l/ |
| 7× | add-exp-log |
| 7× | add-cbrt-cube |
| 4× | add-cube-cbrt |
| 4× | *-un-lft-identity |
| 4× | frac-times |
| 4× | add-sqr-sqrt |
| 3× | flip-- |
| 3× | flip-+ |
| 3× | flip3-- |
| 3× | times-frac |
| 3× | flip3-+ |
| 3× | associate-/r* |
| 2× | add-log-exp |
| 2× | log1p-expm1-u |
| 2× | associate-*r/ |
| 2× | associate-*l/ |
| 2× | div-exp |
| 2× | cbrt-undiv |
| 2× | pow1 |
| 2× | expm1-log1p-u |
| 1× | associate-/l* |
| 1× | div-inv |
| 1× | fma-udef |
| 1× | cbrt-unprod |
| 1× | prod-exp |
| 1× | frac-2neg |
| 1× | clear-num |
| 8.0ms | (/ (* (- x y) (+ y x)) (fma x x (* y y))) |
| 0.0ms | (fma x x (* y y)) |
| 57.0ms | (/ (* (- x y) (+ y x)) (fma x x (* y y))) |
| 30.0ms | (fma x x (* y y)) |
| 429.0ms | (* (- (* x x) (* y y)) (+ (pow y 3) (pow x 3))) |
| 283.0ms | (* (- x y) (+ (pow y 3) (pow x 3))) |
| 275.0ms | (* (- (* x x) (* y y)) (+ y x)) |
| 251.0ms | (/ (* (* (* (- x y) (- x y)) (- x y)) (* (* (+ y x) (+ y x)) (+ y x))) (* (* (fma x x (* y y)) (fma x x (* y y))) (fma x x (* y y)))) |
| 246.0ms | (* (- (* x x) (* y y)) (- (* y y) (* x x))) |
4 alts after pruning (4 fresh and 0 done)
Merged error: 0.0b
Found 4 expressions with local error:
| 0.0b | (/ (- x y) (hypot x y)) |
| 0.0b | (/ (+ x y) (hypot x y)) |
| 0.0b | (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))) |
| 0.0b | (hypot x y) |
| 36× | times-frac |
| 34× | add-cube-cbrt |
| 34× | *-un-lft-identity |
| 34× | add-sqr-sqrt |
| 20× | add-exp-log |
| 20× | add-cbrt-cube |
| 13× | associate-*l* |
| 13× | associate-*r* |
| 6× | associate-/l* |
| 6× | div-exp |
| 6× | associate-/r* |
| 6× | cbrt-undiv |
| 6× | pow1 |
| 4× | associate-/l/ |
| 4× | add-log-exp |
| 4× | div-inv |
| 4× | log1p-expm1-u |
| 4× | cbrt-unprod |
| 4× | prod-exp |
| 4× | expm1-log1p-u |
| 2× | frac-2neg |
| 2× | clear-num |
| 1× | flip-- |
| 1× | flip-+ |
| 1× | *-commutative |
| 1× | associate-*r/ |
| 1× | associate-*l/ |
| 1× | pow-prod-down |
| 1× | div-sub |
| 1× | flip3-- |
| 1× | flip3-+ |
| 1× | hypot-udef |
| 1× | frac-times |
| 7.0ms | (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))) |
| 3.0ms | (/ (+ x y) (hypot x y)) |
| 3.0ms | (/ (- x y) (hypot x y)) |
| 0.0ms | (hypot x y) |
| 69.0ms | (/ (+ x y) (hypot x y)) |
| 68.0ms | (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))) |
| 48.0ms | (/ (- x y) (hypot x y)) |
| 23.0ms | (hypot x y) |
| 322.0ms | (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))) |
| 263.0ms | (/ (* (* (+ x y) (+ x y)) (+ x y)) (* (* (hypot x y) (hypot x y)) (hypot x y))) |
| 220.0ms | (+ (- (log (- x y)) (log (hypot x y))) (- (log (+ x y)) (log (hypot x y)))) |
| 179.0ms | (+ (- (log (- x y)) (log (hypot x y))) (log (/ (+ x y) (hypot x y)))) |
| 175.0ms | (* (* (* (/ (- x y) (hypot x y)) (/ (- x y) (hypot x y))) (/ (- x y) (hypot x y))) (/ (* (* (+ x y) (+ x y)) (+ x y)) (* (* (hypot x y) (hypot x y)) (hypot x y)))) |
5 alts after pruning (5 fresh and 0 done)
Merged error: 0b
Found 4 expressions with local error:
| 0.0b | (/ (- x y) (hypot x y)) |
| 0.0b | (/ (+ x y) (hypot x y)) |
| 0.0b | (* (log (exp (/ (- x y) (hypot x y)))) (/ (+ x y) (hypot x y))) |
| 0.0b | (log (exp (/ (- x y) (hypot x y)))) |
| 45× | times-frac |
| 43× | add-cube-cbrt |
| 43× | *-un-lft-identity |
| 43× | add-sqr-sqrt |
| 28× | log-pow |
| 26× | exp-prod |
| 17× | associate-*l* |
| 13× | add-exp-log |
| 13× | associate-*r* |
| 13× | add-cbrt-cube |
| 8× | pow1 |
| 6× | associate-/l* |
| 6× | associate-/r* |
| 5× | div-inv |
| 4× | associate-/l/ |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | expm1-log1p-u |
| 3× | div-exp |
| 3× | log-prod |
| 3× | cbrt-undiv |
| 2× | cbrt-unprod |
| 2× | prod-exp |
| 2× | div-sub |
| 2× | frac-2neg |
| 2× | clear-num |
| 1× | flip-- |
| 1× | flip-+ |
| 1× | *-commutative |
| 1× | associate-*r/ |
| 1× | pow-prod-down |
| 1× | rem-log-exp |
| 1× | exp-diff |
| 1× | flip3-- |
| 1× | flip3-+ |
| 1× | log-div |
| 11.0ms | (* (log (exp (/ (- x y) (hypot x y)))) (/ (+ x y) (hypot x y))) |
| 9.0ms | (log (exp (/ (- x y) (hypot x y)))) |
| 4.0ms | (/ (- x y) (hypot x y)) |
| 4.0ms | (/ (+ x y) (hypot x y)) |
| 52.0ms | (/ (- x y) (hypot x y)) |
| 47.0ms | (/ (+ x y) (hypot x y)) |
| 46.0ms | (* (log (exp (/ (- x y) (hypot x y)))) (/ (+ x y) (hypot x y))) |
| 44.0ms | (log (exp (/ (- x y) (hypot x y)))) |
| 192.0ms | (/ (* (* (+ x y) (+ x y)) (+ x y)) (* (* (hypot x y) (hypot x y)) (hypot x y))) |
| 167.0ms | (* (log (exp (/ (- x y) (hypot x y)))) (/ (+ x y) (hypot x y))) |
| 138.0ms | (* (* (* (log (exp (/ (- x y) (hypot x y)))) (log (exp (/ (- x y) (hypot x y))))) (log (exp (/ (- x y) (hypot x y))))) (/ (* (* (+ x y) (+ x y)) (+ x y)) (* (* (hypot x y) (hypot x y)) (hypot x y)))) |
| 123.0ms | (+ (log (log (exp (/ (- x y) (hypot x y))))) (- (log (+ x y)) (log (hypot x y)))) |
| 107.0ms | (/ (* (* (- x y) (- x y)) (- x y)) (* (* (hypot x y) (hypot x y)) (hypot x y))) |
5 alts after pruning (4 fresh and 1 done)
Merged error: 0b
Found 4 expressions with local error:
| 0.0b | (* (cbrt (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y)))) (cbrt (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))))) |
| 0.0b | (/ (- x y) (hypot x y)) |
| 0.0b | (/ (- x y) (hypot x y)) |
| 0.0b | (/ (- x y) (hypot x y)) |
| 30× | add-cube-cbrt |
| 30× | *-un-lft-identity |
| 30× | add-sqr-sqrt |
| 27× | times-frac |
| 24× | cbrt-div |
| 17× | frac-times |
| 12× | add-exp-log |
| 11× | associate-*r/ |
| 11× | associate-*l/ |
| 10× | add-cbrt-cube |
| 9× | associate-/l* |
| 9× | associate-/r* |
| 9× | pow1 |
| 6× | associate-/l/ |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | associate-*l* |
| 4× | associate-*r* |
| 4× | pow1/3 |
| 4× | expm1-log1p-u |
| 3× | flip-- |
| 3× | div-inv |
| 3× | div-exp |
| 3× | div-sub |
| 3× | flip3-- |
| 3× | frac-2neg |
| 3× | clear-num |
| 3× | cbrt-undiv |
| 2× | pow-prod-up |
| 2× | pow-prod-down |
| 2× | cbrt-prod |
| 1× | cbrt-unprod |
| 1× | *-commutative |
| 1× | prod-exp |
| 1× | pow-plus |
| 1× | pow2 |
| 11.0ms | (* (cbrt (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y)))) (cbrt (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))))) |
| 4.0ms | (/ (- x y) (hypot x y)) |
| 2.0ms | (/ (- x y) (hypot x y)) |
| 2.0ms | (/ (- x y) (hypot x y)) |
| 208.0ms | (* (cbrt (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y)))) (cbrt (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))))) |
| 60.0ms | (/ (- x y) (hypot x y)) |
| 50.0ms | (/ (- x y) (hypot x y)) |
| 42.0ms | (/ (- x y) (hypot x y)) |
| 676.0ms | (* (cbrt (* (/ (- x y) (hypot x y)) (+ x y))) (cbrt (* (- x y) (/ (+ x y) (hypot x y))))) |
| 365.0ms | (* (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))) (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y)))) |
| 364.0ms | (* (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))) (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y)))) |
| 352.0ms | (cbrt (cbrt (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))))) |
| 342.0ms | (* (cbrt (* (/ (- x y) (hypot x y)) (+ x y))) (cbrt (* (/ (- x y) (hypot x y)) (+ x y)))) |
5 alts after pruning (3 fresh and 2 done)
Merged error: 0b
0% (0.0b remaining)
Error of 0.0b against oracle of 0.0b and baseline of 0.0b
| 845.0ms | 8000× | body | 80 | valid |
| 277.0ms | 8000× | pre | 80 | true |