(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.re (+ y.im (* y.re (/ y.re y.im))))))
(if (<= y.re -7.579958549150986e+153)
(- (/ x.im y.re) t_0)
(if (<= y.re -3.9696921097903e-311)
(- (/ x.im (/ (pow (hypot y.re y.im) 2.0) y.re)) t_0)
(- (* x.im (pow (/ (sqrt y.re) (hypot y.re y.im)) 2.0)) t_0)))))double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_re / (y_46_im + (y_46_re * (y_46_re / y_46_im)));
double tmp;
if (y_46_re <= -7.579958549150986e+153) {
tmp = (x_46_im / y_46_re) - t_0;
} else if (y_46_re <= -3.9696921097903e-311) {
tmp = (x_46_im / (pow(hypot(y_46_re, y_46_im), 2.0) / y_46_re)) - t_0;
} else {
tmp = (x_46_im * pow((sqrt(y_46_re) / hypot(y_46_re, y_46_im)), 2.0)) - t_0;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_re / (y_46_im + (y_46_re * (y_46_re / y_46_im)));
double tmp;
if (y_46_re <= -7.579958549150986e+153) {
tmp = (x_46_im / y_46_re) - t_0;
} else if (y_46_re <= -3.9696921097903e-311) {
tmp = (x_46_im / (Math.pow(Math.hypot(y_46_re, y_46_im), 2.0) / y_46_re)) - t_0;
} else {
tmp = (x_46_im * Math.pow((Math.sqrt(y_46_re) / Math.hypot(y_46_re, y_46_im)), 2.0)) - t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = x_46_re / (y_46_im + (y_46_re * (y_46_re / y_46_im))) tmp = 0 if y_46_re <= -7.579958549150986e+153: tmp = (x_46_im / y_46_re) - t_0 elif y_46_re <= -3.9696921097903e-311: tmp = (x_46_im / (math.pow(math.hypot(y_46_re, y_46_im), 2.0) / y_46_re)) - t_0 else: tmp = (x_46_im * math.pow((math.sqrt(y_46_re) / math.hypot(y_46_re, y_46_im)), 2.0)) - t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_re / Float64(y_46_im + Float64(y_46_re * Float64(y_46_re / y_46_im)))) tmp = 0.0 if (y_46_re <= -7.579958549150986e+153) tmp = Float64(Float64(x_46_im / y_46_re) - t_0); elseif (y_46_re <= -3.9696921097903e-311) tmp = Float64(Float64(x_46_im / Float64((hypot(y_46_re, y_46_im) ^ 2.0) / y_46_re)) - t_0); else tmp = Float64(Float64(x_46_im * (Float64(sqrt(y_46_re) / hypot(y_46_re, y_46_im)) ^ 2.0)) - t_0); end return tmp end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = x_46_re / (y_46_im + (y_46_re * (y_46_re / y_46_im))); tmp = 0.0; if (y_46_re <= -7.579958549150986e+153) tmp = (x_46_im / y_46_re) - t_0; elseif (y_46_re <= -3.9696921097903e-311) tmp = (x_46_im / ((hypot(y_46_re, y_46_im) ^ 2.0) / y_46_re)) - t_0; else tmp = (x_46_im * ((sqrt(y_46_re) / hypot(y_46_re, y_46_im)) ^ 2.0)) - t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$re / N[(y$46$im + N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.579958549150986e+153], N[(N[(x$46$im / y$46$re), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[y$46$re, -3.9696921097903e-311], N[(N[(x$46$im / N[(N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x$46$im * N[Power[N[(N[Sqrt[y$46$re], $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\begin{array}{l}
t_0 := \frac{x.re}{y.im + y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{if}\;y.re \leq -7.579958549150986 \cdot 10^{+153}:\\
\;\;\;\;\frac{x.im}{y.re} - t_0\\
\mathbf{elif}\;y.re \leq -3.9696921097903 \cdot 10^{-311}:\\
\;\;\;\;\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} - t_0\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot {\left(\frac{\sqrt{y.re}}{\mathsf{hypot}\left(y.re, y.im\right)}\right)}^{2} - t_0\\
\end{array}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -7.5799585491509855e153Initial program 46.4
Simplified46.4
Applied egg-rr46.4
Taylor expanded in x.re around 0 46.4
Simplified45.3
Taylor expanded in y.re around 0 45.3
Simplified38.8
Taylor expanded in y.re around inf 7.8
if -7.5799585491509855e153 < y.re < -3.96969210979026e-311Initial program 18.9
Simplified18.9
Applied egg-rr19.1
Taylor expanded in x.re around 0 18.9
Simplified15.0
Taylor expanded in y.re around 0 5.3
Simplified5.3
Applied egg-rr5.3
if -3.96969210979026e-311 < y.re Initial program 24.9
Simplified24.9
Applied egg-rr25.1
Taylor expanded in x.re around 0 24.9
Simplified21.9
Taylor expanded in y.re around 0 15.1
Simplified13.6
Applied egg-rr3.3
Final simplification4.6
herbie shell --seed 2022153
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
:precision binary64
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))