
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
if (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < +inf.0Initial program 78.8%
*-un-lft-identity78.8%
add-sqr-sqrt78.8%
times-frac78.7%
hypot-def78.7%
fma-def78.7%
hypot-def94.4%
Applied egg-rr94.4%
if +inf.0 < (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 0.0%
Taylor expanded in y.re around inf 42.8%
unpow242.8%
times-frac54.9%
Simplified54.9%
Final simplification86.1%
if y.re < -48000Initial program 48.9%
*-un-lft-identity48.9%
add-sqr-sqrt48.9%
times-frac48.9%
hypot-def48.9%
fma-def48.9%
hypot-def61.3%
Applied egg-rr61.3%
Taylor expanded in y.re around -inf 76.3%
neg-mul-176.3%
unsub-neg76.3%
mul-1-neg76.3%
associate-/l*81.5%
distribute-neg-frac81.5%
Simplified81.5%
if -48000 < y.re < 5.00000000000000033e-153Initial program 72.1%
Taylor expanded in y.re around 0 78.7%
+-commutative78.7%
unpow278.7%
associate-/l*78.9%
Simplified78.9%
clear-num78.9%
inv-pow78.9%
associate-/l*84.5%
Applied egg-rr84.5%
unpow-184.5%
associate-/l/87.1%
Simplified87.1%
if 5.00000000000000033e-153 < y.re < 1.64999999999999995e80Initial program 78.9%
if 1.64999999999999995e80 < y.re Initial program 41.1%
Taylor expanded in y.re around inf 74.8%
unpow274.8%
times-frac85.2%
Simplified85.2%
Final simplification84.1%
if y.re < -2.6e5 or 1.1000000000000001e82 < y.re Initial program 45.4%
Taylor expanded in y.re around inf 74.5%
unpow274.5%
times-frac83.1%
Simplified83.1%
if -2.6e5 < y.re < 6.50000000000000032e-153Initial program 72.1%
Taylor expanded in y.re around 0 78.7%
+-commutative78.7%
unpow278.7%
associate-/l*78.9%
Simplified78.9%
clear-num78.9%
inv-pow78.9%
associate-/l*84.5%
Applied egg-rr84.5%
unpow-184.5%
associate-/l/87.1%
Simplified87.1%
if 6.50000000000000032e-153 < y.re < 1.1000000000000001e82Initial program 78.9%
Final simplification84.1%
if y.re < -9.5e19 or 1.09999999999999998e60 < y.re Initial program 43.0%
Taylor expanded in y.re around inf 70.9%
if -9.5e19 < y.re < -4.5000000000000001e-40 or -1.65e-112 < y.re < 1.09999999999999998e60Initial program 74.6%
Taylor expanded in y.re around 0 67.1%
if -4.5000000000000001e-40 < y.re < -1.65e-112Initial program 81.2%
Taylor expanded in x.re around inf 71.1%
associate-/l*66.4%
associate-/r/57.3%
unpow257.3%
unpow257.3%
+-commutative57.3%
fma-udef57.3%
Simplified57.3%
fma-udef57.3%
+-commutative57.3%
Applied egg-rr57.3%
Final simplification67.9%
if y.re < -125 or 8.40000000000000005e80 < y.re Initial program 45.4%
Taylor expanded in y.re around inf 74.5%
unpow274.5%
times-frac83.1%
Simplified83.1%
if -125 < y.re < 8.40000000000000005e80Initial program 74.0%
Taylor expanded in y.re around 0 73.4%
+-commutative73.4%
unpow273.4%
associate-/l*73.5%
Simplified73.5%
clear-num73.5%
inv-pow73.5%
associate-/l*78.8%
Applied egg-rr78.8%
unpow-178.8%
associate-/l/81.4%
Simplified81.4%
Final simplification82.1%
if y.re < -8.80000000000000034e23 or 8.20000000000000003e80 < y.re Initial program 42.7%
Taylor expanded in y.re around inf 72.6%
if -8.80000000000000034e23 < y.re < 8.20000000000000003e80Initial program 74.8%
Taylor expanded in y.re around 0 71.8%
+-commutative71.8%
*-commutative71.8%
unpow271.8%
times-frac76.5%
Simplified76.5%
Final simplification75.0%
if y.re < -450 or 9.2000000000000008e78 < y.re Initial program 45.4%
Taylor expanded in y.re around inf 74.5%
unpow274.5%
times-frac83.1%
Simplified83.1%
if -450 < y.re < 9.2000000000000008e78Initial program 74.0%
Taylor expanded in y.re around 0 73.4%
+-commutative73.4%
unpow273.4%
associate-/l*73.5%
Simplified73.5%
Taylor expanded in y.im around 0 73.5%
unpow273.5%
associate-*r/78.8%
*-commutative78.8%
associate-/r/78.9%
Simplified78.9%
Final simplification80.6%
if y.re < -4.8000000000000001e24 or 1.16000000000000007e79 < y.re Initial program 42.7%
Taylor expanded in y.re around inf 72.6%
if -4.8000000000000001e24 < y.re < 1.16000000000000007e79Initial program 74.8%
Taylor expanded in y.re around 0 71.8%
+-commutative71.8%
unpow271.8%
associate-/l*72.0%
Simplified72.0%
Taylor expanded in y.im around 0 72.0%
unpow272.0%
associate-*r/77.0%
*-commutative77.0%
associate-/r/77.1%
Simplified77.1%
Final simplification75.3%
if y.re < -3.8000000000000004e22 or 2.10000000000000017e56 < y.re Initial program 43.0%
Taylor expanded in y.re around inf 70.9%
if -3.8000000000000004e22 < y.re < -4.9999999999999996e-41 or -4.9999999999999997e-113 < y.re < 2.10000000000000017e56Initial program 74.6%
Taylor expanded in y.re around 0 67.1%
if -4.9999999999999996e-41 < y.re < -4.9999999999999997e-113Initial program 81.2%
Taylor expanded in x.re around inf 71.1%
associate-/l*66.4%
associate-/r/57.3%
unpow257.3%
unpow257.3%
+-commutative57.3%
fma-udef57.3%
Simplified57.3%
fma-udef57.3%
+-commutative57.3%
Applied egg-rr57.3%
Taylor expanded in y.re around 0 52.4%
*-commutative52.4%
unpow252.4%
times-frac57.0%
Simplified57.0%
Final simplification67.8%
if y.re < -4.49999999999999979e23 or 2.9000000000000002e57 < y.re Initial program 43.0%
Taylor expanded in y.re around inf 70.9%
if -4.49999999999999979e23 < y.re < 2.9000000000000002e57Initial program 75.5%
Taylor expanded in y.re around 0 63.1%
Final simplification66.3%
Initial program 62.2%
Taylor expanded in y.re around 0 44.1%
Final simplification44.1%
herbie shell --seed 2023166
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
:precision binary64
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))