


Bits error versus a



Bits error versus b



Bits error versus c
if b < 1.501809486178084e+23Initial program 15.5
Simplified15.5
rmApplied add-sqr-sqrt15.5
if 1.501809486178084e+23 < b Initial program 32.7
Simplified32.7
Taylor expanded around 0 6.3
Final simplification13.5
herbie shell --seed 2019022 +o rules:numerics
(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: 18.1s)Debug log
| 89.0ms | 281× | body | 80 | valid |
| 21.0ms | 96× | body | 80 | nan |
| 131.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.0b
Found 4 expressions with local error:
| 22.4b | (sqrt (fma c (* a -4) (* b b))) |
| 22.4b | (sqrt (fma c (* a -4) (* b b))) |
| 2.0b | (- (sqrt (fma c (* a -4) (* b b))) b) |
| 1.1b | (- (- b) (sqrt (fma c (* a -4) (* b b)))) |
| 29× | add-sqr-sqrt |
| 25× | *-un-lft-identity |
| 24× | prod-diff |
| 23× | add-cube-cbrt |
| 22× | sqrt-prod |
| 10× | fma-neg |
| 7× | neg-mul-1 |
| 6× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | add-exp-log |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 2× | difference-of-squares |
| 2× | flip-- |
| 2× | pow1/2 |
| 2× | flip3-- |
| 2× | sub-neg |
| 2× | rem-sqrt-square |
| 1× | distribute-lft-out-- |
| 1× | diff-log |
| 1× | neg-sub0 |
| 1× | associate--l- |
| 9.0ms | (- (sqrt (fma c (* a -4) (* b b))) b) |
| 9.0ms | (- (- b) (sqrt (fma c (* a -4) (* b b)))) |
| 4.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 1.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 64.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 54.0ms | (- (- b) (sqrt (fma c (* a -4) (* b b)))) |
| 52.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 49.0ms | (- (sqrt (fma c (* a -4) (* b b))) b) |
| 74.0ms | (fma 1 (- b) (- (* (sqrt (fma c (* a -4) (* b b))) (sqrt 1)))) |
| 72.0ms | (- (* 2 (/ (* a c) b)) (* 2 b)) |
| 62.0ms | (fma (sqrt (- b)) (sqrt (- b)) (- (* (sqrt (sqrt (fma c (* a -4) (* b b)))) (sqrt (sqrt (fma c (* a -4) (* b b))))))) |
| 57.0ms | (fma (- (sqrt (fma c (* a -4) (* b b)))) (sqrt 1) (* (sqrt (fma c (* a -4) (* b b))) (sqrt 1))) |
| 54.0ms | (fma -1 b (- (* (sqrt (fma c (* a -4) (* b b))) (sqrt 1)))) |
8 alts after pruning (8 fresh and 0 done)
Merged error: 10.3b
Found 4 expressions with local error:
| 22.4b | (sqrt (fma c (* a -4) (* b b))) |
| 22.4b | (sqrt (fma c (* a -4) (* b b))) |
| 22.4b | (sqrt (fma c (* a -4) (* b b))) |
| 12.8b | (- (- b) (* (sqrt (sqrt (fma c (* a -4) (* b b)))) (sqrt (sqrt (fma c (* a -4) (* b b)))))) |
| 13× | add-sqr-sqrt |
| 9× | sqrt-prod |
| 9× | add-cube-cbrt |
| 9× | *-un-lft-identity |
| 6× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | add-exp-log |
| 4× | prod-diff |
| 4× | fma-neg |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 3× | pow1/2 |
| 3× | rem-sqrt-square |
| 2× | neg-mul-1 |
| 1× | difference-of-squares |
| 1× | flip-- |
| 1× | diff-log |
| 1× | flip3-- |
| 1× | sub-neg |
| 1× | neg-sub0 |
| 1× | associate--l- |
| 7.0ms | (- (- b) (* (sqrt (sqrt (fma c (* a -4) (* b b)))) (sqrt (sqrt (fma c (* a -4) (* b b)))))) |
| 2.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 2.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 2.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 61.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 56.0ms | (- (- b) (* (sqrt (sqrt (fma c (* a -4) (* b b)))) (sqrt (sqrt (fma c (* a -4) (* b b)))))) |
| 55.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 51.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 99.0ms | (- (* 2 (/ (* a c) b)) (* 2 b)) |
| 69.0ms | (/ (exp (- b)) (exp (* (sqrt (sqrt (fma c (* a -4) (* b b)))) (sqrt (sqrt (fma c (* a -4) (* b b))))))) |
| 39.0ms | (fma -1 b (- (* (sqrt (sqrt (fma c (* a -4) (* b b)))) (sqrt (sqrt (fma c (* a -4) (* b b))))))) |
| 36.0ms | (* -2 (/ (* a c) b)) |
| 35.0ms | (fma (- (sqrt (sqrt (fma c (* a -4) (* b b))))) (sqrt (sqrt (fma c (* a -4) (* b b)))) (* (sqrt (sqrt (fma c (* a -4) (* b b)))) (sqrt (sqrt (fma c (* a -4) (* b b)))))) |
8 alts after pruning (7 fresh and 1 done)
Merged error: 10.3b
Found 4 expressions with local error:
| 23.1b | (cbrt (fma c (* a -4) (* b b))) |
| 23.1b | (cbrt (fma (* c -4) a (* b b))) |
| 22.4b | (sqrt (fma c (* a -4) (* b b))) |
| 7.2b | (- (* (fabs (cbrt (fma (* c -4) a (* b b)))) (sqrt (cbrt (fma c (* a -4) (* b b))))) b) |
| 8× | add-sqr-sqrt |
| 7× | add-cube-cbrt |
| 7× | *-un-lft-identity |
| 6× | cbrt-prod |
| 4× | add-log-exp |
| 4× | log1p-expm1-u |
| 4× | add-exp-log |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 3× | sqrt-prod |
| 2× | pow1/3 |
| 1× | flip-- |
| 1× | fma-neg |
| 1× | pow1/2 |
| 1× | flip3-- |
| 1× | sub-neg |
| 1× | rem-sqrt-square |
| 20.0ms | (- (* (fabs (cbrt (fma (* c -4) a (* b b)))) (sqrt (cbrt (fma c (* a -4) (* b b))))) b) |
| 1.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 1.0ms | (cbrt (fma c (* a -4) (* b b))) |
| 1.0ms | (cbrt (fma (* c -4) a (* b b))) |
| 228.0ms | (- (* (fabs (cbrt (fma (* c -4) a (* b b)))) (sqrt (cbrt (fma c (* a -4) (* b b))))) b) |
| 184.0ms | (cbrt (fma c (* a -4) (* b b))) |
| 163.0ms | (cbrt (fma (* c -4) a (* b b))) |
| 48.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 206.0ms | (- (pow b 2/3) (* 4/3 (* (* a c) (pow (/ 1 (pow b 4)) 1/3)))) |
| 182.0ms | (- (* (exp (* 1/6 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) (fabs (pow (fma (* -4 c) a (pow b 2)) 1/3))) b) |
| 161.0ms | (- (pow b 2/3) (* 4/3 (* (* a c) (pow (/ 1 (pow b 4)) 1/3)))) |
| 161.0ms | (exp (* 1/3 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) |
| 146.0ms | (- (* (fabs (pow (fma (* -4 c) a (pow b 2)) 1/3)) (pow b 1/3)) (+ (* 2/3 (* (* a (* (fabs (pow (fma (* -4 c) a (pow b 2)) 1/3)) c)) (pow (/ 1 (pow b 5)) 1/3))) b)) |
9 alts after pruning (7 fresh and 2 done)
Merged error: 10.3b
Found 4 expressions with local error:
| 23.1b | (cbrt (fma c (* a -4) (* b b))) |
| 23.1b | (cbrt (fma c (* a -4) (* b b))) |
| 22.4b | (sqrt (fma c (* a -4) (* b b))) |
| 9.1b | (- (- b) (* (sqrt (cbrt (fma c (* a -4) (* b b)))) (fabs (cbrt (fma c (* a -4) (* b b)))))) |
| 10× | add-sqr-sqrt |
| 9× | add-cube-cbrt |
| 9× | *-un-lft-identity |
| 6× | add-log-exp |
| 6× | cbrt-prod |
| 4× | log1p-expm1-u |
| 4× | add-exp-log |
| 4× | prod-diff |
| 4× | fma-neg |
| 4× | add-cbrt-cube |
| 4× | pow1 |
| 4× | expm1-log1p-u |
| 3× | sqrt-prod |
| 2× | pow1/3 |
| 2× | neg-mul-1 |
| 1× | flip-- |
| 1× | diff-log |
| 1× | pow1/2 |
| 1× | flip3-- |
| 1× | sub-neg |
| 1× | rem-sqrt-square |
| 1× | neg-sub0 |
| 1× | associate--l- |
| 8.0ms | (- (- b) (* (sqrt (cbrt (fma c (* a -4) (* b b)))) (fabs (cbrt (fma c (* a -4) (* b b)))))) |
| 2.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 1.0ms | (cbrt (fma c (* a -4) (* b b))) |
| 1.0ms | (cbrt (fma c (* a -4) (* b b))) |
| 224.0ms | (cbrt (fma c (* a -4) (* b b))) |
| 200.0ms | (cbrt (fma c (* a -4) (* b b))) |
| 84.0ms | (- (- b) (* (sqrt (cbrt (fma c (* a -4) (* b b)))) (fabs (cbrt (fma c (* a -4) (* b b)))))) |
| 48.0ms | (sqrt (fma c (* a -4) (* b b))) |
| 233.0ms | (- (pow b 2/3) (* 4/3 (* (* a c) (pow (/ 1 (pow b 4)) 1/3)))) |
| 207.0ms | (exp (* 1/3 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) |
| 198.0ms | (exp (* 1/3 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) |
| 189.0ms | (- (* 1/24 (* (fabs (pow (fma c (* -4 a) (pow b 2)) 1/3)) (* (pow b 2) (exp (* 1/6 (- (log -4) (+ (* 5 (log a)) (* 5 (log c))))))))) (+ (* (fabs (pow (fma c (* -4 a) (pow b 2)) 1/3)) (exp (* 1/6 (+ (log -4) (+ (log a) (log c)))))) b)) |
| 169.0ms | (- (pow b 2/3) (* 4/3 (* (* a c) (pow (/ 1 (pow b 4)) 1/3)))) |
9 alts after pruning (6 fresh and 3 done)
Merged error: 10.3b
84.2% (1.1b remaining)
Error of 13.5b against oracle of 12.4b and baseline of 19.3b
| 2.0s | 8730× | body | 80 | valid |
| 611.0ms | 2975× | body | 80 | nan |