



Bits error versus a




Bits error versus b




Bits error versus c
| Original | 33.5 |
|---|---|
| Target | 20.8 |
| Herbie | 13.3 |
if b < -7.012283951834148e-219Initial program 22.5
Initial simplification22.5
Taylor expanded around inf 22.5
Simplified22.4
if -7.012283951834148e-219 < b < 1.7747799476926007e+107Initial program 29.5
Initial simplification29.5
rmApplied flip--29.7
Applied associate-/l/34.5
Simplified21.6
rmApplied times-frac16.1
Simplified10.1
if 1.7747799476926007e+107 < b Initial program 59.1
Initial simplification59.1
rmApplied flip--59.2
Applied associate-/l/59.3
Simplified33.0
rmApplied times-frac31.7
Simplified31.1
Taylor expanded around 0 2.7
Final simplification13.3
herbie shell --seed 2018365 +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: 35.7b
Found 4 expressions with local error:
| 25.1b | (sqrt (fma (* a c) -4 (* b b))) |
| 1.2b | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.8b | (fma (* a c) -4 (* b b)) |
| 0.1b | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
4 calls. Slowest were:
| 19.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:
| 90.0ms | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
| 74.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 49.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 39.0ms | (fma (* a c) -4 (* b b)) |
34 calls. Slowest were:
| 729.0ms | (- (* (sqrt (fma (* a c) -4 (* b b))) (sqrt (fma (* a c) -4 (* b b)))) (* b b)) |
| 163.0ms | (- (pow (sqrt (fma (* a c) -4 (* b b))) 3) (pow b 3)) |
| 85.0ms | (- (log (- (sqrt (fma (* a c) -4 (* b b))) b)) (log (* 2 a))) |
8 alts after pruning (8 fresh and 0 done)
Merged error: 22.7b
Found 4 expressions with local error:
| 25.1b | (sqrt (fma (* a c) -4 (* b b))) |
| 17.5b | (/ (* (* a c) -4) (* (* 2 a) (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 1.2b | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.8b | (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:
| 141.0ms | (/ (* (* a c) -4) (* (* 2 a) (+ (sqrt (fma (* a c) -4 (* b b))) b))) |
| 82.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 56.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 35.0ms | (fma (* a c) -4 (* b b)) |
31 calls. Slowest were:
| 715.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)))) |
| 702.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)))) |
| 686.0ms | (- (log (* (* a c) -4)) (+ (log (* 2 a)) (log (+ (sqrt (fma (* a c) -4 (* b b))) b)))) |
10 alts after pruning (10 fresh and 0 done)
Merged error: 16.3b
Found 4 expressions with local error:
| 25.1b | (sqrt (fma (* a c) -4 (* b b))) |
| 1.2b | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 0.8b | (fma (* a c) -4 (* b b)) |
| 0.3b | (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b)) |
4 calls. Slowest were:
| 8.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 5.0ms | (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b)) |
| 2.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 147.0ms | (/ -4 (+ (sqrt (fma (* a c) -4 (* b b))) b)) |
| 55.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 45.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 39.0ms | (fma (* a c) -4 (* b b)) |
26 calls. Slowest were:
| 293.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))) |
| 32.0ms | (- (pow b 2) (* 4 (* a c))) |
| 30.0ms | (- (pow b 2) (* 4 (* a c))) |
10 alts after pruning (9 fresh and 1 done)
Merged error: 13.1b
Found 4 expressions with local error:
| 25.1b | (sqrt (fma (* a c) -4 (* b b))) |
| 25.1b | (sqrt (fma (* a c) -4 (* b b))) |
| 1.2b | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 1.2b | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
4 calls. Slowest were:
| 4.0ms | (+ (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:
| 78.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
| 69.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 63.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 61.0ms | (+ (sqrt (fma (* a c) -4 (* b b))) b) |
30 calls. Slowest were:
| 27.0ms | (sqrt (* (cbrt (fma (* a c) -4 (* b b))) (cbrt (fma (* a c) -4 (* b b))))) |
| 27.0ms | (sqrt (* (cbrt (fma (* a c) -4 (* b b))) (cbrt (fma (* a c) -4 (* b b))))) |
| 27.0ms | (* (cbrt (sqrt (fma (* a c) -4 (* b b)))) (cbrt (sqrt (fma (* a c) -4 (* b b))))) |
10 alts after pruning (8 fresh and 2 done)
Merged error: 13.1b
95.6% (0.7b remaining)
Error of 13.3b against oracle of 12.5b and baseline of 29.1b