



Bits error versus a




Bits error versus b




Bits error versus c
| Original | 34.2 |
|---|---|
| Target | 21.3 |
| Herbie | 13.2 |
if b < -1.249183367650486e-309Initial program 21.9
Initial simplification21.9
Taylor expanded around -inf 21.9
Simplified21.9
if -1.249183367650486e-309 < b < 7.357632498724412e+115Initial program 34.0
Initial simplification34.0
rmApplied flip--34.1
Applied associate-/l/38.3
Simplified21.4
rmApplied times-frac16.1
Simplified9.0
rmApplied associate-*r/8.9
if 7.357632498724412e+115 < b Initial program 59.5
Initial simplification59.5
rmApplied flip--59.6
Applied associate-/l/59.7
Simplified33.4
rmApplied times-frac32.4
Simplified31.9
Taylor expanded around 0 1.9
Final simplification13.2
herbie shell --seed 2018360 +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: 13.4s)Debug log
1 alts after pruning (1 fresh and 0 done)
Merged error: 34.6b
Found 4 expressions with local error:
| 22.5b | (sqrt (fma (* a c) -4 (* b b))) |
| 0.9b | (- (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)) |
| 5.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 1.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 101.0ms | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
| 79.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 70.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 32.0ms | (fma (* a c) -4 (* b b)) |
34 calls. Slowest were:
| 567.0ms | (- (* (sqrt (fma (* a c) -4 (* b b))) (sqrt (fma (* a c) -4 (* b b)))) (* b b)) |
| 157.0ms | (- (pow (sqrt (fma (* a c) -4 (* b b))) 3) (pow b 3)) |
| 121.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))) |
12 alts after pruning (12 fresh and 0 done)
Merged error: 20.9b
Found 4 expressions with local error:
| 22.5b | (sqrt (fma (* a c) -4 (* b b))) |
| 13.3b | (/ (* (* a c) -4) (* (* 2 a) (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 0.8b | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.4b | (fma (* a c) -4 (* b b)) |
4 calls. Slowest were:
| 9.0ms | (/ (* (* a c) -4) (* (* 2 a) (+ (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:
| 100.0ms | (/ (* (* a c) -4) (* (* 2 a) (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 48.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 42.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 29.0ms | (fma (* a c) -4 (* b b)) |
31 calls. Slowest were:
| 758.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)))) |
| 661.0ms | (- (log (* (* a c) -4)) (+ (log (* 2 a)) (log (+ (sqrt (fma (* a c) -4 (* b b))) b)))) |
| 565.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)))) |
11 alts after pruning (11 fresh and 0 done)
Merged error: 13.2b
Found 4 expressions with local error:
| 22.5b | (sqrt (fma (* a c) -4 (* b b))) |
| 0.8b | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.4b | (fma (* a c) -4 (* b b)) |
| 0.1b | (* (* 1/2 c) (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
4 calls. Slowest were:
| 8.0ms | (* (* 1/2 c) (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 8.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 6.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 154.0ms | (* (* 1/2 c) (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 68.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 59.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 48.0ms | (fma (* a c) -4 (* b b)) |
31 calls. Slowest were:
| 657.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)))) |
| 294.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))) |
| 103.0ms | (+ (log (* 1/2 c)) (log (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b)))) |
9 alts after pruning (9 fresh and 0 done)
Merged error: 12.0b
Found 4 expressions with local error:
| 22.5b | (sqrt (fma (* a c) -4 (* b b))) |
| 22.5b | (sqrt (fma (* a c) -4 (* b b))) |
| 17.4b | (fma (sqrt (sqrt (fma (* a c) -4 (* b b)))) (sqrt (sqrt (fma (* a c) -4 (* b b)))) b) |
| 0.4b | (fma (* a c) -4 (* b b)) |
4 calls. Slowest were:
| 1.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 1.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 0.0ms | (fma (sqrt (sqrt (fma (* a c) -4 (* b b)))) (sqrt (sqrt (fma (* a c) -4 (* b b)))) b) |
4 calls. Slowest were:
| 328.0ms | (fma (sqrt (sqrt (fma (* a c) -4 (* b b)))) (sqrt (sqrt (fma (* a c) -4 (* b b)))) b) |
| 50.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 44.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 39.0ms | (fma (* a c) -4 (* b b)) |
20 calls. Slowest were:
| 196.0ms | (+ (pow (exp (* 1/4 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) 2) b) |
| 126.0ms | (+ (pow (exp (* 1/4 (- (log -4) (+ (log (/ -1 c)) (log (/ -1 a)))))) 2) b) |
| 35.0ms | (- (pow b 2) (* 4 (* a c))) |
9 alts after pruning (8 fresh and 1 done)
Merged error: 12.0b
96.9% (0.5b remaining)
Error of 13.2b against oracle of 12.7b and baseline of 29.8b