



Bits error versus x




Bits error versus y
Results
| Original | 19.9 |
|---|---|
| Target | 0.1 |
| Herbie | 5.1 |
if y < -1.3646408840354792e+154Initial program 63.6
Taylor expanded around 0 0
if -1.3646408840354792e+154 < y < -7.692497260825509e-162Initial program 0.0
rmApplied clear-num0.0
if -7.692497260825509e-162 < y < 1.867899514340098e-177Initial program 30.4
Taylor expanded around inf 15.3
if 1.867899514340098e-177 < y Initial program 2.7
rmApplied add-sqr-sqrt2.7
Applied times-frac3.3
Final simplification5.1
herbie shell --seed 2019016
(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: 14.7s)Debug log
| 256× | (pre true 80) |
| 256× | (body real 80) |
| 265.0ms | (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) |
1 alts after pruning (1 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× | associate-/r/ |
| 2× | associate-*r/ |
| 2× | associate-*l/ |
| 2× | div-exp |
| 2× | cbrt-undiv |
| 2× | pow1 |
| 1× | associate-/l* |
| 1× | div-inv |
| 1× | cbrt-unprod |
| 1× | prod-exp |
| 1× | frac-2neg |
| 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))) |
| 25.0ms | (+ (* x x) (* y y)) |
| 375.0ms | (* (- (pow x 3) (pow y 3)) (+ (pow x 3) (pow y 3))) |
| 332.0ms | (* (- (* x x) (* y y)) (+ x y)) |
| 234.0ms | (* (- (* x x) (* y y)) (+ (pow x 3) (pow y 3))) |
| 206.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)))) |
| 201.0ms | (- (log (* (- x y) (+ x y))) (log (+ (* x x) (* y y)))) |
4 alts after pruning (4 fresh and 0 done)
Merged error: 0b
Found 0 expressions with local error:
4 alts after pruning (3 fresh and 1 done)
Merged error: 0b
Found 4 expressions with local error:
| 19.3b | (sqrt (+ (* x x) (* y y))) |
| 19.3b | (sqrt (+ (* x x) (* y y))) |
| 0.0b | (/ (+ x y) (sqrt (+ (* x x) (* y y)))) |
| 0.0b | (* (/ (- x y) (sqrt (+ (* x x) (* y y)))) (/ (+ x y) (sqrt (+ (* x x) (* y y))))) |
| 54× | times-frac |
| 49× | add-sqr-sqrt |
| 47× | add-cube-cbrt |
| 47× | *-un-lft-identity |
| 36× | sqrt-prod |
| 24× | associate-*l* |
| 24× | associate-*r* |
| 18× | add-exp-log |
| 18× | add-cbrt-cube |
| 10× | sqrt-div |
| 6× | flip-+ |
| 6× | associate-/r/ |
| 6× | flip3-+ |
| 6× | associate-/r* |
| 6× | pow1 |
| 5× | div-exp |
| 5× | cbrt-undiv |
| 4× | add-log-exp |
| 4× | cbrt-unprod |
| 4× | prod-exp |
| 3× | associate-/l* |
| 3× | div-inv |
| 2× | associate-/l/ |
| 2× | pow1/2 |
| 2× | rem-sqrt-square |
| 1× | *-commutative |
| 1× | associate-*r/ |
| 1× | associate-*l/ |
| 1× | pow-prod-down |
| 1× | frac-2neg |
| 1× | clear-num |
| 1× | frac-times |
| 12.0ms | (* (/ (- x y) (sqrt (+ (* x x) (* y y)))) (/ (+ x y) (sqrt (+ (* x x) (* y y))))) |
| 5.0ms | (/ (+ x y) (sqrt (+ (* x x) (* y y)))) |
| 2.0ms | (sqrt (+ (* x x) (* y y))) |
| 2.0ms | (sqrt (+ (* x x) (* y y))) |
| 56.0ms | (* (/ (- x y) (sqrt (+ (* x x) (* y y)))) (/ (+ x y) (sqrt (+ (* x x) (* y y))))) |
| 43.0ms | (/ (+ x y) (sqrt (+ (* x x) (* y y)))) |
| 37.0ms | (sqrt (+ (* x x) (* y y))) |
| 30.0ms | (sqrt (+ (* x x) (* y y))) |
| 370.0ms | (+ (- (log (- x y)) (log (sqrt (+ (* x x) (* y y))))) (- (log (+ x y)) (log (sqrt (+ (* x x) (* y y)))))) |
| 292.0ms | (+ (- (log (- x y)) (log (sqrt (+ (* x x) (* y y))))) (log (/ (+ x y) (sqrt (+ (* x x) (* y y)))))) |
| 268.0ms | (* (/ (- x y) (sqrt (+ (* x x) (* y y)))) (/ (+ x y) (sqrt (+ (* x x) (* y y))))) |
| 252.0ms | (/ (* (* (+ x y) (+ x y)) (+ x y)) (* (* (sqrt (+ (* x x) (* y y))) (sqrt (+ (* x x) (* y y)))) (sqrt (+ (* x x) (* y y))))) |
| 245.0ms | (* (/ (* (* (- x y) (- x y)) (- x y)) (* (* (sqrt (+ (* x x) (* y y))) (sqrt (+ (* x x) (* y y)))) (sqrt (+ (* x x) (* y y))))) (/ (* (* (+ x y) (+ x y)) (+ x y)) (* (* (sqrt (+ (* x x) (* y y))) (sqrt (+ (* x x) (* y y)))) (sqrt (+ (* x x) (* y y)))))) |
4 alts after pruning (2 fresh and 2 done)
Merged error: 0b
Found 3 expressions with local error:
| 20.3b | (/ (+ (* x x) (* y y)) (* (- x y) (+ x y))) |
| 0.0b | (+ (* x x) (* y y)) |
| 0.0b | (/ 1 (/ (+ (* x x) (* y y)) (* (- x y) (+ x y)))) |
| 17× | associate-/r/ |
| 16× | associate-/r* |
| 14× | add-exp-log |
| 8× | flip-+ |
| 8× | add-cbrt-cube |
| 8× | flip3-+ |
| 8× | frac-times |
| 7× | add-cube-cbrt |
| 7× | *-un-lft-identity |
| 7× | add-sqr-sqrt |
| 6× | flip-- |
| 6× | flip3-- |
| 6× | times-frac |
| 5× | add-log-exp |
| 4× | associate-*r/ |
| 4× | associate-*l/ |
| 4× | div-exp |
| 4× | pow1 |
| 3× | associate-/l* |
| 3× | div-inv |
| 3× | rec-exp |
| 2× | associate-/l/ |
| 2× | prod-exp |
| 2× | frac-2neg |
| 2× | clear-num |
| 2× | cbrt-undiv |
| 1× | inv-pow |
| 1× | pow-flip |
| 1× | cbrt-unprod |
| 1× | sum-log |
| 1× | +-commutative |
| 12.0ms | (/ (+ (* x x) (* y y)) (* (- x y) (+ x y))) |
| 4.0ms | (/ 1 (/ (+ (* x x) (* y y)) (* (- x y) (+ x y)))) |
| 2.0ms | (+ (* x x) (* y y)) |
| 42.0ms | (/ (+ (* x x) (* y y)) (* (- x y) (+ x y))) |
| 38.0ms | (/ 1 (/ (+ (* x x) (* y y)) (* (- x y) (+ x y)))) |
| 21.0ms | (+ (* x x) (* y y)) |
| 291.0ms | (/ (* (* (+ (* x x) (* y y)) (+ (* x x) (* y y))) (+ (* x x) (* y y))) (* (* (* (- x y) (+ x y)) (* (- x y) (+ x y))) (* (- x y) (+ x y)))) |
| 256.0ms | (/ (* (* (+ (* x x) (* y y)) (+ (* x x) (* y y))) (+ (* x x) (* y y))) (* (* (* (- x y) (- x y)) (- x y)) (* (* (+ x y) (+ x y)) (+ x y)))) |
| 157.0ms | (/ 1 (* (- x y) (+ x y))) |
| 148.0ms | (sqrt (/ (+ (* x x) (* y y)) (* (- x y) (+ x y)))) |
| 146.0ms | (* (+ x y) (+ (* x x) (- (* y y) (* x y)))) |
4 alts after pruning (1 fresh and 3 done)
Merged error: 0b
77.3% (4.7b remaining)
Error of 5.1b against oracle of 0.4b and baseline of 21.3b
| 8000× | (pre true 80) |
| 8000× | (body real 80) |