


Bits error versus a



Bits error versus b



Bits error versus c
if b < -5.139372088040273e-292Initial program 21.0
Simplified21.0
rmApplied add-sqr-sqrt21.2
Applied fma-neg21.1
if -5.139372088040273e-292 < b < 1.4569203446844513e+101Initial program 32.1
Simplified32.1
rmApplied div-inv32.1
rmApplied flip--32.2
Applied associate-*l/32.2
Simplified16.3
Taylor expanded around inf 9.3
if 1.4569203446844513e+101 < b Initial program 58.9
Simplified58.9
rmApplied div-inv58.9
rmApplied flip--59.0
Applied associate-*l/59.0
Simplified30.1
Taylor expanded around inf 29.2
Taylor expanded around 0 3.0
Final simplification13.1
herbie shell --seed 2019008 +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.6s)Debug log
1 calls. Slowest were:
| 59.0ms | (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)) |
2 alts after pruning (2 fresh and 0 done)
Merged error: 34.5b
Found 4 expressions with local error:
| 23.3b | (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)) |
| 5.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 1.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 92.0ms | (/ (- (sqrt (fma (* a -4) c (* b b))) b) (* 2 a)) |
| 57.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 48.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 33.0ms | (fma (* a -4) c (* b b)) |
34 calls. Slowest were:
| 579.0ms | (- (* (sqrt (fma (* a -4) c (* b b))) (sqrt (fma (* a -4) c (* b b)))) (* b b)) |
| 148.0ms | (- (pow (sqrt (fma (* a -4) c (* b b))) 3) (pow b 3)) |
| 85.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))) |
11 alts after pruning (11 fresh and 0 done)
Merged error: 22.1b
Found 4 expressions with local error:
| 23.3b | (sqrt (fma (* a -4) c (* b b))) |
| 0.9b | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 0.2b | (* (- (sqrt (fma (* a -4) c (* b b))) b) (/ 1 (* 2 a))) |
| 0.0b | (fma (* a -4) c (* b b)) |
4 calls. Slowest were:
| 25.0ms | (* (- (sqrt (fma (* a -4) c (* b b))) b) (/ 1 (* 2 a))) |
| 14.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 2.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 99.0ms | (* (- (sqrt (fma (* a -4) c (* b b))) b) (/ 1 (* 2 a))) |
| 68.0ms | (- (sqrt (fma (* a -4) c (* b b))) b) |
| 66.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 48.0ms | (fma (* a -4) c (* b b)) |
39 calls. Slowest were:
| 320.0ms | (* (- (* (sqrt (fma (* a -4) c (* b b))) (sqrt (fma (* a -4) c (* b b)))) (* b b)) 1) |
| 283.0ms | (* (- (pow (sqrt (fma (* a -4) c (* b b))) 3) (pow b 3)) 1) |
| 239.0ms | (* (- (* (sqrt (fma (* a -4) c (* b b))) (sqrt (fma (* a -4) c (* b b)))) (* b b)) (/ 1 (* 2 a))) |
11 alts after pruning (11 fresh and 0 done)
Merged error: 21.4b
Found 4 expressions with local error:
| 23.3b | (sqrt (fma (* a -4) c (* b b))) |
| 15.2b | (* (* a (* c -4)) (/ 1/2 a)) |
| 0.8b | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 0.1b | (/ (* (* a (* c -4)) (/ 1/2 a)) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
4 calls. Slowest were:
| 11.0ms | (/ (* (* a (* c -4)) (/ 1/2 a)) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 5.0ms | (* (* a (* c -4)) (/ 1/2 a)) |
| 4.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
4 calls. Slowest were:
| 126.0ms | (/ (* (* a (* c -4)) (/ 1/2 a)) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 79.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 66.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 10.0ms | (* (* a (* c -4)) (/ 1/2 a)) |
45 calls. Slowest were:
| 263.0ms | (/ (* (* (* (* a (* c -4)) (/ 1/2 a)) (* (* a (* c -4)) (/ 1/2 a))) (* (* a (* c -4)) (/ 1/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))) |
| 248.0ms | (/ (* (* (* (* a (* c -4)) (* a (* c -4))) (* a (* c -4))) (* (* (/ 1/2 a) (/ 1/2 a)) (/ 1/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))) |
| 226.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))) |
11 alts after pruning (11 fresh and 0 done)
Merged error: 16.4b
Found 4 expressions with local error:
| 23.3b | (sqrt (fma (* a -4) c (* b b))) |
| 0.8b | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 0.1b | (/ (* -2 c) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 0.0b | (fma (* a -4) c (* b b)) |
4 calls. Slowest were:
| 12.0ms | (/ (* -2 c) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 8.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 2.0ms | (sqrt (fma (* a -4) c (* b b))) |
4 calls. Slowest were:
| 145.0ms | (/ (* -2 c) (+ (sqrt (fma (* a -4) c (* b b))) b)) |
| 78.0ms | (+ (sqrt (fma (* a -4) c (* b b))) b) |
| 47.0ms | (sqrt (fma (* a -4) c (* b b))) |
| 31.0ms | (fma (* a -4) c (* b b)) |
34 calls. Slowest were:
| 253.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))) |
| 105.0ms | (/ (* (* (* -2 c) (* -2 c)) (* -2 c)) (* (* (+ (sqrt (fma (* a -4) c (* b b))) b) (+ (sqrt (fma (* a -4) c (* b b))) b)) (+ (sqrt (fma (* a -4) c (* b b))) b))) |
| 52.0ms | (- (log (* -2 c)) (log (+ (sqrt (fma (* a -4) c (* b b))) b))) |
10 alts after pruning (9 fresh and 1 done)
Merged error: 15.2b
95.8% (0.7b remaining)
Error of 13.1b against oracle of 12.4b and baseline of 28.9b