
Results
Herbie found 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
| Original | 52.8% |
|---|---|
| Target | 70.7% |
| Herbie | 84.6% |
if b < -5.00000000000000029e62Initial program 54.7%
neg-sub054.7%
associate-+l-54.7%
sub0-neg54.7%
neg-mul-154.7%
associate-*l/54.6%
*-commutative54.6%
associate-/r*54.6%
/-rgt-identity54.6%
metadata-eval54.6%
Simplified54.8%
Taylor expanded in b around -inf 90.1%
mul-1-neg90.1%
unsub-neg90.1%
Simplified90.1%
if -5.00000000000000029e62 < b < 9.60000000000000063e-39Initial program 78.1%
if 9.60000000000000063e-39 < b Initial program 14.8%
neg-sub014.8%
associate-+l-14.8%
sub0-neg14.8%
neg-mul-114.8%
associate-*l/14.8%
*-commutative14.8%
associate-/r*14.8%
/-rgt-identity14.8%
metadata-eval14.8%
Simplified14.8%
Taylor expanded in b around inf 93.1%
mul-1-neg93.1%
distribute-neg-frac93.1%
Simplified93.1%
Final simplification86.0%
if b < -2.2e-73Initial program 63.7%
neg-sub063.7%
associate-+l-63.7%
sub0-neg63.7%
neg-mul-163.7%
associate-*l/63.6%
*-commutative63.6%
associate-/r*63.6%
/-rgt-identity63.6%
metadata-eval63.6%
Simplified63.7%
Taylor expanded in b around -inf 82.2%
mul-1-neg82.2%
unsub-neg82.2%
Simplified82.2%
if -2.2e-73 < b < 2.99999999999999989e-38Initial program 75.7%
Taylor expanded in b around 0 71.0%
*-commutative71.0%
*-commutative71.0%
associate-*r*71.0%
Simplified71.0%
if 2.99999999999999989e-38 < b Initial program 14.8%
neg-sub014.8%
associate-+l-14.8%
sub0-neg14.8%
neg-mul-114.8%
associate-*l/14.8%
*-commutative14.8%
associate-/r*14.8%
/-rgt-identity14.8%
metadata-eval14.8%
Simplified14.8%
Taylor expanded in b around inf 93.1%
mul-1-neg93.1%
distribute-neg-frac93.1%
Simplified93.1%
Final simplification82.2%
if b < -4.999999999999985e-310Initial program 68.2%
neg-sub068.2%
associate-+l-68.2%
sub0-neg68.2%
neg-mul-168.2%
associate-*l/68.1%
*-commutative68.1%
associate-/r*68.1%
/-rgt-identity68.1%
metadata-eval68.1%
Simplified68.2%
Taylor expanded in b around -inf 64.0%
mul-1-neg64.0%
unsub-neg64.0%
Simplified64.0%
if -4.999999999999985e-310 < b Initial program 34.1%
neg-sub034.1%
associate-+l-34.1%
sub0-neg34.1%
neg-mul-134.1%
associate-*l/34.0%
*-commutative34.0%
associate-/r*34.0%
/-rgt-identity34.0%
metadata-eval34.0%
Simplified34.0%
Taylor expanded in b around inf 67.3%
mul-1-neg67.3%
distribute-neg-frac67.3%
Simplified67.3%
Final simplification65.6%
if b < 4.3000000000000001e-7Initial program 68.2%
neg-sub068.2%
associate-+l-68.2%
sub0-neg68.2%
neg-mul-168.2%
associate-*l/68.0%
*-commutative68.0%
associate-/r*68.0%
/-rgt-identity68.0%
metadata-eval68.0%
Simplified68.1%
Taylor expanded in b around -inf 47.3%
associate-*r/47.3%
mul-1-neg47.3%
Simplified47.3%
if 4.3000000000000001e-7 < b Initial program 11.6%
Taylor expanded in b around -inf 2.5%
Taylor expanded in c around inf 29.0%
Final simplification42.0%
if b < -4.999999999999985e-310Initial program 68.2%
neg-sub068.2%
associate-+l-68.2%
sub0-neg68.2%
neg-mul-168.2%
associate-*l/68.1%
*-commutative68.1%
associate-/r*68.1%
/-rgt-identity68.1%
metadata-eval68.1%
Simplified68.2%
Taylor expanded in b around -inf 63.7%
associate-*r/63.7%
mul-1-neg63.7%
Simplified63.7%
if -4.999999999999985e-310 < b Initial program 34.1%
neg-sub034.1%
associate-+l-34.1%
sub0-neg34.1%
neg-mul-134.1%
associate-*l/34.0%
*-commutative34.0%
associate-/r*34.0%
/-rgt-identity34.0%
metadata-eval34.0%
Simplified34.0%
Taylor expanded in b around inf 67.3%
mul-1-neg67.3%
distribute-neg-frac67.3%
Simplified67.3%
Final simplification65.4%
Initial program 51.8%
Taylor expanded in b around -inf 32.3%
Taylor expanded in c around inf 10.5%
Final simplification10.5%
herbie shell --seed 2023166
(FPCore (a b c)
:name "The quadratic formula (r1)"
:precision binary64
:herbie-target
(if (< b 0.0) (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)) (/ c (* a (/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))