


Bits error versus a



Bits error versus b



Bits error versus c
if b < 7.319882445655832e-308Initial program 21.9
Initial simplification21.9
Taylor expanded around -inf 21.9
Simplified21.9
if 7.319882445655832e-308 < b < 3.1626152470538816e+114Initial program 34.0
Initial simplification34.0
rmApplied flip--34.1
Applied associate-/l/38.3
Simplified21.4
rmApplied times-frac8.9
Simplified8.9
rmApplied add-sqr-sqrt9.1
Applied fma-def9.0
if 3.1626152470538816e+114 < b Initial program 59.4
Initial simplification59.4
rmApplied flip--59.4
Applied associate-/l/59.5
Simplified33.3
rmApplied times-frac31.7
Simplified31.7
Taylor expanded around 0 1.8
Final simplification13.2
herbie shell --seed 2018360 +o rules:numerics
(FPCore (a b c)
:name "Quadratic roots, full range"
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))
Time bar (total: 13.5s)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 -4) c (* b b))) |
| 0.9b | (- (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:
| 15.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 14.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 77.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 63.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 47.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 35.0ms | (fma (* a -4) c (* b b)) |
34 calls. Slowest were:
| 469.0ms | (- (* (sqrt (fma (* a -4) c (* b b))) (sqrt (fma (* a -4) c (* b b)))) (* b b)) |
| 130.0ms | (- (pow (sqrt (fma (* a -4) c (* b b))) 3) (pow b 3)) |
| 107.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))) |
12 alts after pruning (12 fresh and 0 done)
Merged error: 20.9b
Found 4 expressions with local error:
| 22.5b | (sqrt (fma (* a -4) c (* b b))) |
| 13.3b | (/ (* (* a -4) c) (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b))) |
| 0.8b | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 0.1b | (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
4 calls. Slowest were:
| 18.0ms | (/ (* (* a -4) c) (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b))) |
| 15.0ms | (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 7.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
4 calls. Slowest were:
| 126.0ms | (/ (* (* a -4) c) (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b))) |
| 107.0ms | (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 58.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 50.0ms | (sqrt (fma (* a -4) c (* b b))) |
41 calls. Slowest were:
| 706.0ms | (- (log (* (* a -4) c)) (+ (log (* 2 a)) (log (+ (sqrt (fma (* a -4) c (* b b))) b)))) |
| 653.0ms | (/ (* (* (* (* a -4) c) (* (* a -4) c)) (* (* a -4) c)) (* (* (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b)) (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b))) (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b)))) |
| 634.0ms | (/ (* (* (* (* a -4) c) (* (* a -4) c)) (* (* a -4) c)) (* (* (* (* 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)))) |
10 alts after pruning (10 fresh and 0 done)
Merged error: 13.2b
Found 4 expressions with local error:
| 22.5b | (sqrt (fma (* a -4) c (* b b))) |
| 0.8b | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 0.1b | (/ c (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 0.0b | (fma (* a -4) c (* b b)) |
4 calls. Slowest were:
| 4.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 2.0ms | (/ c (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 175.0ms | (/ c (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 57.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 51.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 49.0ms | (fma (* a -4) c (* b b)) |
26 calls. Slowest were:
| 257.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))) |
| 50.0ms | (- (pow b 2) (* 4 (* a c))) |
| 34.0ms | (- (pow b 2) (* 4 (* a c))) |
9 alts after pruning (9 fresh and 0 done)
Merged error: 12.0b
Found 4 expressions with local error:
| 22.5b | (sqrt (fma (* a -4) c (* b b))) |
| 22.5b | (sqrt (fma (* a -4) c (* b b))) |
| 17.4b | (fma (sqrt (sqrt (fma (* a -4) c (* b b)))) (sqrt (sqrt (fma (* a -4) c (* b b)))) b) |
| 0.1b | (/ c (fma (sqrt (sqrt (fma (* a -4) c (* b b)))) (sqrt (sqrt (fma (* a -4) c (* b b)))) b)) |
4 calls. Slowest were:
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 0.0ms | (/ c (fma (sqrt (sqrt (fma (* a -4) c (* b b)))) (sqrt (sqrt (fma (* a -4) c (* b b)))) b)) |
4 calls. Slowest were:
| 319.0ms | (fma (sqrt (sqrt (fma (* a -4) c (* b b)))) (sqrt (sqrt (fma (* a -4) c (* b b)))) b) |
| 277.0ms | (/ c (fma (sqrt (sqrt (fma (* a -4) c (* b b)))) (sqrt (sqrt (fma (* a -4) c (* b b)))) b)) |
| 57.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 57.0ms | (sqrt (fma (* a -4) c (* b b))) |
23 calls. Slowest were:
| 229.0ms | (- (/ c b) (+ (* 1/4 (/ (pow (exp (* 1/4 (- (log -4) (+ (log (/ -1 c)) (log (/ -1 a)))))) 4) (* a b))) (/ (* c (pow (exp (* 1/4 (- (log -4) (+ (log (/ -1 c)) (log (/ -1 a)))))) 2)) (pow b 2)))) |
| 219.0ms | (+ (pow (exp (* 1/4 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) 2) b) |
| 188.0ms | (- (/ c b) (+ (/ (* (pow (exp (* 1/4 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) 2) c) (pow b 2)) (* 1/4 (/ (pow (exp (* 1/4 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) 4) (* a b))))) |
9 alts after pruning (8 fresh and 1 done)
Merged error: 12.0b
96.8% (0.5b remaining)
Error of 13.2b against oracle of 12.7b and baseline of 29.8b