
Results
Herbie found 8 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%
*-commutative54.7%
associate-*r/54.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%
*-commutative14.8%
associate-*r/14.8%
Simplified14.8%
Taylor expanded in b around inf 93.1%
associate-*r/93.1%
neg-mul-193.1%
Simplified93.1%
Final simplification86.0%
if b < -7.9999999999999997e-72Initial program 63.7%
neg-sub063.7%
associate-+l-63.7%
sub0-neg63.7%
neg-mul-163.7%
*-commutative63.7%
associate-*r/63.6%
Simplified63.7%
Taylor expanded in b around -inf 82.2%
mul-1-neg82.2%
unsub-neg82.2%
Simplified82.2%
if -7.9999999999999997e-72 < b < 5.5000000000000001e-23Initial program 75.1%
Taylor expanded in b around 0 70.5%
*-commutative70.5%
*-commutative70.5%
associate-*r*70.5%
Simplified70.5%
expm1-log1p-u45.6%
expm1-udef18.0%
*-un-lft-identity18.0%
times-frac18.0%
metadata-eval18.0%
add-sqr-sqrt10.0%
sqrt-unprod17.6%
sqr-neg17.6%
sqrt-prod8.0%
add-sqr-sqrt17.3%
Applied egg-rr17.3%
expm1-def44.9%
expm1-log1p69.2%
Simplified69.2%
if 5.5000000000000001e-23 < b Initial program 13.8%
neg-sub013.8%
associate-+l-13.8%
sub0-neg13.8%
neg-mul-113.8%
*-commutative13.8%
associate-*r/13.8%
Simplified13.8%
Taylor expanded in b around inf 94.1%
associate-*r/94.1%
neg-mul-194.1%
Simplified94.1%
Final simplification81.7%
if b < -7.2e-71Initial program 63.7%
neg-sub063.7%
associate-+l-63.7%
sub0-neg63.7%
neg-mul-163.7%
*-commutative63.7%
associate-*r/63.6%
Simplified63.7%
Taylor expanded in b around -inf 82.2%
mul-1-neg82.2%
unsub-neg82.2%
Simplified82.2%
if -7.2e-71 < b < 1.44999999999999997e-38Initial program 75.7%
Taylor expanded in b around 0 71.0%
*-commutative71.0%
*-commutative71.0%
associate-*r*71.0%
Simplified71.0%
frac-2neg71.0%
div-inv70.9%
distribute-neg-in70.9%
add-sqr-sqrt35.0%
sqrt-unprod70.3%
sqr-neg70.3%
sqrt-prod36.0%
add-sqr-sqrt69.5%
sub-neg69.5%
add-sqr-sqrt33.5%
sqrt-unprod69.5%
sqr-neg69.5%
sqrt-prod35.9%
add-sqr-sqrt70.9%
*-commutative70.9%
distribute-rgt-neg-in70.9%
metadata-eval70.9%
Applied egg-rr70.9%
*-commutative70.9%
*-commutative70.9%
associate-/r*70.9%
metadata-eval70.9%
associate-*r*70.9%
*-commutative70.9%
rem-square-sqrt0.0%
unpow20.0%
associate-*l*0.0%
unpow20.0%
rem-square-sqrt70.9%
Simplified70.9%
if 1.44999999999999997e-38 < b Initial program 14.8%
neg-sub014.8%
associate-+l-14.8%
sub0-neg14.8%
neg-mul-114.8%
*-commutative14.8%
associate-*r/14.8%
Simplified14.8%
Taylor expanded in b around inf 93.1%
associate-*r/93.1%
neg-mul-193.1%
Simplified93.1%
Final simplification82.2%
if b < -2.2e-73Initial program 63.7%
neg-sub063.7%
associate-+l-63.7%
sub0-neg63.7%
neg-mul-163.7%
*-commutative63.7%
associate-*r/63.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%
*-commutative14.8%
associate-*r/14.8%
Simplified14.8%
Taylor expanded in b around inf 93.1%
associate-*r/93.1%
neg-mul-193.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%
*-commutative68.2%
associate-*r/68.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%
*-commutative34.1%
associate-*r/34.0%
Simplified34.0%
Taylor expanded in b around inf 67.3%
associate-*r/67.3%
neg-mul-167.3%
Simplified67.3%
Final simplification65.6%
if b < 6.79999999999999948e-7Initial program 68.2%
neg-sub068.2%
associate-+l-68.2%
sub0-neg68.2%
neg-mul-168.2%
*-commutative68.2%
associate-*r/68.0%
Simplified68.1%
Taylor expanded in b around -inf 47.3%
associate-*r/47.3%
mul-1-neg47.3%
Simplified47.3%
if 6.79999999999999948e-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 < 1.3499999999999998e-308Initial program 68.2%
neg-sub068.2%
associate-+l-68.2%
sub0-neg68.2%
neg-mul-168.2%
*-commutative68.2%
associate-*r/68.1%
Simplified68.2%
Taylor expanded in b around -inf 63.7%
associate-*r/63.7%
mul-1-neg63.7%
Simplified63.7%
if 1.3499999999999998e-308 < b Initial program 34.1%
neg-sub034.1%
associate-+l-34.1%
sub0-neg34.1%
neg-mul-134.1%
*-commutative34.1%
associate-*r/34.0%
Simplified34.0%
Taylor expanded in b around inf 67.3%
associate-*r/67.3%
neg-mul-167.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 "quadp (p42, positive)"
: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)))