



Bits error versus a




Bits error versus b




Bits error versus c
| Original | 33.5 |
|---|---|
| Target | 20.5 |
| Herbie | 16.4 |
if b < 1.9639198265054672e-73Initial program 21.1
Simplified21.1
if 1.9639198265054672e-73 < b Initial program 52.9
Simplified52.9
rmApplied *-un-lft-identity52.9
Applied associate-/l*52.9
Taylor expanded around 0 9.0
Simplified9.0
Final simplification16.4
herbie shell --seed 2019004 +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: 16.5s)Debug log
1 calls. Slowest were:
| 96.0ms | (/ (+ (- b) (sqrt (- (* b b) (* 4 (* a c))))) (* 2 a)) |
1 alts after pruning (1 fresh and 0 done)
Merged error: 32.6b
Found 4 expressions with local error:
| 22.0b | (sqrt (fma (* a c) -4 (* b b))) |
| 0.8b | (fma (* a c) -4 (* b b)) |
| 0.3b | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
| 0.0b | (- (sqrt (fma (* a c) -4 (* b b))) b) |
4 calls. Slowest were:
| 26.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:
| 119.0ms | (/ (- (sqrt (fma (* a c) -4 (* b b))) b) (* 2 a)) |
| 70.0ms | (- (sqrt (fma (* a c) -4 (* b b))) b) |
| 47.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 30.0ms | (fma (* a c) -4 (* b b)) |
34 calls. Slowest were:
| 672.0ms | (- (* (sqrt (fma (* a c) -4 (* b b))) (sqrt (fma (* a c) -4 (* b b)))) (* b b)) |
| 127.0ms | (- (pow (sqrt (fma (* a c) -4 (* b b))) 3) (pow b 3)) |
| 86.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))) |
9 alts after pruning (8 fresh and 1 done)
Merged error: 22.7b
Found 4 expressions with local error:
| 22.0b | (sqrt (fma (* a c) -4 (* b b))) |
| 0.8b | (fma (* a c) -4 (* b b)) |
| 0.4b | (/ (* 2 a) (- (sqrt (fma (* a c) -4 (* b b))) b)) |
| 0.2b | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a c) -4 (* b b))) b))) |
4 calls. Slowest were:
| 7.0ms | (/ (* 2 a) (- (sqrt (fma (* a c) -4 (* b b))) b)) |
| 4.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a c) -4 (* b b))) b))) |
| 1.0ms | (sqrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 161.0ms | (/ (* 2 a) (- (sqrt (fma (* a c) -4 (* b b))) b)) |
| 97.0ms | (/ 1 (/ (* 2 a) (- (sqrt (fma (* a c) -4 (* b b))) b))) |
| 49.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 44.0ms | (fma (* a c) -4 (* b b)) |
40 calls. Slowest were:
| 595.0ms | (/ (* (* (* 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))) |
| 138.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))) |
| 117.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))) |
11 alts after pruning (9 fresh and 2 done)
Merged error: 13.1b
Found 4 expressions with local error:
| 22.7b | (cbrt (fma a (* -4 c) (* b b))) |
| 22.7b | (cbrt (fma (* a c) -4 (* b b))) |
| 6.6b | (- (* (fabs (cbrt (fma a (* -4 c) (* b b)))) (sqrt (cbrt (fma (* a c) -4 (* b b))))) b) |
| 0.8b | (fma (* a c) -4 (* b b)) |
4 calls. Slowest were:
| 13.0ms | (- (* (fabs (cbrt (fma a (* -4 c) (* b b)))) (sqrt (cbrt (fma (* a c) -4 (* b b))))) b) |
| 1.0ms | (cbrt (fma a (* -4 c) (* b b))) |
| 1.0ms | (cbrt (fma (* a c) -4 (* b b))) |
4 calls. Slowest were:
| 279.0ms | (- (* (fabs (cbrt (fma a (* -4 c) (* b b)))) (sqrt (cbrt (fma (* a c) -4 (* b b))))) b) |
| 208.0ms | (cbrt (fma (* a c) -4 (* b b))) |
| 197.0ms | (cbrt (fma a (* -4 c) (* b b))) |
| 45.0ms | (fma (* a c) -4 (* b b)) |
19 calls. Slowest were:
| 222.0ms | (- (pow b 2/3) (* 4/3 (* (* a c) (pow (/ 1 (pow b 4)) 1/3)))) |
| 197.0ms | (exp (* 1/3 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) |
| 187.0ms | (exp (* 1/3 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) |
11 alts after pruning (8 fresh and 3 done)
Merged error: 13.1b
Found 4 expressions with local error:
| 22.0b | (sqrt (fma (* a c) -4 (* b b))) |
| 22.0b | (sqrt (fma (* a c) -4 (* b b))) |
| 21.1b | (fma (sqrt (sqrt (fma (* a c) -4 (* b b)))) (sqrt (sqrt (fma (* a c) -4 (* b b)))) (- b)) |
| 0.8b | (fma (* a c) -4 (* b b)) |
4 calls. Slowest were:
| 2.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 2.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:
| 299.0ms | (fma (sqrt (sqrt (fma (* a c) -4 (* b b)))) (sqrt (sqrt (fma (* a c) -4 (* b b)))) (- b)) |
| 72.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 67.0ms | (sqrt (fma (* a c) -4 (* b b))) |
| 47.0ms | (fma (* a c) -4 (* b b)) |
20 calls. Slowest were:
| 300.0ms | (- (pow (exp (* 1/4 (- (log -4) (+ (log (/ 1 a)) (log (/ 1 c)))))) 2) b) |
| 111.0ms | (- (pow (exp (* 1/4 (- (log -4) (+ (log (/ -1 c)) (log (/ -1 a)))))) 2) b) |
| 34.0ms | (- (pow b 2) (* 4 (* a c))) |
11 alts after pruning (7 fresh and 4 done)
Merged error: 13.1b
81.3% (3.9b remaining)
Error of 16.4b against oracle of 12.4b and baseline of 33.5b