



Bits error versus a




Bits error versus b




Bits error versus c
| Original | 33.1 |
|---|---|
| Target | 20.7 |
| Herbie | 17.5 |
if b < 4.107445960089145e-23Initial program 22.4
Simplified22.4
rmApplied add-sqr-sqrt22.6
Applied fma-neg22.5
if 4.107445960089145e-23 < b Initial program 54.3
Simplified54.3
rmApplied clear-num54.3
Taylor expanded around 0 7.6
Simplified7.6
Final simplification17.5
herbie shell --seed 2019005 +o rules:numerics
(FPCore (a b c)
:name "The quadratic formula (r1)"
:herbie-target
(if (< b 0) (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)) (/ c (* a (/ (- (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))
Time bar (total: 14.8s)Debug log
1 calls. Slowest were:
| 87.0ms | (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 32.1b
Found 4 expressions with local error:
| 23.2b | (sqrt (fma (* a -4) c (* b b))) |
| 1.1b | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 0.1b | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 0.0b | (fma (* a -4) c (* b b)) |
4 calls. Slowest were:
| 22.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 6.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 99.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 76.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 71.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 29.0ms | (fma (* a -4) c (* b b)) |
34 calls. Slowest were:
| 715.0ms | (- (* (sqrt (fma (* a -4) c (* b b))) (sqrt (fma (* a -4) c (* b b)))) (* b b)) |
| 93.0ms | (- (pow (sqrt (fma (* a -4) c (* b b))) 3) (pow b 3)) |
| 63.0ms | (/ (* (* (- (sqrt (fma (* a -4) c (* b b))) b) (- (sqrt (fma (* a -4) c (* b b))) b)) (- (sqrt (fma (* a -4) c (* b b))) b)) (* (* (* 2 a) (* 2 a)) (* 2 a))) |
12 alts after pruning (12 fresh and 0 done)
Merged error: 22.8b
Found 4 expressions with local error:
| 23.2b | (sqrt (fma (* a -4) c (* b b))) |
| 1.1b | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 0.2b | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b))) |
| 0.1b | (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b)) |
4 calls. Slowest were:
| 11.0ms | (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b)) |
| 10.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b))) |
| 9.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
4 calls. Slowest were:
| 142.0ms | (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b)) |
| 93.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b))) |
| 53.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 42.0ms | (sqrt (fma (* a -4) c (* b b))) |
45 calls. Slowest were:
| 632.0ms | (/ (* (* (* 2 a) (* 2 a)) (* 2 a)) (* (* (- (sqrt (fma (* a -4) c (* b b))) b) (- (sqrt (fma (* a -4) c (* b b))) b)) (- (sqrt (fma (* a -4) c (* b b))) b))) |
| 105.0ms | (+ (* (sqrt (fma (* a -4) c (* b b))) (sqrt (fma (* a -4) c (* b b)))) (+ (* b b) (* (sqrt (fma (* a -4) c (* b b))) b))) |
| 89.0ms | (+ (* (sqrt (fma (* a -4) c (* b b))) (sqrt (fma (* a -4) c (* b b)))) (+ (* b b) (* (sqrt (fma (* a -4) c (* b b))) b))) |
13 alts after pruning (13 fresh and 0 done)
Merged error: 13.7b
Found 4 expressions with local error:
| 23.2b | (sqrt (fma (* a -4) c (* b b))) |
| 23.2b | (sqrt (fma (* a -4) c (* b b))) |
| 1.1b | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 1.1b | (- (sqrt (fma (* a -4) c (* b b))) b) |
4 calls. Slowest were:
| 6.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 5.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 2.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 74.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 69.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 51.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 46.0ms | (sqrt (fma (* a -4) c (* b b))) |
30 calls. Slowest were:
| 29.0ms | (sqrt (* (cbrt (fma (* a -4) c (* b b))) (cbrt (fma (* a -4) c (* b b))))) |
| 28.0ms | (sqrt (* (cbrt (fma (* a -4) c (* b b))) (cbrt (fma (* a -4) c (* b b))))) |
| 27.0ms | (sqrt (* (cbrt (fma (* a -4) c (* b b))) (cbrt (fma (* a -4) c (* b b))))) |
13 alts after pruning (12 fresh and 1 done)
Merged error: 13.7b
Found 4 expressions with local error:
| 23.2b | (sqrt (fma (* a -4) c (* b b))) |
| 23.2b | (sqrt (fma (* a -4) c (* b b))) |
| 23.2b | (sqrt (fma (* a -4) c (* b b))) |
| 1.1b | (- (sqrt (fma (* a -4) c (* b b))) b) |
4 calls. Slowest were:
| 10.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 2.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 2.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 74.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 64.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 60.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 58.0ms | (sqrt (fma (* a -4) c (* b b))) |
29 calls. Slowest were:
| 27.0ms | (sqrt (* (cbrt (fma (* a -4) c (* b b))) (cbrt (fma (* a -4) c (* b b))))) |
| 27.0ms | (sqrt (* (cbrt (fma (* a -4) c (* b b))) (cbrt (fma (* a -4) c (* b b))))) |
| 27.0ms | (sqrt (* (cbrt (fma (* a -4) c (* b b))) (cbrt (fma (* a -4) c (* b b))))) |
13 alts after pruning (11 fresh and 2 done)
Merged error: 13.7b
78% (4.5b remaining)
Error of 17.5b against oracle of 13.1b and baseline of 33.4b