


Bits error versus a



Bits error versus b



Bits error versus c
if b < -1.02993411605426e-308Initial program 20.8
Simplified20.8
rmApplied div-sub20.8
if -1.02993411605426e-308 < b < 4.873574385931286e+105Initial program 31.6
Simplified31.6
rmApplied flip--31.7
Applied associate-/l/35.7
Simplified19.3
rmApplied times-frac8.7
Simplified8.7
rmApplied associate-*r/8.7
if 4.873574385931286e+105 < b Initial program 58.9
Simplified58.9
rmApplied flip--58.9
Applied associate-/l/59.1
Simplified32.1
rmApplied times-frac30.6
Simplified30.6
Taylor expanded around 0 2.6
Final simplification12.9
herbie shell --seed 2019002 +o rules:numerics
(FPCore (a b c)
:name "Quadratic roots, full range"
(/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))
Time bar (total: 17.7s)Debug log
1 calls. Slowest were:
| 68.0ms | (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 37.0b
Found 3 expressions with local error:
| 23.6b | (sqrt (fma (* a -4) c (* b b))) |
| 1.3b | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 0.1b | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
3 calls. Slowest were:
| 10.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 5.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
3 calls. Slowest were:
| 86.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 68.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 50.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
31 calls. Slowest were:
| 716.0ms | (- (* (sqrt (fma (* a -4) c (* b b))) (sqrt (fma (* a -4) c (* b b)))) (* b b)) |
| 117.0ms | (- (pow (sqrt (fma (* a -4) c (* b b))) 3) (pow b 3)) |
| 86.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))) |
9 alts after pruning (9 fresh and 0 done)
Merged error: 22.1b
Found 4 expressions with local error:
| 23.6b | (sqrt (fma (* a -4) c (* b b))) |
| 14.2b | (/ (* (* a -4) c) (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b))) |
| 1.7b | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 0.1b | (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
4 calls. Slowest were:
| 19.0ms | (/ (* (* a -4) c) (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b))) |
| 17.0ms | (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 8.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
4 calls. Slowest were:
| 121.0ms | (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 116.0ms | (/ (* (* a -4) c) (* (* 2 a) (+ (sqrt (fma (* a -4) c (* b b))) b))) |
| 82.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 58.0ms | (sqrt (fma (* a -4) c (* b b))) |
41 calls. Slowest were:
| 751.0ms | (- (log (* (* a -4) c)) (+ (log (* 2 a)) (log (+ (sqrt (fma (* a -4) c (* b b))) b)))) |
| 713.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)))) |
| 710.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)))) |
8 alts after pruning (8 fresh and 0 done)
Merged error: 13.3b
Found 4 expressions with local error:
| 23.6b | (sqrt (fma (* a -4) c (* b b))) |
| 1.7b | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 0.0b | (/ c (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 0.0b | (* -2 (/ c (+ (sqrt (fma (* a -4) c (* b b))) b))) |
4 calls. Slowest were:
| 8.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 5.0ms | (/ c (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 3.0ms | (* -2 (/ c (+ (sqrt (fma (* a -4) c (* b b))) b))) |
4 calls. Slowest were:
| 173.0ms | (/ c (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 132.0ms | (* -2 (/ c (+ (sqrt (fma (* a -4) c (* b b))) b))) |
| 59.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 55.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
33 calls. Slowest were:
| 249.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))) |
| 215.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))) |
| 28.0ms | (- (sqrt (fma (* a -4) c (* 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 -4) c (* b b))) |
| 23.6b | (sqrt (fma (* a -4) c (* b b))) |
| 15.3b | (fma (sqrt (sqrt (fma (* a -4) c (* b b)))) (sqrt (sqrt (fma (* a -4) c (* b b)))) b) |
| 0.1b | (sqrt (sqrt (fma (* a -4) c (* b b)))) |
4 calls. Slowest were:
| 1.0ms | (sqrt (sqrt (fma (* a -4) c (* b b)))) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 317.0ms | (fma (sqrt (sqrt (fma (* a -4) c (* b b)))) (sqrt (sqrt (fma (* a -4) c (* b b)))) b) |
| 190.0ms | (sqrt (sqrt (fma (* a -4) c (* b b)))) |
| 56.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 45.0ms | (sqrt (fma (* a -4) c (* b b))) |
28 calls. Slowest were:
| 369.0ms | (+ (pow (exp (* 1/4 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) 2) b) |
| 198.0ms | (exp (* 1/4 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) |
| 121.0ms | (+ (pow (exp (* 1/4 (- (log -4) (+ (log (/ -1 c)) (log (/ -1 a)))))) 2) b) |
7 alts after pruning (6 fresh and 1 done)
Merged error: 11.4b
96.7% (0.6b remaining)
Error of 12.9b against oracle of 12.3b and baseline of 29.3b