



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.4
Applied sqrt-prod22.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: 13.4s)Debug log
1 calls. Slowest were:
| 116.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:
| 10.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 5.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 119.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 75.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 58.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 37.0ms | (fma (* a -4) c (* b b)) |
34 calls. Slowest were:
| 699.0ms | (- (* (sqrt (fma (* a -4) c (* b b))) (sqrt (fma (* a -4) c (* b b)))) (* b b)) |
| 132.0ms | (- (pow (sqrt (fma (* a -4) c (* b b))) 3) (pow b 3)) |
| 120.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:
| 14.0ms | (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b)) |
| 10.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 7.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b))) |
4 calls. Slowest were:
| 137.0ms | (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b)) |
| 98.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b))) |
| 66.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 46.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
45 calls. Slowest were:
| 575.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))) |
| 86.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))) |
| 78.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:
| 10.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 10.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 2.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 68.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 58.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 47.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 44.0ms | (sqrt (fma (* a -4) c (* b b))) |
30 calls. Slowest were:
| 25.0ms | (sqrt (sqrt (fma (* a -4) c (* b b)))) |
| 25.0ms | (sqrt (sqrt (fma (* a -4) c (* b b)))) |
| 24.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:
| 5.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 51.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 47.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 45.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 41.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))))) |
| 26.0ms | (* (cbrt (sqrt (fma (* a -4) c (* b b)))) (cbrt (sqrt (fma (* a -4) c (* b b))))) |
| 26.0ms | (sqrt (sqrt (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