



Bits error versus a




Bits error versus b




Bits error versus c
| Original | 34.1 |
|---|---|
| Target | 21.5 |
| Herbie | 17.6 |
if b < 1.2612246360442721e-22Initial program 23.2
Simplified23.2
Taylor expanded around -inf 23.2
Simplified23.2
rmApplied *-un-lft-identity23.2
Applied associate-/l*23.3
if 1.2612246360442721e-22 < b Initial program 54.5
Simplified54.5
Taylor expanded around -inf 54.5
Simplified54.5
rmApplied *-un-lft-identity54.5
Applied associate-/l*54.5
Taylor expanded around 0 7.2
Simplified7.2
Final simplification17.6
herbie shell --seed 2019007 +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.4s)Debug log
1 calls. Slowest were:
| 63.0ms | (/ (+ (- b) (sqrt (- (* b b) (* 4 (* a c))))) (* 2 a)) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 34.1b
Found 4 expressions with local error:
| 24.1b | (sqrt (fma (* a c) -4 (* b b))) |
| 1.5b | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 1.2b | (fma (* a c) -4 (* b b)) |
| 0.1b | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
4 calls. Slowest were:
| 20.0ms | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
| 10.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 2.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 93.0ms | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
| 60.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 56.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 48.0ms | (fma (* a c) -4 (* b b)) |
34 calls. Slowest were:
| 674.0ms | (- (* (sqrt (fma (* a c) -4 (* b b))) (sqrt (fma (* a c) -4 (* b b)))) (* b b)) |
| 115.0ms | (- (pow (sqrt (fma (* a c) -4 (* b b))) 3) (pow b 3)) |
| 72.0ms | (- (log (- (sqrt (fma (* a c) -4 (* b b))) b)) (log (* 2 a))) |
13 alts after pruning (13 fresh and 0 done)
Merged error: 24.8b
Found 4 expressions with local error:
| 24.1b | (sqrt (fma (* a -4) c (* b b))) |
| 1.5b | (- (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:
| 20.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 10.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 2.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 114.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 70.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 68.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 36.0ms | (fma (* a -4) c (* b b)) |
34 calls. Slowest were:
| 647.0ms | (- (* (sqrt (fma (* a -4) c (* b b))) (sqrt (fma (* a -4) c (* b b)))) (* b b)) |
| 102.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))) |
| 97.0ms | (- (pow (sqrt (fma (* a -4) c (* b b))) 3) (pow b 3)) |
12 alts after pruning (12 fresh and 0 done)
Merged error: 24.8b
Found 4 expressions with local error:
| 24.1b | (sqrt (fma (* a -4) c (* b b))) |
| 1.5b | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 0.1b | (/ 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:
| 16.0ms | (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b)) |
| 5.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 4.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b))) |
4 calls. Slowest were:
| 144.0ms | (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b)) |
| 93.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a -4) c (* b b))) b))) |
| 73.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 64.0ms | (sqrt (fma (* a -4) c (* b b))) |
45 calls. Slowest were:
| 574.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))) |
| 87.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))) |
| 77.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))) |
11 alts after pruning (10 fresh and 1 done)
Merged error: 13.6b
Found 4 expressions with local error:
| 24.1b | (sqrt (fma (* a -4) c (* b b))) |
| 24.1b | (sqrt (fma (* a -4) c (* b b))) |
| 1.5b | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 1.5b | (- (sqrt (fma (* a -4) c (* b b))) b) |
4 calls. Slowest were:
| 5.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 5.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 74.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 71.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 52.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 44.0ms | (sqrt (fma (* a -4) c (* b b))) |
30 calls. Slowest were:
| 27.0ms | (sqrt (* (cbrt (fma (* a -4) c (* b b))) (cbrt (fma (* a -4) c (* b b))))) |
| 25.0ms | (sqrt (sqrt (fma (* a -4) c (* b b)))) |
| 25.0ms | (sqrt (sqrt (fma (* a -4) c (* b b)))) |
11 alts after pruning (9 fresh and 2 done)
Merged error: 13.6b
78.7% (4.5b remaining)
Error of 17.6b against oracle of 13.2b and baseline of 34.2b