
Results
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
if (/.f64 (-.f64 (*.f64 b c) (*.f64 a d)) (+.f64 (*.f64 c c) (*.f64 d d))) < 2e297Initial program 80.6%
*-un-lft-identity80.6%
add-sqr-sqrt80.6%
times-frac80.6%
hypot-def80.6%
hypot-def96.6%
Applied egg-rr96.6%
if 2e297 < (/.f64 (-.f64 (*.f64 b c) (*.f64 a d)) (+.f64 (*.f64 c c) (*.f64 d d))) Initial program 9.1%
div-sub2.2%
*-un-lft-identity2.2%
add-sqr-sqrt2.2%
times-frac2.2%
fma-neg2.2%
hypot-def2.2%
hypot-def7.0%
associate-/l*13.2%
add-sqr-sqrt13.2%
pow213.2%
hypot-def13.2%
Applied egg-rr13.2%
fma-neg13.2%
associate-/l*58.7%
associate-/r/58.7%
*-commutative58.7%
Simplified58.7%
Taylor expanded in d around inf 64.7%
sub-neg64.7%
associate-*l/64.8%
*-un-lft-identity64.8%
associate-/r/64.7%
Applied egg-rr64.7%
sub-neg64.7%
associate-/l*64.8%
Simplified64.8%
Final simplification89.2%
if c < -1.0499999999999999e81Initial program 41.9%
Taylor expanded in c around inf 69.8%
+-commutative69.8%
mul-1-neg69.8%
unsub-neg69.8%
unpow269.8%
times-frac84.8%
Simplified84.8%
associate-*l/84.8%
Applied egg-rr84.8%
sub-div84.8%
Applied egg-rr84.8%
if -1.0499999999999999e81 < c < -1.45e-97 or 2.2000000000000001e-80 < c < 6.79999999999999973e69Initial program 86.7%
if -1.45e-97 < c < 2.2000000000000001e-80Initial program 70.2%
*-un-lft-identity70.2%
add-sqr-sqrt70.2%
times-frac70.1%
hypot-def70.1%
hypot-def86.6%
Applied egg-rr86.6%
Taylor expanded in c around 0 62.9%
neg-mul-162.9%
unsub-neg62.9%
associate-/l*61.7%
Simplified61.7%
Taylor expanded in c around 0 90.4%
if 6.79999999999999973e69 < c Initial program 42.3%
Taylor expanded in c around inf 77.1%
+-commutative77.1%
mul-1-neg77.1%
unsub-neg77.1%
unpow277.1%
times-frac84.1%
Simplified84.1%
Final simplification87.1%
if d < -1.7500000000000001e23 or 5e10 < d Initial program 52.7%
*-un-lft-identity52.7%
add-sqr-sqrt52.7%
times-frac52.7%
hypot-def52.7%
hypot-def65.5%
Applied egg-rr65.5%
Taylor expanded in c around 0 52.1%
neg-mul-152.1%
unsub-neg52.1%
associate-/l*54.1%
Simplified54.1%
Taylor expanded in c around 0 76.6%
if -1.7500000000000001e23 < d < 5e10Initial program 73.1%
Taylor expanded in c around inf 70.9%
+-commutative70.9%
mul-1-neg70.9%
unsub-neg70.9%
unpow270.9%
times-frac76.0%
Simplified76.0%
associate-*l/77.4%
Applied egg-rr77.4%
sub-div79.7%
Applied egg-rr79.7%
Final simplification78.3%
if d < -9.6e22Initial program 45.4%
Taylor expanded in c around 0 61.8%
+-commutative61.8%
mul-1-neg61.8%
unsub-neg61.8%
unpow261.8%
times-frac72.3%
Simplified72.3%
if -9.6e22 < d < 8.8e5Initial program 73.1%
Taylor expanded in c around inf 70.9%
+-commutative70.9%
mul-1-neg70.9%
unsub-neg70.9%
unpow270.9%
times-frac76.0%
Simplified76.0%
associate-*l/77.4%
Applied egg-rr77.4%
sub-div79.7%
Applied egg-rr79.7%
if 8.8e5 < d Initial program 59.4%
*-un-lft-identity59.4%
add-sqr-sqrt59.4%
times-frac59.4%
hypot-def59.4%
hypot-def73.9%
Applied egg-rr73.9%
Taylor expanded in c around 0 78.8%
neg-mul-178.8%
unsub-neg78.8%
associate-/l*82.4%
Simplified82.4%
Taylor expanded in c around 0 80.6%
Final simplification78.3%
if d < -2.5500000000000001e23 or 5.4e7 < d Initial program 52.7%
Taylor expanded in b around 0 43.3%
associate-*r/43.3%
mul-1-neg43.3%
distribute-rgt-neg-out43.3%
associate-/l*49.0%
unpow249.0%
unpow249.0%
fma-udef49.0%
Simplified49.0%
Taylor expanded in d around 0 65.5%
neg-mul-165.5%
+-commutative65.5%
mul-1-neg65.5%
unsub-neg65.5%
unpow265.5%
Simplified65.5%
if -2.5500000000000001e23 < d < 5.4e7Initial program 73.1%
Taylor expanded in c around inf 70.9%
+-commutative70.9%
mul-1-neg70.9%
unsub-neg70.9%
unpow270.9%
times-frac76.0%
Simplified76.0%
associate-*l/77.4%
Applied egg-rr77.4%
sub-div79.7%
Applied egg-rr79.7%
Final simplification73.3%
if c < -1.5499999999999999e-94 or 1.0500000000000001e-70 < c Initial program 60.2%
Taylor expanded in c around inf 66.7%
+-commutative66.7%
mul-1-neg66.7%
unsub-neg66.7%
unpow266.7%
times-frac73.1%
Simplified73.1%
associate-*l/73.1%
Applied egg-rr73.1%
sub-div73.1%
Applied egg-rr73.1%
if -1.5499999999999999e-94 < c < 1.0500000000000001e-70Initial program 70.5%
Taylor expanded in c around 0 69.4%
associate-*r/69.4%
neg-mul-169.4%
Simplified69.4%
Final simplification71.8%
if c < -6.5e10 or 8.60000000000000022e-20 < c Initial program 53.6%
Taylor expanded in c around inf 66.7%
if -6.5e10 < c < 8.60000000000000022e-20Initial program 74.2%
Taylor expanded in c around 0 60.5%
associate-*r/60.5%
neg-mul-160.5%
Simplified60.5%
Final simplification63.6%
if d < -1.25000000000000006e148 or 2.3499999999999999e126 < d Initial program 42.0%
Taylor expanded in b around 0 36.9%
associate-*r/36.9%
mul-1-neg36.9%
distribute-rgt-neg-out36.9%
associate-/l*38.2%
unpow238.2%
unpow238.2%
fma-udef38.2%
Simplified38.2%
Taylor expanded in d around 0 67.1%
neg-mul-167.1%
+-commutative67.1%
mul-1-neg67.1%
unsub-neg67.1%
unpow267.1%
Simplified67.1%
sub-neg67.1%
add-sqr-sqrt34.1%
sqrt-unprod36.4%
sqr-neg36.4%
sqrt-prod13.8%
add-sqr-sqrt34.7%
associate-/l*37.5%
Applied egg-rr37.5%
Taylor expanded in d around inf 33.3%
if -1.25000000000000006e148 < d < 2.3499999999999999e126Initial program 71.4%
Taylor expanded in c around inf 53.3%
Final simplification48.1%
Initial program 63.8%
Taylor expanded in b around 0 41.4%
associate-*r/41.4%
mul-1-neg41.4%
distribute-rgt-neg-out41.4%
associate-/l*44.1%
unpow244.1%
unpow244.1%
fma-udef44.1%
Simplified44.1%
Taylor expanded in d around 0 52.7%
neg-mul-152.7%
+-commutative52.7%
mul-1-neg52.7%
unsub-neg52.7%
unpow252.7%
Simplified52.7%
sub-neg52.7%
add-sqr-sqrt23.1%
sqrt-unprod35.0%
sqr-neg35.0%
sqrt-prod14.0%
add-sqr-sqrt25.6%
associate-/l*28.3%
Applied egg-rr28.3%
Taylor expanded in d around inf 10.8%
Final simplification10.8%
herbie shell --seed 2023167
(FPCore (a b c d)
:name "Complex division, imag part"
:precision binary64
:herbie-target
(if (< (fabs d) (fabs c)) (/ (- b (* a (/ d c))) (+ c (* d (/ d c)))) (/ (+ (- a) (* b (/ c d))) (+ d (* c (/ c d)))))
(/ (- (* b c) (* a d)) (+ (* c c) (* d d))))