
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
if x.re < -2.2000000000000002e174Initial program 43.6%
*-commutative43.6%
distribute-lft-out43.6%
associate-*l*43.6%
*-commutative43.6%
distribute-rgt-out--71.8%
associate--l-71.8%
associate--l-71.8%
sub-neg71.8%
associate--l+71.8%
fma-udef76.9%
neg-mul-176.9%
count-276.9%
associate-*l*76.9%
distribute-rgt-out--76.9%
associate-*r*76.9%
metadata-eval76.9%
Simplified76.9%
Taylor expanded in x.re around inf 94.9%
unpow294.9%
Simplified94.9%
if -2.2000000000000002e174 < x.re < -5.19999999999999968e-108 or 4.49999999999999999e-68 < x.re Initial program 86.9%
*-commutative86.9%
distribute-lft-out86.9%
associate-*l*86.9%
*-commutative86.9%
distribute-rgt-out--91.7%
associate--l-91.7%
associate--l-91.7%
sub-neg91.7%
associate--l+91.7%
fma-udef95.8%
neg-mul-195.8%
count-295.8%
associate-*l*95.8%
distribute-rgt-out--95.8%
associate-*r*95.8%
metadata-eval95.8%
Simplified95.8%
if -5.19999999999999968e-108 < x.re < 4.49999999999999999e-68Initial program 86.5%
*-commutative86.5%
distribute-lft-out86.5%
associate-*l*86.4%
*-commutative86.4%
distribute-rgt-out--86.5%
associate--l-86.5%
associate--l-86.5%
sub-neg86.5%
associate--l+86.5%
fma-udef86.5%
neg-mul-186.5%
count-286.5%
associate-*l*86.5%
distribute-rgt-out--86.5%
associate-*r*86.5%
metadata-eval86.5%
Simplified86.5%
fma-udef86.5%
Applied egg-rr86.5%
Taylor expanded in x.re around 0 85.2%
unpow285.2%
associate-*r*85.2%
*-commutative85.2%
*-commutative85.2%
associate-*r*98.4%
associate-*r*98.5%
Simplified98.5%
Final simplification96.4%
if (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)) < +inf.0Initial program 94.6%
*-commutative94.6%
fma-neg94.6%
distribute-lft-neg-in94.6%
*-commutative94.6%
*-commutative94.6%
count-294.6%
distribute-lft-neg-in94.6%
metadata-eval94.6%
*-commutative94.6%
Simplified94.6%
fma-udef94.6%
fma-neg94.6%
distribute-rgt-neg-in94.6%
associate-*r*94.6%
Applied egg-rr94.6%
+-commutative94.6%
fma-def94.7%
*-commutative94.7%
*-commutative94.7%
fma-def94.7%
distribute-rgt-in92.4%
unpow392.5%
*-commutative92.5%
associate-*r*97.6%
distribute-rgt-neg-in97.6%
associate-*r*92.5%
unsub-neg92.5%
associate-*r*97.6%
*-commutative97.6%
*-commutative97.6%
Simplified97.6%
if +inf.0 < (-.f64 (*.f64 (-.f64 (*.f64 x.re x.re) (*.f64 x.im x.im)) x.re) (*.f64 (+.f64 (*.f64 x.re x.im) (*.f64 x.im x.re)) x.im)) Initial program 0.0%
*-commutative0.0%
distribute-lft-out0.0%
associate-*l*0.0%
*-commutative0.0%
distribute-rgt-out--46.2%
associate--l-46.2%
associate--l-46.2%
sub-neg46.2%
associate--l+46.2%
fma-udef66.7%
neg-mul-166.7%
count-266.7%
associate-*l*66.7%
distribute-rgt-out--66.7%
associate-*r*66.7%
metadata-eval66.7%
Simplified66.7%
Taylor expanded in x.re around inf 79.5%
unpow279.5%
Simplified79.5%
Final simplification94.8%
if x.im < -7.50000000000000065e153Initial program 47.8%
*-commutative47.8%
distribute-lft-out47.8%
associate-*l*47.8%
*-commutative47.8%
distribute-rgt-out--47.8%
associate--l-47.8%
associate--l-47.8%
sub-neg47.8%
associate--l+47.8%
fma-udef60.3%
neg-mul-160.3%
count-260.3%
associate-*l*60.3%
distribute-rgt-out--60.3%
associate-*r*60.3%
metadata-eval60.3%
Simplified60.3%
fma-udef47.8%
Applied egg-rr47.8%
Taylor expanded in x.re around 0 60.3%
unpow260.3%
associate-*r*60.3%
*-commutative60.3%
*-commutative60.3%
associate-*r*91.4%
associate-*r*91.5%
Simplified91.5%
Taylor expanded in x.im around 0 91.5%
*-commutative91.5%
associate-*r*91.5%
Simplified91.5%
if -7.50000000000000065e153 < x.im < 1.22000000000000001e138Initial program 90.5%
*-commutative90.5%
distribute-lft-out90.5%
associate-*l*90.5%
*-commutative90.5%
distribute-rgt-out--99.8%
associate--l-99.8%
associate--l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-udef99.8%
neg-mul-199.8%
count-299.8%
associate-*l*99.8%
distribute-rgt-out--99.8%
associate-*r*99.8%
metadata-eval99.8%
Simplified99.8%
fma-udef99.8%
Applied egg-rr99.8%
if 1.22000000000000001e138 < x.im Initial program 48.1%
*-commutative48.1%
distribute-lft-out48.1%
associate-*l*48.0%
*-commutative48.0%
distribute-rgt-out--48.1%
associate--l-48.1%
associate--l-48.1%
sub-neg48.1%
associate--l+48.1%
fma-udef61.2%
neg-mul-161.2%
count-261.2%
associate-*l*61.2%
distribute-rgt-out--61.2%
associate-*r*61.2%
metadata-eval61.2%
Simplified61.2%
fma-udef48.1%
Applied egg-rr48.1%
Taylor expanded in x.re around 0 61.2%
unpow261.2%
associate-*r*61.2%
*-commutative61.2%
*-commutative61.2%
associate-*r*71.0%
associate-*r*71.0%
Simplified71.0%
Final simplification94.7%
if x.im < -1.25e21 or 2.6000000000000001e136 < x.im Initial program 53.7%
*-commutative53.7%
distribute-lft-out53.7%
associate-*l*53.7%
*-commutative53.7%
distribute-rgt-out--61.9%
associate--l-61.9%
associate--l-61.9%
sub-neg61.9%
associate--l+61.9%
fma-udef71.4%
neg-mul-171.4%
count-271.4%
associate-*l*71.4%
distribute-rgt-out--71.4%
associate-*r*71.3%
metadata-eval71.3%
Simplified71.3%
fma-udef61.9%
Applied egg-rr61.9%
Taylor expanded in x.re around 0 61.9%
unpow261.9%
associate-*r*62.0%
*-commutative62.0%
*-commutative62.0%
associate-*r*75.1%
associate-*r*75.2%
Simplified75.2%
Taylor expanded in x.im around 0 75.2%
*-commutative75.2%
associate-*r*75.1%
Simplified75.1%
if -1.25e21 < x.im < 2.6000000000000001e136Initial program 93.4%
*-commutative93.4%
distribute-lft-out93.4%
associate-*l*93.3%
*-commutative93.3%
distribute-rgt-out--99.8%
associate--l-99.8%
associate--l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-udef99.8%
neg-mul-199.8%
count-299.8%
associate-*l*99.8%
distribute-rgt-out--99.8%
associate-*r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x.re around inf 88.6%
unpow288.6%
Simplified88.6%
Final simplification84.1%
if x.im < -8.6e20 or 1.89999999999999999e134 < x.im Initial program 53.7%
*-commutative53.7%
distribute-lft-out53.7%
associate-*l*53.7%
*-commutative53.7%
distribute-rgt-out--61.9%
associate--l-61.9%
associate--l-61.9%
sub-neg61.9%
associate--l+61.9%
fma-udef71.4%
neg-mul-171.4%
count-271.4%
associate-*l*71.4%
distribute-rgt-out--71.4%
associate-*r*71.3%
metadata-eval71.3%
Simplified71.3%
fma-udef61.9%
Applied egg-rr61.9%
Taylor expanded in x.re around 0 61.9%
unpow261.9%
associate-*r*62.0%
*-commutative62.0%
*-commutative62.0%
associate-*r*75.1%
associate-*r*75.2%
Simplified75.2%
if -8.6e20 < x.im < 1.89999999999999999e134Initial program 93.4%
*-commutative93.4%
distribute-lft-out93.4%
associate-*l*93.3%
*-commutative93.3%
distribute-rgt-out--99.8%
associate--l-99.8%
associate--l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-udef99.8%
neg-mul-199.8%
count-299.8%
associate-*l*99.8%
distribute-rgt-out--99.8%
associate-*r*99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x.re around inf 88.6%
unpow288.6%
Simplified88.6%
Final simplification84.1%
if x.im < -3.49999999999999996e165 or 5.19999999999999978e154 < x.im Initial program 51.1%
*-commutative51.1%
fma-neg51.1%
distribute-lft-neg-in51.1%
*-commutative51.1%
*-commutative51.1%
count-251.1%
distribute-lft-neg-in51.1%
metadata-eval51.1%
*-commutative51.1%
Simplified51.1%
Taylor expanded in x.re around 0 66.0%
mul-1-neg66.0%
unpow266.0%
distribute-rgt-neg-out66.0%
Simplified66.0%
fma-udef66.0%
+-commutative66.0%
associate-*r*66.0%
*-commutative66.0%
add-sqr-sqrt26.5%
sqrt-unprod26.5%
sqr-neg26.5%
sqrt-prod0.0%
add-sqr-sqrt0.0%
Applied egg-rr0.0%
associate-*r*0.0%
associate-*r*0.0%
*-rgt-identity0.0%
distribute-lft-out66.0%
metadata-eval66.0%
metadata-eval66.0%
distribute-rgt-neg-in66.0%
*-rgt-identity66.0%
distribute-rgt-neg-in66.0%
distribute-rgt-neg-in66.0%
Simplified66.0%
if -3.49999999999999996e165 < x.im < 5.19999999999999978e154Initial program 88.0%
*-commutative88.0%
distribute-lft-out88.0%
associate-*l*87.9%
*-commutative87.9%
distribute-rgt-out--96.9%
associate--l-96.9%
associate--l-96.9%
sub-neg96.9%
associate--l+96.9%
fma-udef96.9%
neg-mul-196.9%
count-296.9%
associate-*l*96.9%
distribute-rgt-out--96.9%
associate-*r*96.9%
metadata-eval96.9%
Simplified96.9%
Taylor expanded in x.re around inf 80.5%
unpow280.5%
Simplified80.5%
Final simplification77.5%
Initial program 80.2%
*-commutative80.2%
distribute-lft-out80.2%
associate-*l*80.2%
*-commutative80.2%
distribute-rgt-out--87.2%
associate--l-87.2%
associate--l-87.2%
sub-neg87.2%
associate--l+87.2%
fma-udef90.4%
neg-mul-190.4%
count-290.4%
associate-*l*90.4%
distribute-rgt-out--90.4%
associate-*r*90.4%
metadata-eval90.4%
Simplified90.4%
Taylor expanded in x.re around inf 67.6%
unpow267.6%
Simplified67.6%
Final simplification67.6%
herbie shell --seed 2023167
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
:precision binary64
:herbie-target
(+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3.0 x.im))))
(- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))