



Bits error versus x




Bits error versus y
Results
| Original | 19.9 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 19.9
rmApplied add-sqr-sqrt19.9
Applied times-frac20.0
Simplified19.9
Simplified0.0
rmApplied *-un-lft-identity0.0
Applied associate-/l*0.0
Final simplification0.0
herbie shell --seed 2019016 +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: 18.2s)Debug log
| 256× | (pre true 80) |
| 256× | (body real 80) |
| 293.0ms | (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 20.3b
Found 2 expressions with local error:
| 20.3b | (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) |
| 0.0b | (+ (* x x) (* y y)) |
| 8× | associate-/l/ |
| 7× | add-exp-log |
| 7× | add-cbrt-cube |
| 5× | flip-+ |
| 5× | flip3-+ |
| 4× | add-log-exp |
| 4× | add-cube-cbrt |
| 4× | *-un-lft-identity |
| 4× | frac-times |
| 4× | add-sqr-sqrt |
| 3× | flip-- |
| 3× | flip3-- |
| 3× | times-frac |
| 3× | associate-/r* |
| 2× | log1p-expm1-u |
| 2× | associate-/r/ |
| 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× | cbrt-unprod |
| 1× | prod-exp |
| 1× | frac-2neg |
| 1× | fma-def |
| 1× | sum-log |
| 1× | clear-num |
| 1× | +-commutative |
| 17.0ms | (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) |
| 4.0ms | (+ (* x x) (* y y)) |
| 56.0ms | (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) |
| 26.0ms | (+ (* x x) (* y y)) |
| 371.0ms | (* (- (* x x) (* y y)) (+ (pow x 3) (pow y 3))) |
| 351.0ms | (/ (* (* (* (- x y) (- x y)) (- x y)) (* (* (+ x y) (+ x y)) (+ x y))) (* (* (+ (* x x) (* y y)) (+ (* x x) (* y y))) (+ (* x x) (* y y)))) |
| 316.0ms | (* (- (pow x 3) (pow y 3)) (+ x y)) |
| 285.0ms | (+ (* (* x x) (* x x)) (- (* (* y y) (* y y)) (* (* x x) (* y y)))) |
| 276.0ms | (/ (* (* (* (- x y) (+ x y)) (* (- x y) (+ x y))) (* (- x y) (+ x y))) (* (* (+ (* x x) (* y y)) (+ (* x x) (* y y))) (+ (* x x) (* y y)))) |
4 alts after pruning (4 fresh and 0 done)
Merged error: 0b
Found 3 expressions with local error:
| 0.0b | (/ (+ y x) (hypot x y)) |
| 0.0b | (* (/ (- x y) (hypot x y)) (/ (+ y x) (hypot x y))) |
| 0.0b | (/ (- 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 |
| 9.0ms | (* (/ (- x y) (hypot x y)) (/ (+ y x) (hypot x y))) |
| 7.0ms | (/ (+ y x) (hypot x y)) |
| 3.0ms | (/ (- x y) (hypot x y)) |
| 60.0ms | (/ (- x y) (hypot x y)) |
| 54.0ms | (* (/ (- x y) (hypot x y)) (/ (+ y x) (hypot x y))) |
| 54.0ms | (/ (+ y x) (hypot x y)) |
| 294.0ms | (* (/ (- x y) (hypot x y)) (/ (+ y x) (hypot x y))) |
| 280.0ms | (/ (* (* (+ y x) (+ y x)) (+ y x)) (* (* (hypot x y) (hypot x y)) (hypot x y))) |
| 275.0ms | (+ (- (log (- x y)) (log (hypot x y))) (- (log (+ y x)) (log (hypot x y)))) |
| 256.0ms | (* (* (* (/ (- x y) (hypot x y)) (/ (- x y) (hypot x y))) (/ (- x y) (hypot x y))) (/ (* (* (+ y x) (+ y x)) (+ y x)) (* (* (hypot x y) (hypot x y)) (hypot x y)))) |
| 233.0ms | (+ (- (log (- x y)) (log (hypot x y))) (log (/ (+ y x) (hypot x y)))) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 0b
Found 4 expressions with local error:
| 0.0b | (* (/ (- x y) (hypot x y)) (/ 1 (/ (hypot x y) (+ y x)))) |
| 0.0b | (/ (- x y) (hypot x y)) |
| 0.0b | (/ 1 (/ (hypot x y) (+ y x))) |
| 0.0b | (/ (hypot x y) (+ y x)) |
| 36× | times-frac |
| 35× | add-cube-cbrt |
| 35× | *-un-lft-identity |
| 35× | add-sqr-sqrt |
| 28× | add-exp-log |
| 21× | associate-/r* |
| 13× | associate-*l* |
| 13× | add-cbrt-cube |
| 8× | div-exp |
| 7× | pow1 |
| 6× | associate-/l* |
| 6× | div-inv |
| 6× | associate-/r/ |
| 6× | prod-exp |
| 6× | rec-exp |
| 5× | associate-*r* |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | expm1-log1p-u |
| 3× | frac-2neg |
| 3× | clear-num |
| 3× | cbrt-undiv |
| 2× | associate-/l/ |
| 2× | flip-+ |
| 2× | cbrt-unprod |
| 2× | flip3-+ |
| 1× | inv-pow |
| 1× | flip-- |
| 1× | pow-flip |
| 1× | *-commutative |
| 1× | un-div-inv |
| 1× | associate-*r/ |
| 1× | associate-*l/ |
| 1× | pow-prod-down |
| 1× | div-sub |
| 1× | flip3-- |
| 1× | frac-times |
| 14.0ms | (* (/ (- x y) (hypot x y)) (/ 1 (/ (hypot x y) (+ y x)))) |
| 7.0ms | (/ (hypot x y) (+ y x)) |
| 6.0ms | (/ (- x y) (hypot x y)) |
| 3.0ms | (/ 1 (/ (hypot x y) (+ y x))) |
| 71.0ms | (/ (hypot x y) (+ y x)) |
| 49.0ms | (/ 1 (/ (hypot x y) (+ y x))) |
| 49.0ms | (* (/ (- x y) (hypot x y)) (/ 1 (/ (hypot x y) (+ y x)))) |
| 43.0ms | (/ (- x y) (hypot x y)) |
| 423.0ms | (+ (- (log (- x y)) (log (hypot x y))) (log (/ 1 (/ (hypot x y) (+ y x))))) |
| 309.0ms | (+ (- (log (- x y)) (log (hypot x y))) (- (- (log (hypot x y)) (log (+ y x))))) |
| 239.0ms | (* (/ (- x y) (hypot x y)) (/ 1 (/ (hypot x y) (+ y x)))) |
| 200.0ms | (/ (* (* (hypot x y) (hypot x y)) (hypot x y)) (* (* (+ y x) (+ y x)) (+ y x))) |
| 160.0ms | (+ (log (/ (- x y) (hypot x y))) (log (/ 1 (/ (hypot x y) (+ y x))))) |
2 alts after pruning (1 fresh and 1 done)
Merged error: 0b
Found 2 expressions with local error:
| 20.3b | (/ (* (- x y) (+ x y)) (fma y y (* x x))) |
| 0.0b | (fma y y (* x x)) |
| 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 |
| 9.0ms | (/ (* (- x y) (+ x y)) (fma y y (* x x))) |
| 0.0ms | (fma y y (* x x)) |
| 47.0ms | (/ (* (- x y) (+ x y)) (fma y y (* x x))) |
| 32.0ms | (fma y y (* x x)) |
| 356.0ms | (* (- (* x x) (* y y)) (+ (pow x 3) (pow y 3))) |
| 240.0ms | (- (log (* (- x y) (+ x y))) (log (fma y y (* x x)))) |
| 219.0ms | (* (- x y) (+ (pow x 3) (pow y 3))) |
| 218.0ms | (* (- (pow x 3) (pow y 3)) (+ x y)) |
| 211.0ms | (* (- (pow x 3) (pow y 3)) (+ (pow x 3) (pow y 3))) |
2 alts after pruning (0 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
| 8000× | (pre true 80) |
| 8000× | (body real 80) |