


Bits error versus a



Bits error versus b



Bits error versus c
Results
if b < 9.876540340758696e+57Initial program 15.5
Simplified15.5
rmApplied add-sqr-sqrt15.5
Applied sqrt-prod15.6
if 9.876540340758696e+57 < b Initial program 36.9
Simplified36.9
Taylor expanded around 0 5.2
rmApplied div-inv5.2
rmApplied add-sqr-sqrt5.2
Final simplification13.6
herbie shell --seed 2019010
(FPCore (a b c)
:name "jeff quadratic root 1"
(if (>= b 0) (/ (- (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)) (/ (* 2 c) (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))))))
Time bar (total: 19.5s)Debug log
| 96.0ms | (if (>= b 0) (/ (- (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)) (/ (* 2 c) (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))))) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 18.1b
Found 4 expressions with local error:
| 23.4b | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 23.4b | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 1.7b | (- (sqrt (+ (* (* -4 a) c) (* b b))) b) |
| 0.3b | (- (- b) (sqrt (+ (* (* -4 a) c) (* b b)))) |
| 12× | add-sqr-sqrt |
| 8× | *-un-lft-identity |
| 7× | sqrt-prod |
| 6× | add-log-exp |
| 6× | add-cube-cbrt |
| 4× | add-exp-log |
| 4× | sqrt-div |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 2× | difference-of-squares |
| 2× | flip-- |
| 2× | flip-+ |
| 2× | pow1/2 |
| 2× | flip3-- |
| 2× | flip3-+ |
| 2× | sub-neg |
| 2× | rem-sqrt-square |
| 1× | distribute-lft-out-- |
| 1× | diff-log |
| 1× | neg-sub0 |
| 1× | associate--l- |
| 30.0ms | (- (sqrt (+ (* (* -4 a) c) (* b b))) b) |
| 14.0ms | (- (- b) (sqrt (+ (* (* -4 a) c) (* b b)))) |
| 6.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 6.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 66.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 65.0ms | (- (sqrt (+ (* (* -4 a) c) (* b b))) b) |
| 62.0ms | (- (- b) (sqrt (+ (* (* -4 a) c) (* b b)))) |
| 53.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 253.0ms | (sqrt (- (* (* (* -4 a) c) (* (* -4 a) c)) (* (* b b) (* b b)))) |
| 202.0ms | (sqrt (- (* (* (* -4 a) c) (* (* -4 a) c)) (* (* b b) (* b b)))) |
| 182.0ms | (sqrt (+ (pow (* (* -4 a) c) 3) (pow (* b b) 3))) |
| 145.0ms | (sqrt (+ (pow (* (* -4 a) c) 3) (pow (* b b) 3))) |
| 88.0ms | (- (* 2 (/ (* a c) b)) (* 2 b)) |
7 alts after pruning (7 fresh and 0 done)
Merged error: 10.6b
Found 4 expressions with local error:
| 23.4b | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 1.7b | (- (sqrt (+ (* (* -4 a) c) (* b b))) b) |
| 0.2b | (+ (* (* -4 a) c) (* b b)) |
| 0.1b | (/ (* 2 c) (- (sqrt (+ (* (* -4 a) c) (* b b))) b)) |
| 8× | add-sqr-sqrt |
| 7× | add-cube-cbrt |
| 7× | *-un-lft-identity |
| 6× | add-log-exp |
| 6× | add-exp-log |
| 6× | add-cbrt-cube |
| 4× | pow1 |
| 3× | sqrt-prod |
| 3× | times-frac |
| 3× | associate-/r* |
| 2× | flip-- |
| 2× | flip-+ |
| 2× | associate-/r/ |
| 2× | sqrt-div |
| 2× | flip3-- |
| 2× | flip3-+ |
| 1× | associate-/l* |
| 1× | div-inv |
| 1× | div-exp |
| 1× | pow1/2 |
| 1× | frac-2neg |
| 1× | sub-neg |
| 1× | sum-log |
| 1× | clear-num |
| 1× | rem-sqrt-square |
| 1× | +-commutative |
| 1× | cbrt-undiv |
| 32.0ms | (/ (* 2 c) (- (sqrt (+ (* (* -4 a) c) (* b b))) b)) |
| 31.0ms | (- (sqrt (+ (* (* -4 a) c) (* b b))) b) |
| 8.0ms | (+ (* (* -4 a) c) (* b b)) |
| 6.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 154.0ms | (/ (* 2 c) (- (sqrt (+ (* (* -4 a) c) (* b b))) b)) |
| 57.0ms | (- (sqrt (+ (* (* -4 a) c) (* b b))) b) |
| 55.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 46.0ms | (+ (* (* -4 a) c) (* b b)) |
| 539.0ms | (/ (* (* (* 2 c) (* 2 c)) (* 2 c)) (* (* (- (sqrt (+ (* (* -4 a) c) (* b b))) b) (- (sqrt (+ (* (* -4 a) c) (* b b))) b)) (- (sqrt (+ (* (* -4 a) c) (* b b))) b))) |
| 223.0ms | (sqrt (- (* (* (* -4 a) c) (* (* -4 a) c)) (* (* b b) (* b b)))) |
| 208.0ms | (sqrt (+ (pow (* (* -4 a) c) 3) (pow (* b b) 3))) |
| 53.0ms | (+ (* (sqrt (+ (* (* -4 a) c) (* b b))) (sqrt (+ (* (* -4 a) c) (* b b)))) (+ (* b b) (* (sqrt (+ (* (* -4 a) c) (* b b))) b))) |
| 44.0ms | (- (pow b 2) (* 4 (* a c))) |
7 alts after pruning (7 fresh and 0 done)
Merged error: 10.6b
Found 4 expressions with local error:
| 23.4b | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 1.7b | (- (sqrt (+ (* (* -4 a) c) (* b b))) b) |
| 0.2b | (+ (* (* -4 a) c) (* b b)) |
| 0.1b | (* (* 2 c) (/ 1 (- (sqrt (+ (* (* -4 a) c) (* b b))) b))) |
| 8× | add-exp-log |
| 7× | add-sqr-sqrt |
| 6× | add-log-exp |
| 6× | add-cube-cbrt |
| 6× | associate-*r* |
| 6× | add-cbrt-cube |
| 6× | *-un-lft-identity |
| 6× | pow1 |
| 3× | sqrt-prod |
| 2× | flip-- |
| 2× | flip-+ |
| 2× | associate-/r/ |
| 2× | prod-exp |
| 2× | sqrt-div |
| 2× | flip3-- |
| 2× | flip3-+ |
| 1× | div-inv |
| 1× | cbrt-unprod |
| 1× | *-commutative |
| 1× | un-div-inv |
| 1× | associate-*r/ |
| 1× | pow-prod-down |
| 1× | associate-*l* |
| 1× | pow1/2 |
| 1× | sub-neg |
| 1× | sum-log |
| 1× | rec-exp |
| 1× | rem-sqrt-square |
| 1× | +-commutative |
| 21.0ms | (- (sqrt (+ (* (* -4 a) c) (* b b))) b) |
| 10.0ms | (* (* 2 c) (/ 1 (- (sqrt (+ (* (* -4 a) c) (* b b))) b))) |
| 7.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 4.0ms | (+ (* (* -4 a) c) (* b b)) |
| 163.0ms | (* (* 2 c) (/ 1 (- (sqrt (+ (* (* -4 a) c) (* b b))) b))) |
| 76.0ms | (- (sqrt (+ (* (* -4 a) c) (* b b))) b) |
| 54.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 43.0ms | (+ (* (* -4 a) c) (* b b)) |
| 485.0ms | (* (* (* (* 2 c) (* 2 c)) (* 2 c)) (* (* (/ 1 (- (sqrt (+ (* (* -4 a) c) (* b b))) b)) (/ 1 (- (sqrt (+ (* (* -4 a) c) (* b b))) b))) (/ 1 (- (sqrt (+ (* (* -4 a) c) (* b b))) b)))) |
| 251.0ms | (sqrt (+ (pow (* (* -4 a) c) 3) (pow (* b b) 3))) |
| 202.0ms | (sqrt (- (* (* (* -4 a) c) (* (* -4 a) c)) (* (* b b) (* b b)))) |
| 121.0ms | (+ (log (* 2 c)) (log (/ 1 (- (sqrt (+ (* (* -4 a) c) (* b b))) b)))) |
| 110.0ms | (* (* 2 c) (/ 1 (- (sqrt (+ (* (* -4 a) c) (* b b))) b))) |
7 alts after pruning (6 fresh and 1 done)
Merged error: 10.6b
Found 4 expressions with local error:
| 23.4b | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 23.4b | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 9.7b | (- (* (sqrt (sqrt (+ (* (* -4 a) c) (* b b)))) (sqrt (sqrt (+ (* (* -4 a) c) (* b b))))) b) |
| 0.5b | (* (sqrt (sqrt (+ (* (* -4 a) c) (* b b)))) (sqrt (sqrt (+ (* (* -4 a) c) (* b b))))) |
| 28× | sqrt-div |
| 24× | sqrt-prod |
| 14× | add-sqr-sqrt |
| 12× | add-cube-cbrt |
| 12× | *-un-lft-identity |
| 9× | associate-*l* |
| 9× | associate-*r* |
| 9× | pow1 |
| 8× | flip-+ |
| 8× | flip3-+ |
| 6× | add-exp-log |
| 6× | pow1/2 |
| 6× | add-cbrt-cube |
| 4× | add-log-exp |
| 4× | frac-times |
| 2× | pow-prod-up |
| 2× | associate-*r/ |
| 2× | associate-*l/ |
| 2× | pow-prod-down |
| 2× | rem-sqrt-square |
| 1× | flip-- |
| 1× | cbrt-unprod |
| 1× | *-commutative |
| 1× | prod-exp |
| 1× | sqrt-unprod |
| 1× | flip3-- |
| 1× | pow-plus |
| 1× | rem-square-sqrt |
| 1× | sub-neg |
| 1× | pow2 |
| 26.0ms | (- (* (sqrt (sqrt (+ (* (* -4 a) c) (* b b)))) (sqrt (sqrt (+ (* (* -4 a) c) (* b b))))) b) |
| 16.0ms | (* (sqrt (sqrt (+ (* (* -4 a) c) (* b b)))) (sqrt (sqrt (+ (* (* -4 a) c) (* b b))))) |
| 7.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 6.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 65.0ms | (* (sqrt (sqrt (+ (* (* -4 a) c) (* b b)))) (sqrt (sqrt (+ (* (* -4 a) c) (* b b))))) |
| 63.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 52.0ms | (sqrt (+ (* (* -4 a) c) (* b b))) |
| 52.0ms | (- (* (sqrt (sqrt (+ (* (* -4 a) c) (* b b)))) (sqrt (sqrt (+ (* (* -4 a) c) (* b b))))) b) |
| 322.0ms | (* (sqrt (sqrt (+ (* (* (* -4 a) c) (* (* -4 a) c)) (- (* (* b b) (* b b)) (* (* (* -4 a) c) (* b b)))))) (sqrt (sqrt (+ (* (* (* -4 a) c) (* (* -4 a) c)) (- (* (* b b) (* b b)) (* (* (* -4 a) c) (* b b))))))) |
| 311.0ms | (sqrt (sqrt (+ (* (* (* -4 a) c) (* (* -4 a) c)) (- (* (* b b) (* b b)) (* (* (* -4 a) c) (* b b)))))) |
| 281.0ms | (* (sqrt (sqrt (+ (pow (* (* -4 a) c) 3) (pow (* b b) 3)))) (sqrt (sqrt (+ (* (* -4 a) c) (* b b))))) |
| 259.0ms | (* (sqrt (sqrt (+ (* (* (* -4 a) c) (* (* -4 a) c)) (- (* (* b b) (* b b)) (* (* (* -4 a) c) (* b b)))))) (sqrt (sqrt (- (* (* -4 a) c) (* b b))))) |
| 238.0ms | (* (sqrt (sqrt (+ (pow (* (* -4 a) c) 3) (pow (* b b) 3)))) (sqrt (sqrt (+ (pow (* (* -4 a) c) 3) (pow (* b b) 3))))) |
7 alts after pruning (5 fresh and 2 done)
Merged error: 10.6b
90.6% (0.8b remaining)
Error of 13.6b against oracle of 12.8b and baseline of 21.1b