



Bits error versus x




Bits error versus y
Results
| Original | 19.9 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 19.9
Simplified19.9
rmApplied add-sqr-sqrt19.9
Applied times-frac20.0
Simplified20.0
Simplified0.0
rmApplied associate-*l/0.0
Final simplification0.0
herbie shell --seed 2019010 +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
| 406.0ms | (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 19.5b
Found 2 expressions with local error:
| 19.5b | (/ (* (- 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 |
| 12.0ms | (/ (* (- x y) (+ y x)) (fma x x (* y y))) |
| 0.0ms | (fma x x (* y y)) |
| 53.0ms | (/ (* (- x y) (+ y x)) (fma x x (* y y))) |
| 31.0ms | (fma x x (* y y)) |
| 450.0ms | (* (- (* x x) (* y y)) (+ (pow y 3) (pow x 3))) |
| 300.0ms | (* (- (* x x) (* y y)) (- (* y y) (* x x))) |
| 293.0ms | (* (- (* x x) (* y y)) (+ y x)) |
| 281.0ms | (* (- x y) (+ (pow y 3) (pow x 3))) |
| 269.0ms | (* (- (pow x 3) (pow y 3)) (+ y x)) |
3 alts after pruning (3 fresh and 0 done)
Merged error: 0.0b
Found 3 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))) |
| 36× | times-frac |
| 33× | add-cube-cbrt |
| 33× | *-un-lft-identity |
| 33× | add-sqr-sqrt |
| 19× | add-exp-log |
| 19× | add-cbrt-cube |
| 13× | associate-*l* |
| 13× | associate-*r* |
| 6× | associate-/l* |
| 6× | div-exp |
| 6× | associate-/r* |
| 6× | cbrt-undiv |
| 5× | pow1 |
| 4× | associate-/l/ |
| 4× | div-inv |
| 4× | cbrt-unprod |
| 4× | prod-exp |
| 3× | add-log-exp |
| 3× | log1p-expm1-u |
| 3× | 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× | frac-times |
| 16.0ms | (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))) |
| 7.0ms | (/ (+ x y) (hypot x y)) |
| 6.0ms | (/ (- x y) (hypot x y)) |
| 78.0ms | (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))) |
| 58.0ms | (/ (- x y) (hypot x y)) |
| 53.0ms | (/ (+ x y) (hypot x y)) |
| 367.0ms | (+ (- (log (- x y)) (log (hypot x y))) (- (log (+ x y)) (log (hypot x y)))) |
| 342.0ms | (* (/ (- x y) (hypot x y)) (/ (+ x y) (hypot x y))) |
| 309.0ms | (/ (* (* (+ x y) (+ x y)) (+ x y)) (* (* (hypot x y) (hypot x y)) (hypot x y))) |
| 300.0ms | (* (/ (* (* (- x y) (- x y)) (- x y)) (* (* (hypot x y) (hypot x y)) (hypot x y))) (/ (* (* (+ x y) (+ x y)) (+ x y)) (* (* (hypot x y) (hypot x y)) (hypot x y)))) |
| 281.0ms | (+ (- (log (- x y)) (log (hypot x y))) (log (/ (+ x y) (hypot x y)))) |
3 alts after pruning (3 fresh and 0 done)
Merged error: 0b
Found 3 expressions with local error:
| 0.0b | (/ (+ x y) (hypot x y)) |
| 0.0b | (* (- x y) (/ (+ x y) (hypot x y))) |
| 0.0b | (/ (* (- x y) (/ (+ x y) (hypot x y))) (hypot x y)) |
| 21× | add-cube-cbrt |
| 21× | times-frac |
| 21× | *-un-lft-identity |
| 21× | add-sqr-sqrt |
| 19× | add-exp-log |
| 19× | add-cbrt-cube |
| 13× | associate-*r* |
| 7× | associate-/l/ |
| 6× | div-exp |
| 6× | associate-/r* |
| 6× | cbrt-undiv |
| 5× | pow1 |
| 4× | associate-/l* |
| 4× | flip-- |
| 4× | cbrt-unprod |
| 4× | prod-exp |
| 4× | associate-*l/ |
| 4× | flip3-- |
| 4× | frac-times |
| 3× | add-log-exp |
| 3× | div-inv |
| 3× | log1p-expm1-u |
| 3× | associate-*l* |
| 3× | expm1-log1p-u |
| 2× | associate-*r/ |
| 2× | frac-2neg |
| 2× | clear-num |
| 1× | flip-+ |
| 1× | *-commutative |
| 1× | pow-prod-down |
| 1× | flip3-+ |
| 9.0ms | (/ (* (- x y) (/ (+ x y) (hypot x y))) (hypot x y)) |
| 6.0ms | (/ (+ x y) (hypot x y)) |
| 5.0ms | (* (- x y) (/ (+ x y) (hypot x y))) |
| 60.0ms | (* (- x y) (/ (+ x y) (hypot x y))) |
| 57.0ms | (/ (+ x y) (hypot x y)) |
| 55.0ms | (/ (* (- x y) (/ (+ x y) (hypot x y))) (hypot x y)) |
| 337.0ms | (/ (* (* (+ x y) (+ x y)) (+ x y)) (* (* (hypot x y) (hypot x y)) (hypot x y))) |
| 315.0ms | (* (- (pow x 3) (pow y 3)) (+ x y)) |
| 306.0ms | (* (- (pow x 3) (pow y 3)) (+ x y)) |
| 269.0ms | (/ (* (* (* (- x y) (- x y)) (- x y)) (/ (* (* (+ x y) (+ x y)) (+ x y)) (* (* (hypot x y) (hypot x y)) (hypot x y)))) (* (* (hypot x y) (hypot x y)) (hypot x y))) |
| 248.0ms | (* (- (pow x 3) (pow y 3)) (/ (+ x y) (hypot x y))) |
3 alts after pruning (2 fresh and 1 done)
Merged error: 0b
Found 3 expressions with local error:
| 0.0b | (* (/ (- x y) (hypot x y)) (+ x y)) |
| 0.0b | (/ (- x y) (hypot x y)) |
| 0.0b | (/ (* (/ (- x y) (hypot x y)) (+ x y)) (hypot x y)) |
| 21× | add-cube-cbrt |
| 21× | times-frac |
| 21× | *-un-lft-identity |
| 21× | add-sqr-sqrt |
| 19× | add-exp-log |
| 19× | add-cbrt-cube |
| 13× | associate-*l* |
| 7× | associate-/l/ |
| 6× | div-exp |
| 6× | associate-/r* |
| 6× | cbrt-undiv |
| 5× | pow1 |
| 4× | associate-/l* |
| 4× | flip-+ |
| 4× | cbrt-unprod |
| 4× | associate-*r/ |
| 4× | prod-exp |
| 4× | flip3-+ |
| 4× | frac-times |
| 3× | add-log-exp |
| 3× | div-inv |
| 3× | log1p-expm1-u |
| 3× | associate-*r* |
| 3× | expm1-log1p-u |
| 2× | associate-*l/ |
| 2× | frac-2neg |
| 2× | clear-num |
| 1× | flip-- |
| 1× | *-commutative |
| 1× | pow-prod-down |
| 1× | div-sub |
| 1× | flip3-- |
| 1× | distribute-lft-in |
| 1× | distribute-rgt-in |
| 17.0ms | (/ (* (/ (- x y) (hypot x y)) (+ x y)) (hypot x y)) |
| 13.0ms | (* (/ (- x y) (hypot x y)) (+ x y)) |
| 9.0ms | (/ (- x y) (hypot x y)) |
| 76.0ms | (* (/ (- x y) (hypot x y)) (+ x y)) |
| 74.0ms | (/ (- x y) (hypot x y)) |
| 74.0ms | (/ (* (/ (- x y) (hypot x y)) (+ x y)) (hypot x y)) |
| 385.0ms | (* (/ (- x y) (hypot x y)) (+ x y)) |
| 318.0ms | (/ (* (/ (* (* (- x y) (- x y)) (- x y)) (* (* (hypot x y) (hypot x y)) (hypot x y))) (* (* (+ x y) (+ x y)) (+ x y))) (* (* (hypot x y) (hypot x y)) (hypot x y))) |
| 306.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))) |
| 289.0ms | (* (hypot x y) (+ (* x x) (- (* y y) (* x y)))) |
| 279.0ms | (* (- x y) (+ (pow x 3) (pow y 3))) |
3 alts after pruning (1 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