
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Initial program 55.8%
add-log-exp51.1%
neg-mul-151.1%
fma-def51.1%
*-commutative51.1%
*-commutative51.1%
*-commutative51.1%
Applied egg-rr51.1%
add-log-exp55.8%
clear-num55.9%
Applied egg-rr55.9%
Taylor expanded in b around inf 91.6%
Simplified91.6%
Final simplification91.6%
Initial program 55.8%
add-log-exp51.1%
neg-mul-151.1%
fma-def51.1%
*-commutative51.1%
*-commutative51.1%
*-commutative51.1%
Applied egg-rr51.1%
Taylor expanded in b around inf 91.3%
+-commutative91.3%
mul-1-neg91.3%
unpow291.3%
unsub-neg91.3%
Simplified91.3%
Final simplification91.3%
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) < -5Initial program 87.0%
flip3-+87.1%
pow1/287.1%
pow-pow89.8%
*-commutative89.8%
*-commutative89.8%
metadata-eval89.8%
pow289.8%
Applied egg-rr89.8%
if -5 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) Initial program 52.8%
add-log-exp51.0%
neg-mul-151.0%
fma-def51.0%
*-commutative51.0%
*-commutative51.0%
*-commutative51.0%
Applied egg-rr51.0%
add-log-exp52.8%
clear-num52.8%
Applied egg-rr52.8%
Taylor expanded in b around inf 90.6%
+-commutative90.6%
associate-+r+90.6%
mul-1-neg90.6%
unsub-neg90.6%
associate-*r/90.6%
associate-/l*90.6%
distribute-rgt-out90.6%
metadata-eval90.6%
*-commutative90.6%
unpow290.6%
Simplified90.6%
Final simplification90.5%
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) < -5Initial program 87.0%
flip-+86.6%
pow286.6%
add-sqr-sqrt89.3%
*-commutative89.3%
*-commutative89.3%
*-commutative89.3%
*-commutative89.3%
Applied egg-rr89.3%
if -5 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) Initial program 52.8%
add-log-exp51.0%
neg-mul-151.0%
fma-def51.0%
*-commutative51.0%
*-commutative51.0%
*-commutative51.0%
Applied egg-rr51.0%
add-log-exp52.8%
clear-num52.8%
Applied egg-rr52.8%
Taylor expanded in b around inf 90.6%
+-commutative90.6%
associate-+r+90.6%
mul-1-neg90.6%
unsub-neg90.6%
associate-*r/90.6%
associate-/l*90.6%
distribute-rgt-out90.6%
metadata-eval90.6%
*-commutative90.6%
unpow290.6%
Simplified90.6%
Final simplification90.4%
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) < -5Initial program 87.0%
add-log-exp52.3%
neg-mul-152.3%
fma-def52.3%
*-commutative52.3%
*-commutative52.3%
*-commutative52.3%
Applied egg-rr52.3%
add-log-exp87.0%
clear-num87.0%
Applied egg-rr87.0%
div-inv87.1%
Applied egg-rr87.1%
if -5 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) Initial program 52.8%
add-log-exp51.0%
neg-mul-151.0%
fma-def51.0%
*-commutative51.0%
*-commutative51.0%
*-commutative51.0%
Applied egg-rr51.0%
add-log-exp52.8%
clear-num52.8%
Applied egg-rr52.8%
Taylor expanded in b around inf 90.6%
+-commutative90.6%
associate-+r+90.6%
mul-1-neg90.6%
unsub-neg90.6%
associate-*r/90.6%
associate-/l*90.6%
distribute-rgt-out90.6%
metadata-eval90.6%
*-commutative90.6%
unpow290.6%
Simplified90.6%
Final simplification90.2%
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) < -5Initial program 87.0%
*-commutative87.0%
+-commutative87.0%
unsub-neg87.0%
fma-neg87.0%
associate-*l*87.0%
*-commutative87.0%
distribute-rgt-neg-in87.0%
metadata-eval87.0%
Simplified87.0%
if -5 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) Initial program 52.8%
add-log-exp51.0%
neg-mul-151.0%
fma-def51.0%
*-commutative51.0%
*-commutative51.0%
*-commutative51.0%
Applied egg-rr51.0%
add-log-exp52.8%
clear-num52.8%
Applied egg-rr52.8%
Taylor expanded in b around inf 90.6%
+-commutative90.6%
associate-+r+90.6%
mul-1-neg90.6%
unsub-neg90.6%
associate-*r/90.6%
associate-/l*90.6%
distribute-rgt-out90.6%
metadata-eval90.6%
*-commutative90.6%
unpow290.6%
Simplified90.6%
Final simplification90.2%
if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) < -5Initial program 87.0%
add-log-exp52.3%
neg-mul-152.3%
fma-def52.3%
*-commutative52.3%
*-commutative52.3%
*-commutative52.3%
Applied egg-rr52.3%
add-log-exp87.0%
clear-num87.0%
Applied egg-rr87.0%
fma-udef87.0%
neg-mul-187.0%
Applied egg-rr87.0%
if -5 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) Initial program 52.8%
add-log-exp51.0%
neg-mul-151.0%
fma-def51.0%
*-commutative51.0%
*-commutative51.0%
*-commutative51.0%
Applied egg-rr51.0%
add-log-exp52.8%
clear-num52.8%
Applied egg-rr52.8%
Taylor expanded in b around inf 90.6%
+-commutative90.6%
associate-+r+90.6%
mul-1-neg90.6%
unsub-neg90.6%
associate-*r/90.6%
associate-/l*90.6%
distribute-rgt-out90.6%
metadata-eval90.6%
*-commutative90.6%
unpow290.6%
Simplified90.6%
Final simplification90.2%
if b < 5Initial program 81.7%
add-log-exp74.4%
neg-mul-174.4%
fma-def74.4%
*-commutative74.4%
*-commutative74.4%
*-commutative74.4%
Applied egg-rr74.4%
add-log-exp81.7%
clear-num81.7%
Applied egg-rr81.7%
fma-udef81.7%
neg-mul-181.7%
Applied egg-rr81.7%
if 5 < b Initial program 48.1%
add-log-exp44.1%
neg-mul-144.1%
fma-def44.1%
*-commutative44.1%
*-commutative44.1%
*-commutative44.1%
Applied egg-rr44.1%
add-log-exp48.1%
clear-num48.1%
Applied egg-rr48.1%
Taylor expanded in b around inf 87.4%
mul-1-neg87.4%
unsub-neg87.4%
Simplified87.4%
Final simplification86.1%
if b < 5Initial program 81.7%
/-rgt-identity81.7%
metadata-eval81.7%
associate-/l*81.7%
associate-*r/81.7%
+-commutative81.7%
unsub-neg81.7%
fma-neg81.8%
associate-*l*81.8%
*-commutative81.8%
distribute-rgt-neg-in81.8%
metadata-eval81.8%
associate-/r*81.8%
metadata-eval81.8%
metadata-eval81.8%
Simplified81.8%
fma-udef81.7%
*-commutative81.7%
Applied egg-rr81.7%
if 5 < b Initial program 48.1%
add-log-exp44.1%
neg-mul-144.1%
fma-def44.1%
*-commutative44.1%
*-commutative44.1%
*-commutative44.1%
Applied egg-rr44.1%
add-log-exp48.1%
clear-num48.1%
Applied egg-rr48.1%
Taylor expanded in b around inf 87.4%
mul-1-neg87.4%
unsub-neg87.4%
Simplified87.4%
Final simplification86.1%
if b < 5Initial program 81.7%
*-commutative81.7%
+-commutative81.7%
unsub-neg81.7%
fma-neg81.8%
associate-*l*81.8%
*-commutative81.8%
distribute-rgt-neg-in81.8%
metadata-eval81.8%
Simplified81.8%
fma-udef81.7%
*-commutative81.7%
Applied egg-rr81.7%
if 5 < b Initial program 48.1%
add-log-exp44.1%
neg-mul-144.1%
fma-def44.1%
*-commutative44.1%
*-commutative44.1%
*-commutative44.1%
Applied egg-rr44.1%
add-log-exp48.1%
clear-num48.1%
Applied egg-rr48.1%
Taylor expanded in b around inf 87.4%
mul-1-neg87.4%
unsub-neg87.4%
Simplified87.4%
Final simplification86.1%
Initial program 55.8%
add-log-exp51.1%
neg-mul-151.1%
fma-def51.1%
*-commutative51.1%
*-commutative51.1%
*-commutative51.1%
Applied egg-rr51.1%
add-log-exp55.8%
clear-num55.9%
Applied egg-rr55.9%
Taylor expanded in b around inf 81.6%
mul-1-neg81.6%
unsub-neg81.6%
Simplified81.6%
Final simplification81.6%
Initial program 55.8%
neg-sub055.8%
associate-+l-55.8%
sub0-neg55.8%
neg-mul-155.8%
associate-*l/55.8%
*-commutative55.8%
associate-/r*55.8%
/-rgt-identity55.8%
metadata-eval55.8%
Simplified55.8%
Taylor expanded in b around inf 63.4%
associate-*r/63.4%
neg-mul-163.4%
Simplified63.4%
Final simplification63.4%
Initial program 55.8%
add-log-exp51.1%
neg-mul-151.1%
fma-def51.1%
*-commutative51.1%
*-commutative51.1%
*-commutative51.1%
Applied egg-rr51.1%
Taylor expanded in c around 0 3.2%
associate-*r/3.2%
distribute-rgt1-in3.2%
metadata-eval3.2%
mul0-lft3.2%
metadata-eval3.2%
Simplified3.2%
Final simplification3.2%
herbie shell --seed 2023166
(FPCore (a b c)
:name "Quadratic roots, narrow range"
:precision binary64
:pre (and (and (and (< 1.0536712127723509e-8 a) (< a 94906265.62425156)) (and (< 1.0536712127723509e-8 b) (< b 94906265.62425156))) (and (< 1.0536712127723509e-8 c) (< c 94906265.62425156)))
(/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))