
Results
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0Initial program 74.2%
associate-*l*73.3%
difference-of-squares73.3%
associate-*l*71.9%
associate-*l*74.2%
Simplified74.2%
Taylor expanded in c0 around inf 76.6%
*-commutative76.6%
*-commutative76.6%
associate-*r*76.4%
unpow276.4%
times-frac76.4%
unpow276.4%
associate-/l*76.4%
associate-*r*76.4%
*-commutative76.4%
Simplified76.4%
associate-*l/76.4%
*-commutative76.4%
associate-*l*76.4%
*-commutative76.4%
*-commutative76.4%
Applied egg-rr76.4%
*-commutative76.4%
associate-*r/77.6%
associate-/l*77.6%
associate-*r/77.5%
associate-/r/77.5%
*-commutative77.5%
*-commutative77.5%
associate-*r/78.6%
add-cbrt-cube75.4%
Applied egg-rr79.6%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
associate-*l*0.0%
difference-of-squares5.3%
associate-*l*5.3%
associate-*l*8.4%
Simplified8.4%
Taylor expanded in c0 around -inf 0.6%
associate-/l*0.6%
distribute-rgt1-in0.6%
metadata-eval0.6%
mul0-lft31.4%
unpow231.4%
Simplified31.4%
Taylor expanded in w around 0 45.9%
Final simplification57.1%
if (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0Initial program 74.2%
associate-*l*73.3%
difference-of-squares73.3%
associate-*l*71.9%
associate-*l*74.2%
Simplified74.2%
Taylor expanded in c0 around inf 76.6%
*-commutative76.6%
*-commutative76.6%
associate-*r*76.4%
unpow276.4%
times-frac76.4%
unpow276.4%
associate-/l*76.4%
associate-*r*76.4%
*-commutative76.4%
Simplified76.4%
Taylor expanded in D around 0 76.4%
unpow276.4%
associate-*r*76.4%
associate-/l*78.6%
Simplified78.6%
associate-*l/77.5%
associate-*r/77.6%
associate-/l*77.6%
associate-*r/76.4%
*-commutative76.4%
*-commutative76.4%
associate-/l*75.5%
*-commutative75.5%
associate-/l*77.7%
associate-/r/77.7%
associate-*r*78.9%
Applied egg-rr78.9%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 0.0%
associate-*l*0.0%
difference-of-squares5.3%
associate-*l*5.3%
associate-*l*8.4%
Simplified8.4%
Taylor expanded in c0 around -inf 0.6%
associate-/l*0.6%
distribute-rgt1-in0.6%
metadata-eval0.6%
mul0-lft31.4%
unpow231.4%
Simplified31.4%
Taylor expanded in w around 0 45.9%
Final simplification56.9%
if c0 < -1.95000000000000008e204 or -4.99999999999999961e133 < c0 < -8.50000000000000012e-50Initial program 34.3%
associate-*l*34.4%
difference-of-squares43.2%
associate-*l*43.2%
associate-*l*46.1%
Simplified46.1%
Taylor expanded in c0 around inf 46.5%
*-commutative46.5%
*-commutative46.5%
associate-*r*49.2%
unpow249.2%
times-frac49.5%
unpow249.5%
associate-/l*54.4%
associate-*r*54.3%
*-commutative54.3%
Simplified54.3%
Taylor expanded in D around 0 54.4%
unpow254.4%
associate-*r*54.3%
associate-/l*54.3%
Simplified54.3%
frac-times55.4%
associate-/l*53.9%
associate-/l*55.4%
associate-/r/56.8%
Applied egg-rr56.8%
if -1.95000000000000008e204 < c0 < -4.99999999999999961e133 or -1.01999999999999992e-238 < c0 < 1.50000000000000005e-83Initial program 10.6%
associate-*l*10.6%
difference-of-squares10.6%
associate-*l*10.6%
associate-*l*10.7%
Simplified10.7%
Taylor expanded in c0 around -inf 4.3%
associate-/l*4.3%
distribute-rgt1-in4.3%
metadata-eval4.3%
mul0-lft46.9%
unpow246.9%
Simplified46.9%
Taylor expanded in w around 0 54.7%
if -8.50000000000000012e-50 < c0 < -4.6000000000000004e-196Initial program 34.2%
associate-*l*31.2%
difference-of-squares38.6%
associate-*l*37.9%
associate-*l*41.5%
Simplified41.5%
Taylor expanded in c0 around inf 42.3%
*-commutative42.3%
*-commutative42.3%
associate-*r*42.2%
unpow242.2%
times-frac39.2%
unpow239.2%
associate-/l*43.3%
associate-*r*43.5%
*-commutative43.5%
Simplified43.5%
Taylor expanded in D around 0 43.3%
unpow243.3%
associate-*r*43.5%
associate-/l*46.9%
Simplified46.9%
Taylor expanded in c0 around 0 45.3%
associate-/r*41.8%
unpow241.8%
unpow241.8%
unpow241.8%
associate-*l*42.0%
unpow242.0%
times-frac46.6%
associate-*l/48.2%
*-commutative48.2%
times-frac62.6%
associate-/r*62.6%
Simplified62.6%
if -4.6000000000000004e-196 < c0 < -1.01999999999999992e-238Initial program 29.1%
associate-*l*29.1%
difference-of-squares29.1%
associate-*l*29.1%
associate-*l*43.4%
Simplified43.4%
Taylor expanded in c0 around inf 29.8%
*-commutative29.8%
*-commutative29.8%
associate-*r*44.1%
unpow244.1%
times-frac57.6%
unpow257.6%
associate-/l*57.7%
associate-*r*44.4%
*-commutative44.4%
Simplified44.4%
Taylor expanded in c0 around 0 29.8%
times-frac43.6%
unpow243.6%
unpow243.6%
associate-/r*57.6%
Simplified57.6%
if 1.50000000000000005e-83 < c0 Initial program 24.9%
associate-*l*25.0%
difference-of-squares26.2%
associate-*l*24.9%
associate-*l*28.7%
Simplified28.7%
Taylor expanded in c0 around inf 27.0%
*-commutative27.0%
*-commutative27.0%
associate-*r*29.4%
unpow229.4%
times-frac32.1%
unpow232.1%
associate-/l*36.9%
associate-*r*39.3%
*-commutative39.3%
Simplified39.3%
Taylor expanded in d around 0 32.1%
unpow232.1%
unpow232.1%
associate-*r*34.6%
times-frac40.7%
Simplified40.7%
Final simplification51.5%
if c0 < -1.6500000000000001e205 or -6.6e133 < c0 < -2.49999999999999981e-164 or 1.45e-83 < c0 Initial program 30.3%
associate-*l*29.9%
difference-of-squares35.0%
associate-*l*34.3%
associate-*l*37.9%
Simplified37.9%
Taylor expanded in c0 around inf 37.3%
*-commutative37.3%
*-commutative37.3%
associate-*r*39.5%
unpow239.5%
times-frac41.0%
unpow241.0%
associate-/l*45.8%
associate-*r*47.0%
*-commutative47.0%
Simplified47.0%
Taylor expanded in D around 0 45.8%
unpow245.8%
associate-*r*47.0%
associate-/l*48.1%
Simplified48.1%
Taylor expanded in d around 0 41.0%
unpow241.0%
associate-*r/45.9%
unpow245.9%
associate-*r*47.0%
associate-/r*48.1%
Simplified48.1%
if -1.6500000000000001e205 < c0 < -6.6e133 or -2.49999999999999981e-164 < c0 < 1.45e-83Initial program 12.7%
associate-*l*12.7%
difference-of-squares12.7%
associate-*l*12.7%
associate-*l*14.0%
Simplified14.0%
Taylor expanded in c0 around -inf 4.9%
associate-/l*4.9%
distribute-rgt1-in4.9%
metadata-eval4.9%
mul0-lft45.9%
unpow245.9%
Simplified45.9%
Taylor expanded in w around 0 52.5%
Final simplification49.5%
if c0 < -1.3999999999999999e206 or -4.7999999999999997e133 < c0 < -2.09999999999999998e-163Initial program 35.4%
associate-*l*34.5%
difference-of-squares43.5%
associate-*l*43.3%
associate-*l*46.7%
Simplified46.7%
Taylor expanded in c0 around inf 47.1%
*-commutative47.1%
*-commutative47.1%
associate-*r*49.2%
unpow249.2%
times-frac49.4%
unpow249.4%
associate-/l*54.4%
associate-*r*54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in D around 0 54.4%
unpow254.4%
associate-*r*54.4%
associate-/l*55.3%
Simplified55.3%
Taylor expanded in d around 0 49.4%
unpow249.4%
associate-*r/54.4%
unpow254.4%
associate-*r*54.3%
associate-/r*55.3%
Simplified55.3%
if -1.3999999999999999e206 < c0 < -4.7999999999999997e133 or -2.09999999999999998e-163 < c0 < 1e-83Initial program 12.7%
associate-*l*12.7%
difference-of-squares12.7%
associate-*l*12.7%
associate-*l*14.0%
Simplified14.0%
Taylor expanded in c0 around -inf 4.9%
associate-/l*4.9%
distribute-rgt1-in4.9%
metadata-eval4.9%
mul0-lft45.9%
unpow245.9%
Simplified45.9%
Taylor expanded in w around 0 52.5%
if 1e-83 < c0 Initial program 24.9%
associate-*l*25.0%
difference-of-squares26.2%
associate-*l*24.9%
associate-*l*28.7%
Simplified28.7%
Taylor expanded in c0 around inf 27.0%
*-commutative27.0%
*-commutative27.0%
associate-*r*29.4%
unpow229.4%
times-frac32.1%
unpow232.1%
associate-/l*36.9%
associate-*r*39.3%
*-commutative39.3%
Simplified39.3%
Taylor expanded in d around 0 32.1%
unpow232.1%
unpow232.1%
associate-*r*34.6%
times-frac40.7%
Simplified40.7%
Final simplification49.5%
if c0 < -1.05e205 or -8.0000000000000002e133 < c0 < -1.25000000000000008e-159Initial program 35.4%
associate-*l*34.5%
difference-of-squares43.5%
associate-*l*43.3%
associate-*l*46.7%
Simplified46.7%
Taylor expanded in c0 around inf 47.1%
*-commutative47.1%
*-commutative47.1%
associate-*r*49.2%
unpow249.2%
times-frac49.4%
unpow249.4%
associate-/l*54.4%
associate-*r*54.4%
*-commutative54.4%
Simplified54.4%
Taylor expanded in D around 0 54.4%
unpow254.4%
associate-*r*54.4%
associate-/l*55.3%
Simplified55.3%
if -1.05e205 < c0 < -8.0000000000000002e133 or -1.25000000000000008e-159 < c0 < 1.14999999999999995e-83Initial program 12.7%
associate-*l*12.7%
difference-of-squares12.7%
associate-*l*12.7%
associate-*l*14.0%
Simplified14.0%
Taylor expanded in c0 around -inf 4.9%
associate-/l*4.9%
distribute-rgt1-in4.9%
metadata-eval4.9%
mul0-lft45.9%
unpow245.9%
Simplified45.9%
Taylor expanded in w around 0 52.5%
if 1.14999999999999995e-83 < c0 Initial program 24.9%
associate-*l*25.0%
difference-of-squares26.2%
associate-*l*24.9%
associate-*l*28.7%
Simplified28.7%
Taylor expanded in c0 around inf 27.0%
*-commutative27.0%
*-commutative27.0%
associate-*r*29.4%
unpow229.4%
times-frac32.1%
unpow232.1%
associate-/l*36.9%
associate-*r*39.3%
*-commutative39.3%
Simplified39.3%
Taylor expanded in d around 0 32.1%
unpow232.1%
unpow232.1%
associate-*r*34.6%
times-frac40.7%
Simplified40.7%
Final simplification49.5%
if c0 < -1.95000000000000008e204Initial program 27.1%
associate-*l*27.1%
difference-of-squares38.6%
associate-*l*38.6%
associate-*l*42.5%
Simplified42.5%
Taylor expanded in c0 around inf 42.4%
*-commutative42.4%
*-commutative42.4%
associate-*r*42.8%
unpow242.8%
times-frac47.1%
unpow247.1%
associate-/l*55.0%
associate-*r*54.8%
*-commutative54.8%
Simplified54.8%
if -1.95000000000000008e204 < c0 < -2.7000000000000002e133 or -9.4999999999999997e-159 < c0 < 1.89999999999999988e-83Initial program 12.7%
associate-*l*12.7%
difference-of-squares12.7%
associate-*l*12.7%
associate-*l*14.0%
Simplified14.0%
Taylor expanded in c0 around -inf 4.9%
associate-/l*4.9%
distribute-rgt1-in4.9%
metadata-eval4.9%
mul0-lft45.9%
unpow245.9%
Simplified45.9%
Taylor expanded in w around 0 52.5%
if -2.7000000000000002e133 < c0 < -9.4999999999999997e-159Initial program 38.8%
associate-*l*37.6%
difference-of-squares45.6%
associate-*l*45.3%
associate-*l*48.4%
Simplified48.4%
Taylor expanded in c0 around inf 49.1%
*-commutative49.1%
*-commutative49.1%
associate-*r*51.9%
unpow251.9%
times-frac50.3%
unpow250.3%
associate-/l*54.1%
associate-*r*54.2%
*-commutative54.2%
Simplified54.2%
Taylor expanded in D around 0 54.1%
unpow254.1%
associate-*r*54.2%
associate-/l*55.6%
Simplified55.6%
if 1.89999999999999988e-83 < c0 Initial program 24.9%
associate-*l*25.0%
difference-of-squares26.2%
associate-*l*24.9%
associate-*l*28.7%
Simplified28.7%
Taylor expanded in c0 around inf 27.0%
*-commutative27.0%
*-commutative27.0%
associate-*r*29.4%
unpow229.4%
times-frac32.1%
unpow232.1%
associate-/l*36.9%
associate-*r*39.3%
*-commutative39.3%
Simplified39.3%
Taylor expanded in d around 0 32.1%
unpow232.1%
unpow232.1%
associate-*r*34.6%
times-frac40.7%
Simplified40.7%
Final simplification49.6%
if d < -2.19999999999999986e118 or 1.05e-7 < d Initial program 21.0%
associate-*l*20.5%
difference-of-squares23.8%
associate-*l*23.7%
associate-*l*26.3%
Simplified26.3%
Taylor expanded in c0 around -inf 3.3%
associate-/l*3.3%
distribute-rgt1-in3.3%
metadata-eval3.3%
mul0-lft28.6%
unpow228.6%
Simplified28.6%
Taylor expanded in w around 0 42.3%
if -2.19999999999999986e118 < d < 1.05e-7Initial program 30.2%
associate-*l*30.2%
difference-of-squares34.2%
associate-*l*33.2%
associate-*l*36.2%
Simplified36.2%
Taylor expanded in c0 around inf 35.7%
*-commutative35.7%
*-commutative35.7%
associate-*r*37.5%
unpow237.5%
times-frac39.0%
unpow239.0%
associate-/l*42.8%
associate-*r*42.0%
*-commutative42.0%
Simplified42.0%
Taylor expanded in D around 0 42.8%
unpow242.8%
associate-*r*42.0%
associate-/l*45.0%
Simplified45.0%
Taylor expanded in c0 around 0 32.4%
associate-/r*32.5%
unpow232.5%
unpow232.5%
unpow232.5%
associate-*l*35.6%
unpow235.6%
times-frac44.3%
associate-*l/45.7%
*-commutative45.7%
times-frac48.1%
associate-/r*47.1%
Simplified47.1%
Final simplification44.2%
Initial program 24.6%
associate-*l*24.4%
difference-of-squares27.9%
associate-*l*27.4%
associate-*l*30.2%
Simplified30.2%
Taylor expanded in c0 around -inf 4.5%
associate-/l*4.5%
distribute-rgt1-in4.5%
metadata-eval4.5%
mul0-lft25.8%
unpow225.8%
Simplified25.8%
Taylor expanded in w around 0 35.6%
Final simplification35.6%
herbie shell --seed 2023167
(FPCore (c0 w h D d M)
:name "Henrywood and Agarwal, Equation (13)"
:precision binary64
(* (/ c0 (* 2.0 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))