
Results
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
| Original | 52.9% |
|---|---|
| Target | 70.6% |
| Herbie | 84.0% |
if b < -4.39999999999999995e-71Initial program 13.4%
Taylor expanded in b around -inf 82.0%
associate-*r/82.0%
neg-mul-182.0%
Simplified82.0%
if -4.39999999999999995e-71 < b < 3.8e14Initial program 79.6%
if 3.8e14 < b Initial program 66.1%
Taylor expanded in b around inf 98.8%
mul-1-neg98.8%
unsub-neg98.8%
Simplified98.8%
Final simplification85.5%
if b < -1.10000000000000001e-72Initial program 13.4%
Taylor expanded in b around -inf 82.0%
associate-*r/82.0%
neg-mul-182.0%
Simplified82.0%
if -1.10000000000000001e-72 < b < 1.65000000000000004e-21Initial program 76.9%
/-rgt-identity76.9%
metadata-eval76.9%
associate-/l*76.9%
associate-/r/76.9%
*-commutative76.9%
metadata-eval76.9%
metadata-eval76.9%
associate-*l/76.9%
associate-/r/76.9%
times-frac76.9%
*-commutative76.9%
times-frac76.9%
metadata-eval76.9%
associate-/r/76.9%
*-commutative76.9%
div-sub77.0%
Simplified76.9%
add-sqr-sqrt76.6%
pow276.6%
pow1/276.6%
sqrt-pow176.6%
metadata-eval76.6%
Applied egg-rr76.6%
Taylor expanded in b around 0 69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in c around 0 39.3%
+-commutative39.3%
*-commutative39.3%
log-prod65.9%
*-commutative65.9%
exp-to-pow69.7%
unpow269.7%
pow-sqr70.0%
metadata-eval70.0%
unpow1/270.0%
Simplified70.0%
if 1.65000000000000004e-21 < b Initial program 70.9%
Taylor expanded in b around inf 91.5%
+-commutative91.5%
*-commutative91.5%
fma-def91.5%
*-commutative91.5%
associate-/l*95.3%
Simplified95.3%
Final simplification82.1%
if b < -5.79999999999999995e-72Initial program 13.4%
Taylor expanded in b around -inf 82.0%
associate-*r/82.0%
neg-mul-182.0%
Simplified82.0%
if -5.79999999999999995e-72 < b < 2.05e-20Initial program 76.9%
/-rgt-identity76.9%
metadata-eval76.9%
associate-/l*76.9%
associate-/r/76.9%
*-commutative76.9%
metadata-eval76.9%
metadata-eval76.9%
associate-*l/76.9%
associate-/r/76.9%
times-frac76.9%
*-commutative76.9%
times-frac76.9%
metadata-eval76.9%
associate-/r/76.9%
*-commutative76.9%
div-sub77.0%
Simplified76.9%
add-sqr-sqrt76.6%
pow276.6%
pow1/276.6%
sqrt-pow176.6%
metadata-eval76.6%
Applied egg-rr76.6%
Taylor expanded in b around 0 69.7%
*-commutative69.7%
Simplified69.7%
Taylor expanded in c around 0 39.3%
+-commutative39.3%
*-commutative39.3%
log-prod65.9%
*-commutative65.9%
exp-to-pow69.7%
unpow269.7%
pow-sqr70.0%
metadata-eval70.0%
unpow1/270.0%
Simplified70.0%
if 2.05e-20 < b Initial program 70.9%
Taylor expanded in b around inf 95.3%
mul-1-neg95.3%
unsub-neg95.3%
Simplified95.3%
Final simplification82.1%
if b < -4.999999999999985e-310Initial program 29.9%
Taylor expanded in b around -inf 63.8%
associate-*r/63.8%
neg-mul-163.8%
Simplified63.8%
if -4.999999999999985e-310 < b Initial program 75.9%
Taylor expanded in b around inf 67.7%
mul-1-neg67.7%
unsub-neg67.7%
Simplified67.7%
Final simplification65.7%
if b < -1.50000000000000003e88Initial program 7.5%
Taylor expanded in b around inf 2.2%
+-commutative2.2%
*-commutative2.2%
fma-def2.2%
*-commutative2.2%
associate-/l*2.5%
Simplified2.5%
Taylor expanded in b around 0 27.1%
if -1.50000000000000003e88 < b Initial program 65.3%
Taylor expanded in b around inf 43.1%
associate-*r/43.1%
mul-1-neg43.1%
Simplified43.1%
Final simplification39.4%
if b < -3.4999999999999998e-305Initial program 29.3%
Taylor expanded in b around -inf 64.3%
associate-*r/64.3%
neg-mul-164.3%
Simplified64.3%
if -3.4999999999999998e-305 < b Initial program 76.1%
Taylor expanded in b around inf 66.8%
associate-*r/66.8%
mul-1-neg66.8%
Simplified66.8%
Final simplification65.5%
Initial program 52.0%
clear-num51.9%
associate-/r/51.9%
associate-/r*51.9%
metadata-eval51.9%
add-sqr-sqrt50.9%
cancel-sign-sub-inv50.9%
add-sqr-sqrt15.5%
sqrt-unprod29.0%
sqr-neg29.0%
sqrt-prod21.1%
add-sqr-sqrt35.5%
Applied egg-rr34.7%
Taylor expanded in b around -inf 2.4%
Final simplification2.4%
Initial program 52.0%
Taylor expanded in b around inf 32.4%
+-commutative32.4%
*-commutative32.4%
fma-def32.4%
*-commutative32.4%
associate-/l*33.7%
Simplified33.7%
Taylor expanded in b around 0 8.4%
Final simplification8.4%
herbie shell --seed 2023166
(FPCore (a b c)
:name "quadm (p42, negative)"
:precision binary64
:herbie-target
(if (< b 0.0) (/ c (* a (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))) (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))
(/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))