
Results
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
if (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) 2) (*.f64 4 (+.f64 (*.f64 (*.f64 a a) (+.f64 1 a)) (*.f64 (*.f64 b b) (-.f64 1 (*.f64 3 a)))))) < +inf.0Initial program 99.8%
if +inf.0 < (+.f64 (pow.f64 (+.f64 (*.f64 a a) (*.f64 b b)) 2) (*.f64 4 (+.f64 (*.f64 (*.f64 a a) (+.f64 1 a)) (*.f64 (*.f64 b b) (-.f64 1 (*.f64 3 a)))))) Initial program 0.0%
Taylor expanded in b around 0 32.0%
unpow232.0%
Simplified32.0%
Taylor expanded in a around 0 93.7%
unpow293.7%
Simplified93.7%
Final simplification98.4%
Initial program 76.4%
associate--l+76.4%
Simplified78.1%
Taylor expanded in b around 0 83.2%
+-commutative83.2%
associate--l+83.2%
+-commutative83.2%
distribute-lft-in83.2%
unpow283.2%
cube-mult83.2%
fma-udef83.2%
fma-def83.2%
Simplified85.2%
Taylor expanded in a around inf 98.3%
Final simplification98.3%
if (*.f64 b b) < 2e20Initial program 85.8%
Taylor expanded in b around 0 84.5%
unpow284.5%
Simplified84.5%
Taylor expanded in a around 0 95.8%
unpow295.8%
Simplified95.8%
if 2e20 < (*.f64 b b) < 2e153Initial program 63.0%
associate--l+63.0%
Simplified63.3%
Taylor expanded in b around 0 76.7%
+-commutative76.7%
associate--l+76.7%
+-commutative76.7%
distribute-lft-in76.7%
unpow276.7%
cube-mult76.7%
fma-udef76.7%
fma-def76.7%
Simplified76.7%
Taylor expanded in a around 0 95.9%
*-commutative95.9%
unpow295.9%
associate-*l*95.9%
*-commutative95.9%
Simplified95.9%
Taylor expanded in a around inf 95.9%
unpow295.9%
unpow295.9%
Simplified95.9%
if 2e153 < (*.f64 b b) Initial program 67.0%
associate--l+67.0%
Simplified71.4%
Taylor expanded in b around inf 100.0%
Final simplification97.3%
if a < -1.12e30Initial program 27.3%
associate--l+27.3%
Simplified35.3%
Taylor expanded in a around inf 100.0%
if -1.12e30 < a < 2.05e9Initial program 98.5%
associate--l+98.5%
Simplified98.6%
Taylor expanded in a around 0 96.3%
+-commutative96.3%
associate--l+96.3%
fma-neg96.3%
unpow296.3%
metadata-eval96.3%
Simplified96.3%
fma-udef96.3%
Applied egg-rr96.3%
if 2.05e9 < a Initial program 63.7%
Taylor expanded in b around 0 96.8%
unpow296.8%
Simplified96.8%
Final simplification97.2%
if a < -1.4e22 or 5e8 < a Initial program 46.7%
associate--l+46.7%
Simplified50.5%
Taylor expanded in a around inf 98.2%
if -1.4e22 < a < 5e8Initial program 98.5%
associate--l+98.5%
Simplified98.6%
Taylor expanded in a around 0 96.3%
+-commutative96.3%
associate--l+96.3%
fma-neg96.3%
unpow296.3%
metadata-eval96.3%
Simplified96.3%
fma-udef96.3%
Applied egg-rr96.3%
Final simplification97.1%
if a < -1.2499999999999999e22 or 3.9e12 < a Initial program 46.7%
associate--l+46.7%
Simplified50.5%
Taylor expanded in a around inf 98.2%
if -1.2499999999999999e22 < a < 4.29999999999999989e-255 or 2.4999999999999999e-214 < a < 3.9e12Initial program 98.4%
associate--l+98.4%
Simplified98.5%
Taylor expanded in b around 0 99.2%
+-commutative99.2%
associate--l+99.2%
+-commutative99.2%
distribute-lft-in99.2%
unpow299.2%
cube-mult99.2%
fma-udef99.2%
fma-def99.2%
Simplified99.3%
Taylor expanded in a around 0 96.2%
*-commutative96.2%
unpow296.2%
associate-*l*96.2%
*-commutative96.2%
Simplified96.2%
Taylor expanded in a around 0 96.5%
unpow296.5%
associate-*r*96.5%
fma-neg96.5%
metadata-eval96.5%
Simplified96.5%
Taylor expanded in b around 0 78.1%
sub-neg78.1%
unpow278.1%
distribute-lft-out78.1%
unpow278.1%
metadata-eval78.1%
Simplified78.1%
if 4.29999999999999989e-255 < a < 2.4999999999999999e-214Initial program 99.8%
associate--l+99.8%
Simplified100.0%
Taylor expanded in b around inf 100.0%
Final simplification87.3%
if a < -2.29999999999999984e28 or 5e8 < a Initial program 46.7%
associate--l+46.7%
Simplified50.5%
Taylor expanded in a around inf 98.2%
if -2.29999999999999984e28 < a < 5e8Initial program 98.5%
associate--l+98.5%
Simplified98.6%
Taylor expanded in a around 0 96.3%
+-commutative96.3%
associate--l+96.3%
fma-neg96.3%
unpow296.3%
metadata-eval96.3%
Simplified96.3%
Taylor expanded in b around 0 94.8%
Final simplification96.2%
if a < -1.2499999999999999e22 or 5.9e10 < a Initial program 46.7%
associate--l+46.7%
Simplified50.5%
Taylor expanded in a around inf 98.2%
if -1.2499999999999999e22 < a < 5.9e10Initial program 98.5%
associate--l+98.5%
Simplified98.6%
Taylor expanded in b around 0 99.3%
+-commutative99.3%
associate--l+99.3%
+-commutative99.3%
distribute-lft-in99.3%
unpow299.3%
cube-mult99.3%
fma-udef99.3%
fma-def99.3%
Simplified99.3%
Taylor expanded in a around 0 96.4%
*-commutative96.4%
unpow296.4%
associate-*l*96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in a around 0 96.7%
unpow296.7%
associate-*r*96.7%
fma-neg96.7%
metadata-eval96.7%
Simplified96.7%
Taylor expanded in b around 0 76.1%
sub-neg76.1%
unpow276.1%
distribute-lft-out76.1%
unpow276.1%
metadata-eval76.1%
Simplified76.1%
Final simplification85.5%
if (*.f64 b b) < 4.49999999999999987e-22Initial program 87.5%
Taylor expanded in a around 0 51.2%
+-commutative51.2%
associate-+l+51.2%
associate-*r*51.2%
distribute-rgt-out51.2%
unpow251.2%
Simplified51.2%
Taylor expanded in b around 0 51.2%
if 4.49999999999999987e-22 < (*.f64 b b) < 5.0000000000000003e275Initial program 65.5%
associate--l+65.4%
Simplified68.5%
Taylor expanded in b around 0 79.9%
+-commutative79.9%
associate--l+79.9%
+-commutative79.9%
distribute-lft-in79.9%
unpow279.9%
cube-mult79.9%
fma-udef79.9%
fma-def79.9%
Simplified80.0%
Taylor expanded in a around 0 90.1%
*-commutative90.1%
unpow290.1%
associate-*l*90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in a around 0 86.7%
unpow286.7%
associate-*r*86.7%
fma-neg86.8%
metadata-eval86.8%
Simplified86.8%
Taylor expanded in a around inf 34.0%
unpow234.0%
Simplified34.0%
if 5.0000000000000003e275 < (*.f64 b b) Initial program 67.7%
associate--l+67.7%
Simplified70.8%
Taylor expanded in a around 0 100.0%
+-commutative100.0%
associate--l+100.0%
fma-neg100.0%
unpow2100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in b around 0 98.6%
unpow298.6%
Simplified98.6%
Final simplification58.5%
if (*.f64 b b) < 1.7999999999999999e275Initial program 79.4%
Taylor expanded in b around 0 67.8%
unpow267.8%
Simplified67.8%
Taylor expanded in a around 0 81.5%
unpow281.5%
Simplified81.5%
Taylor expanded in a around 0 61.8%
unpow261.8%
Simplified61.8%
if 1.7999999999999999e275 < (*.f64 b b) Initial program 67.7%
associate--l+67.7%
Simplified70.8%
Taylor expanded in a around 0 100.0%
+-commutative100.0%
associate--l+100.0%
fma-neg100.0%
unpow2100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in b around inf 100.0%
unpow2100.0%
Simplified100.0%
Taylor expanded in b around 0 98.6%
unpow298.6%
Simplified98.6%
Final simplification71.2%
Initial program 76.4%
associate--l+76.4%
Simplified78.1%
Taylor expanded in b around 0 83.2%
+-commutative83.2%
associate--l+83.2%
+-commutative83.2%
distribute-lft-in83.2%
unpow283.2%
cube-mult83.2%
fma-udef83.2%
fma-def83.2%
Simplified85.2%
Taylor expanded in a around 0 85.8%
*-commutative85.8%
unpow285.8%
associate-*l*85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in a around 0 85.3%
unpow285.3%
associate-*r*85.3%
fma-neg85.3%
metadata-eval85.3%
Simplified85.3%
Taylor expanded in b around 0 72.1%
sub-neg72.1%
unpow272.1%
distribute-lft-out72.1%
unpow272.1%
metadata-eval72.1%
Simplified72.1%
Final simplification72.1%
if a < -2.4500000000000002 or 0.409999999999999976 < a Initial program 49.9%
associate--l+49.9%
Simplified53.3%
Taylor expanded in b around 0 64.2%
+-commutative64.2%
associate--l+64.2%
+-commutative64.2%
distribute-lft-in64.2%
unpow264.2%
cube-mult64.2%
fma-udef64.2%
fma-def64.2%
Simplified68.3%
Taylor expanded in a around 0 70.9%
*-commutative70.9%
unpow270.9%
associate-*l*70.9%
*-commutative70.9%
Simplified70.9%
Taylor expanded in a around 0 69.9%
unpow269.9%
associate-*r*69.9%
fma-neg69.9%
metadata-eval69.9%
Simplified69.9%
Taylor expanded in a around inf 57.1%
unpow257.1%
Simplified57.1%
if -2.4500000000000002 < a < 0.409999999999999976Initial program 99.9%
Taylor expanded in a around 0 81.1%
+-commutative81.1%
associate-+l+81.1%
associate-*r*81.1%
distribute-rgt-out98.7%
unpow298.7%
Simplified98.7%
Taylor expanded in b around 0 47.1%
Final simplification51.8%
Initial program 76.4%
Taylor expanded in a around 0 51.5%
+-commutative51.5%
associate-+l+51.5%
associate-*r*51.5%
distribute-rgt-out60.9%
unpow260.9%
Simplified60.9%
Taylor expanded in b around 0 25.4%
Final simplification25.4%
herbie shell --seed 2023166
(FPCore (a b)
:name "Bouland and Aaronson, Equation (25)"
:precision binary64
(- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (+ (* (* a a) (+ 1.0 a)) (* (* b b) (- 1.0 (* 3.0 a)))))) 1.0))