



Bits error versus a




Bits error versus b




Bits error versus c
| Original | 32.7 |
|---|---|
| Target | 20.4 |
| Herbie | 12.9 |
if b < -1.02993411605426e-308Initial program 20.8
Simplified20.8
Taylor expanded around 0 20.8
Simplified20.8
if -1.02993411605426e-308 < b < 4.873574385931286e+105Initial program 31.6
Simplified31.6
rmApplied flip--31.6
Applied associate-/l/35.7
Simplified19.3
rmApplied times-frac14.5
Simplified8.8
rmApplied associate-*r/8.6
if 4.873574385931286e+105 < b Initial program 58.9
Simplified58.9
rmApplied flip--58.9
Applied associate-/l/59.1
Simplified32.1
rmApplied times-frac31.3
Simplified30.6
rmApplied associate-*r/30.6
Taylor expanded around 0 2.6
Final simplification12.9
herbie shell --seed 2019002 +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: 17.2s)Debug log
1 calls. Slowest were:
| 91.0ms | (/ (+ (- b) (sqrt (- (* b b) (* 4 (* a c))))) (* 2 a)) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 37.0b
Found 4 expressions with local error:
| 23.6b | (sqrt (fma (* a c) -4 (* b b))) |
| 1.3b | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.6b | (fma (* a c) -4 (* b b)) |
| 0.1b | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
4 calls. Slowest were:
| 13.0ms | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
| 6.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 1.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 75.0ms | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
| 69.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 55.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 43.0ms | (fma (* a c) -4 (* b b)) |
34 calls. Slowest were:
| 715.0ms | (- (* (sqrt (fma (* a c) -4 (* b b))) (sqrt (fma (* a c) -4 (* b b)))) (* b b)) |
| 106.0ms | (- (pow (sqrt (fma (* a c) -4 (* b b))) 3) (pow b 3)) |
| 95.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))) |
8 alts after pruning (8 fresh and 0 done)
Merged error: 22.1b
Found 4 expressions with local error:
| 23.6b | (sqrt (fma (* a c) -4 (* b b))) |
| 14.2b | (/ (* (* a c) -4) (* (* 2 a) (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 1.7b | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.6b | (fma (* a c) -4 (* b b)) |
4 calls. Slowest were:
| 19.0ms | (/ (* (* a c) -4) (* (* 2 a) (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 7.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 2.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 124.0ms | (/ (* (* a c) -4) (* (* 2 a) (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 67.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 66.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 29.0ms | (fma (* a c) -4 (* b b)) |
31 calls. Slowest were:
| 713.0ms | (/ (* (* (* (* a c) -4) (* (* a c) -4)) (* (* a c) -4)) (* (* (* (* 2 a) (+ (sqrt (fma (* a c) -4 (* b b))) b)) (* (* 2 a) (+ (sqrt (fma (* a c) -4 (* b b))) b))) (* (* 2 a) (+ (sqrt (fma (* a c) -4 (* b b))) b)))) |
| 674.0ms | (/ (* (* (* (* a c) -4) (* (* a c) -4)) (* (* a c) -4)) (* (* (* (* 2 a) (* 2 a)) (* 2 a)) (* (* (+ (sqrt (fma (* a c) -4 (* b b))) b) (+ (sqrt (fma (* a c) -4 (* b b))) b)) (+ (sqrt (fma (* a c) -4 (* b b))) b)))) |
| 570.0ms | (- (log (* (* a c) -4)) (+ (log (* 2 a)) (log (+ (sqrt (fma (* a c) -4 (* b b))) b)))) |
8 alts after pruning (8 fresh and 0 done)
Merged error: 13.3b
Found 4 expressions with local error:
| 23.6b | (sqrt (fma (* a c) -4 (* b b))) |
| 1.7b | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.6b | (fma (* a c) -4 (* b b)) |
| 0.2b | (* (* 1/2 c) (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
4 calls. Slowest were:
| 7.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 4.0ms | (* (* 1/2 c) (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 2.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 147.0ms | (* (* 1/2 c) (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 55.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 40.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 28.0ms | (fma (* a c) -4 (* b b)) |
31 calls. Slowest were:
| 566.0ms | (* (* (* (* 1/2 c) (* 1/2 c)) (* 1/2 c)) (* (* (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b)) (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b))) (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b)))) |
| 230.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))) |
| 120.0ms | (+ (log (* 1/2 c)) (log (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b)))) |
7 alts after pruning (7 fresh and 0 done)
Merged error: 11.4b
Found 4 expressions with local error:
| 23.6b | (sqrt (fma (* a c) -4 (* b b))) |
| 1.7b | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.6b | (fma (* a c) -4 (* b b)) |
| 0.0b | (/ (* (* 1/2 c) -4) (+ (sqrt (fma (* a c) -4 (* b b))) b)) |
4 calls. Slowest were:
| 9.0ms | (/ (* (* 1/2 c) -4) (+ (sqrt (fma (* a c) -4 (* b b))) b)) |
| 4.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 1.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 171.0ms | (/ (* (* 1/2 c) -4) (+ (sqrt (fma (* a c) -4 (* b b))) b)) |
| 62.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 42.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 36.0ms | (fma (* a c) -4 (* b b)) |
35 calls. Slowest were:
| 265.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))) |
| 132.0ms | (/ (* (* (* (* 1/2 c) -4) (* (* 1/2 c) -4)) (* (* 1/2 c) -4)) (* (* (+ (sqrt (fma (* a c) -4 (* b b))) b) (+ (sqrt (fma (* a c) -4 (* b b))) b)) (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 100.0ms | (- (log (* (* 1/2 c) -4)) (log (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
7 alts after pruning (6 fresh and 1 done)
Merged error: 11.4b
96.6% (0.6b remaining)
Error of 12.9b against oracle of 12.3b and baseline of 29.3b