



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.6
if 4.107445960089145e-23 < b Initial program 54.3
Simplified54.3
rmApplied *-un-lft-identity54.3
Applied associate-/l*54.3
Taylor expanded around -inf 54.3
Simplified54.3
Taylor expanded around 0 7.6
Simplified7.6
Final simplification17.5
herbie shell --seed 2019005 +o rules:numerics
(FPCore (a b c)
:name "quadp (p42, positive)"
: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: 15.3s)Debug log
1 calls. Slowest were:
| 117.0ms | (/ (+ (- b) (sqrt (- (* b b) (* 4 (* a c))))) (* 2 a)) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 32.2b
Found 4 expressions with local error:
| 23.2b | (sqrt (fma (* a c) -4 (* b b))) |
| 1.1b | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.4b | (fma (* a c) -4 (* b b)) |
| 0.1b | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
4 calls. Slowest were:
| 12.0ms | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
| 10.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 1.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 87.0ms | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
| 65.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 45.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 29.0ms | (fma (* a c) -4 (* b b)) |
34 calls. Slowest were:
| 719.0ms | (- (* (sqrt (fma (* a c) -4 (* b b))) (sqrt (fma (* a c) -4 (* b b)))) (* b b)) |
| 118.0ms | (/ (* (* (- (sqrt (fma (* a c) -4 (* b b))) b) (- (sqrt (fma (* a c) -4 (* b b))) b)) (- (sqrt (fma (* a c) -4 (* b b))) b)) (* (* (* 2 a) (* 2 a)) (* 2 a))) |
| 97.0ms | (- (pow (sqrt (fma (* a c) -4 (* b b))) 3) (pow b 3)) |
12 alts after pruning (12 fresh and 0 done)
Merged error: 22.9b
Found 4 expressions with local error:
| 23.2b | (sqrt (fma (* a c) -4 (* b b))) |
| 1.1b | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.4b | (fma (* a c) -4 (* b b)) |
| 0.2b | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a c) -4 (* b b))) b))) |
4 calls. Slowest were:
| 12.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a c) -4 (* b b))) b))) |
| 9.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 2.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 71.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a c) -4 (* b b))) b))) |
| 67.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 60.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 37.0ms | (fma (* a c) -4 (* b b)) |
32 calls. Slowest were:
| 71.0ms | (+ (* (sqrt (fma (* a c) -4 (* b b))) (sqrt (fma (* a c) -4 (* b b)))) (+ (* b b) (* (sqrt (fma (* a c) -4 (* b b))) b))) |
| 41.0ms | (sqrt (/ (* 2 a) (- (sqrt (fma (* a c) -4 (* b b))) b))) |
| 39.0ms | (- (pow b 2) (* 4 (* a c))) |
13 alts after pruning (13 fresh and 0 done)
Merged error: 22.9b
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:
| 123.0ms | (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b)) |
| 104.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b))) |
| 73.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 70.0ms | (sqrt (fma (* a -4) c (* b b))) |
45 calls. Slowest were:
| 636.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))) |
| 113.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))) |
| 84.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 c) -4 (* b b))) |
| 23.2b | (sqrt (fma (* a c) -4 (* b b))) |
| 1.1b | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 1.1b | (- (sqrt (fma (* a c) -4 (* b b))) b) |
4 calls. Slowest were:
| 6.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 5.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 1.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 63.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 61.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 51.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 47.0ms | (sqrt (fma (* a c) -4 (* b b))) |
30 calls. Slowest were:
| 28.0ms | (sqrt (* (cbrt (fma (* a c) -4 (* b b))) (cbrt (fma (* a c) -4 (* b b))))) |
| 26.0ms | (sqrt (sqrt (fma (* a c) -4 (* b b)))) |
| 26.0ms | (sqrt (sqrt (fma (* a c) -4 (* b b)))) |
13 alts after pruning (12 fresh and 1 done)
Merged error: 13.7b
78% (4.5b remaining)
Error of 17.5b against oracle of 13.1b and baseline of 33.4b