| Alternative 1 | |
|---|---|
| Accuracy | 89.8% |
| Cost | 27348 |
(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 (/ y.im (/ (pow (hypot y.re y.im) 2.0) x.re)))
(t_1 (/ 1.0 (hypot y.re y.im)))
(t_2 (* t_1 (/ y.re (/ (hypot y.re y.im) x.im))))
(t_3 (/ (/ y.re (hypot y.im y.re)) (/ (hypot y.im y.re) x.im))))
(if (<= y.im -6e+97)
(- t_3 (/ x.re y.im))
(if (<= y.im -1e-150)
(- t_3 t_0)
(if (<= y.im 3.9e-218)
(- (/ x.im y.re) (/ x.re (* y.re (/ y.re y.im))))
(if (<= y.im 3.2e-98)
(* t_1 (/ (- (* y.re x.im) (* y.im x.re)) (hypot y.re y.im)))
(if (<= y.im 1.26e+133) (- t_2 t_0) (- t_2 (/ x.re y.im)))))))))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 = y_46_im / (pow(hypot(y_46_re, y_46_im), 2.0) / x_46_re);
double t_1 = 1.0 / hypot(y_46_re, y_46_im);
double t_2 = t_1 * (y_46_re / (hypot(y_46_re, y_46_im) / x_46_im));
double t_3 = (y_46_re / hypot(y_46_im, y_46_re)) / (hypot(y_46_im, y_46_re) / x_46_im);
double tmp;
if (y_46_im <= -6e+97) {
tmp = t_3 - (x_46_re / y_46_im);
} else if (y_46_im <= -1e-150) {
tmp = t_3 - t_0;
} else if (y_46_im <= 3.9e-218) {
tmp = (x_46_im / y_46_re) - (x_46_re / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 3.2e-98) {
tmp = t_1 * (((y_46_re * x_46_im) - (y_46_im * x_46_re)) / hypot(y_46_re, y_46_im));
} else if (y_46_im <= 1.26e+133) {
tmp = t_2 - t_0;
} else {
tmp = t_2 - (x_46_re / y_46_im);
}
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 = y_46_im / (Math.pow(Math.hypot(y_46_re, y_46_im), 2.0) / x_46_re);
double t_1 = 1.0 / Math.hypot(y_46_re, y_46_im);
double t_2 = t_1 * (y_46_re / (Math.hypot(y_46_re, y_46_im) / x_46_im));
double t_3 = (y_46_re / Math.hypot(y_46_im, y_46_re)) / (Math.hypot(y_46_im, y_46_re) / x_46_im);
double tmp;
if (y_46_im <= -6e+97) {
tmp = t_3 - (x_46_re / y_46_im);
} else if (y_46_im <= -1e-150) {
tmp = t_3 - t_0;
} else if (y_46_im <= 3.9e-218) {
tmp = (x_46_im / y_46_re) - (x_46_re / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 3.2e-98) {
tmp = t_1 * (((y_46_re * x_46_im) - (y_46_im * x_46_re)) / Math.hypot(y_46_re, y_46_im));
} else if (y_46_im <= 1.26e+133) {
tmp = t_2 - t_0;
} else {
tmp = t_2 - (x_46_re / y_46_im);
}
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 = y_46_im / (math.pow(math.hypot(y_46_re, y_46_im), 2.0) / x_46_re) t_1 = 1.0 / math.hypot(y_46_re, y_46_im) t_2 = t_1 * (y_46_re / (math.hypot(y_46_re, y_46_im) / x_46_im)) t_3 = (y_46_re / math.hypot(y_46_im, y_46_re)) / (math.hypot(y_46_im, y_46_re) / x_46_im) tmp = 0 if y_46_im <= -6e+97: tmp = t_3 - (x_46_re / y_46_im) elif y_46_im <= -1e-150: tmp = t_3 - t_0 elif y_46_im <= 3.9e-218: tmp = (x_46_im / y_46_re) - (x_46_re / (y_46_re * (y_46_re / y_46_im))) elif y_46_im <= 3.2e-98: tmp = t_1 * (((y_46_re * x_46_im) - (y_46_im * x_46_re)) / math.hypot(y_46_re, y_46_im)) elif y_46_im <= 1.26e+133: tmp = t_2 - t_0 else: tmp = t_2 - (x_46_re / y_46_im) 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(y_46_im / Float64((hypot(y_46_re, y_46_im) ^ 2.0) / x_46_re)) t_1 = Float64(1.0 / hypot(y_46_re, y_46_im)) t_2 = Float64(t_1 * Float64(y_46_re / Float64(hypot(y_46_re, y_46_im) / x_46_im))) t_3 = Float64(Float64(y_46_re / hypot(y_46_im, y_46_re)) / Float64(hypot(y_46_im, y_46_re) / x_46_im)) tmp = 0.0 if (y_46_im <= -6e+97) tmp = Float64(t_3 - Float64(x_46_re / y_46_im)); elseif (y_46_im <= -1e-150) tmp = Float64(t_3 - t_0); elseif (y_46_im <= 3.9e-218) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re / Float64(y_46_re * Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 3.2e-98) tmp = Float64(t_1 * Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / hypot(y_46_re, y_46_im))); elseif (y_46_im <= 1.26e+133) tmp = Float64(t_2 - t_0); else tmp = Float64(t_2 - Float64(x_46_re / y_46_im)); 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 = y_46_im / ((hypot(y_46_re, y_46_im) ^ 2.0) / x_46_re); t_1 = 1.0 / hypot(y_46_re, y_46_im); t_2 = t_1 * (y_46_re / (hypot(y_46_re, y_46_im) / x_46_im)); t_3 = (y_46_re / hypot(y_46_im, y_46_re)) / (hypot(y_46_im, y_46_re) / x_46_im); tmp = 0.0; if (y_46_im <= -6e+97) tmp = t_3 - (x_46_re / y_46_im); elseif (y_46_im <= -1e-150) tmp = t_3 - t_0; elseif (y_46_im <= 3.9e-218) tmp = (x_46_im / y_46_re) - (x_46_re / (y_46_re * (y_46_re / y_46_im))); elseif (y_46_im <= 3.2e-98) tmp = t_1 * (((y_46_re * x_46_im) - (y_46_im * x_46_re)) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= 1.26e+133) tmp = t_2 - t_0; else tmp = t_2 - (x_46_re / y_46_im); 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[(y$46$im / N[(N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(y$46$re / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6e+97], N[(t$95$3 - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1e-150], N[(t$95$3 - t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 3.9e-218], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(x$46$re / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.2e-98], N[(t$95$1 * N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.26e+133], N[(t$95$2 - t$95$0), $MachinePrecision], N[(t$95$2 - N[(x$46$re / y$46$im), $MachinePrecision]), $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{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}\\
t_1 := \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_2 := t_1 \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}}\\
t_3 := \frac{\frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{x.im}}\\
\mathbf{if}\;y.im \leq -6 \cdot 10^{+97}:\\
\;\;\;\;t_3 - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -1 \cdot 10^{-150}:\\
\;\;\;\;t_3 - t_0\\
\mathbf{elif}\;y.im \leq 3.9 \cdot 10^{-218}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{x.re}{y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{-98}:\\
\;\;\;\;t_1 \cdot \frac{y.re \cdot x.im - y.im \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq 1.26 \cdot 10^{+133}:\\
\;\;\;\;t_2 - t_0\\
\mathbf{else}:\\
\;\;\;\;t_2 - \frac{x.re}{y.im}\\
\end{array}
Results
if y.im < -5.9999999999999997e97Initial program 39.5%
Applied egg-rr50.4%
[Start]39.5 | \[ \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
|---|---|
div-sub [=>]39.5 | \[ \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}
\] |
*-un-lft-identity [=>]39.5 | \[ \frac{\color{blue}{1 \cdot \left(x.im \cdot y.re\right)}}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
add-sqr-sqrt [=>]39.5 | \[ \frac{1 \cdot \left(x.im \cdot y.re\right)}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
times-frac [=>]39.5 | \[ \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
fma-neg [=>]39.5 | \[ \color{blue}{\mathsf{fma}\left(\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)}
\] |
hypot-def [=>]39.5 | \[ \mathsf{fma}\left(\frac{1}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}}, \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)
\] |
hypot-def [=>]46.0 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)
\] |
associate-/l* [=>]50.4 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\color{blue}{\frac{x.re}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.im}}}\right)
\] |
add-sqr-sqrt [=>]50.4 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{y.im}}\right)
\] |
pow2 [=>]50.4 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}{y.im}}\right)
\] |
hypot-def [=>]50.4 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}{y.im}}\right)
\] |
Simplified57.5%
[Start]50.4 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}\right)
\] |
|---|---|
fma-neg [<=]50.4 | \[ \color{blue}{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}}
\] |
*-commutative [<=]50.4 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\color{blue}{y.re \cdot x.im}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}
\] |
associate-/l* [=>]60.4 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \color{blue}{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}}} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}
\] |
associate-/l* [<=]53.5 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \color{blue}{\frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}}
\] |
*-commutative [=>]53.5 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{\color{blue}{y.im \cdot x.re}}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}
\] |
associate-/l* [=>]57.5 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \color{blue}{\frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}}
\] |
Applied egg-rr57.1%
[Start]57.5 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
|---|---|
*-commutative [=>]57.5 | \[ \color{blue}{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} \cdot \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
associate-*l/ [=>]57.1 | \[ \color{blue}{\frac{y.re \cdot \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
div-inv [<=]57.1 | \[ \frac{\color{blue}{\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
hypot-udef [=>]42.1 | \[ \frac{\frac{y.re}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
+-commutative [=>]42.1 | \[ \frac{\frac{y.re}{\sqrt{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}}}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
hypot-def [=>]57.1 | \[ \frac{\frac{y.re}{\color{blue}{\mathsf{hypot}\left(y.im, y.re\right)}}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
hypot-udef [=>]42.1 | \[ \frac{\frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
+-commutative [=>]42.1 | \[ \frac{\frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\sqrt{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}}}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
hypot-def [=>]57.1 | \[ \frac{\frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\color{blue}{\mathsf{hypot}\left(y.im, y.re\right)}}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
Taylor expanded in y.im around inf 89.5%
if -5.9999999999999997e97 < y.im < -1.00000000000000001e-150Initial program 76.3%
Applied egg-rr84.3%
[Start]76.3 | \[ \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
|---|---|
div-sub [=>]76.3 | \[ \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}
\] |
*-un-lft-identity [=>]76.3 | \[ \frac{\color{blue}{1 \cdot \left(x.im \cdot y.re\right)}}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
add-sqr-sqrt [=>]76.3 | \[ \frac{1 \cdot \left(x.im \cdot y.re\right)}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
times-frac [=>]76.3 | \[ \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
fma-neg [=>]76.3 | \[ \color{blue}{\mathsf{fma}\left(\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)}
\] |
hypot-def [=>]76.3 | \[ \mathsf{fma}\left(\frac{1}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}}, \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)
\] |
hypot-def [=>]81.7 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)
\] |
associate-/l* [=>]84.3 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\color{blue}{\frac{x.re}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.im}}}\right)
\] |
add-sqr-sqrt [=>]84.3 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{y.im}}\right)
\] |
pow2 [=>]84.3 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}{y.im}}\right)
\] |
hypot-def [=>]84.3 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}{y.im}}\right)
\] |
Simplified91.0%
[Start]84.3 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}\right)
\] |
|---|---|
fma-neg [<=]84.3 | \[ \color{blue}{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}}
\] |
*-commutative [<=]84.3 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\color{blue}{y.re \cdot x.im}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}
\] |
associate-/l* [=>]94.4 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \color{blue}{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}}} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}
\] |
associate-/l* [<=]91.6 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \color{blue}{\frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}}
\] |
*-commutative [=>]91.6 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{\color{blue}{y.im \cdot x.re}}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}
\] |
associate-/l* [=>]91.0 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \color{blue}{\frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}}
\] |
Applied egg-rr91.0%
[Start]91.0 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
|---|---|
*-commutative [=>]91.0 | \[ \color{blue}{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} \cdot \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
associate-*l/ [=>]90.9 | \[ \color{blue}{\frac{y.re \cdot \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
div-inv [<=]91.0 | \[ \frac{\color{blue}{\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
hypot-udef [=>]77.1 | \[ \frac{\frac{y.re}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
+-commutative [=>]77.1 | \[ \frac{\frac{y.re}{\sqrt{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}}}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
hypot-def [=>]91.0 | \[ \frac{\frac{y.re}{\color{blue}{\mathsf{hypot}\left(y.im, y.re\right)}}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
hypot-udef [=>]77.1 | \[ \frac{\frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
+-commutative [=>]77.1 | \[ \frac{\frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\sqrt{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}}}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
hypot-def [=>]91.0 | \[ \frac{\frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\color{blue}{\mathsf{hypot}\left(y.im, y.re\right)}}{x.im}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}
\] |
if -1.00000000000000001e-150 < y.im < 3.9e-218Initial program 60.9%
Simplified60.9%
[Start]60.9 | \[ \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
|---|---|
fma-def [=>]60.9 | \[ \frac{x.im \cdot y.re - x.re \cdot y.im}{\color{blue}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}}
\] |
Taylor expanded in y.re around inf 84.1%
Simplified89.5%
[Start]84.1 | \[ \frac{x.im}{y.re} + -1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}}
\] |
|---|---|
mul-1-neg [=>]84.1 | \[ \frac{x.im}{y.re} + \color{blue}{\left(-\frac{x.re \cdot y.im}{{y.re}^{2}}\right)}
\] |
unsub-neg [=>]84.1 | \[ \color{blue}{\frac{x.im}{y.re} - \frac{x.re \cdot y.im}{{y.re}^{2}}}
\] |
unpow2 [=>]84.1 | \[ \frac{x.im}{y.re} - \frac{x.re \cdot y.im}{\color{blue}{y.re \cdot y.re}}
\] |
times-frac [=>]89.5 | \[ \frac{x.im}{y.re} - \color{blue}{\frac{x.re}{y.re} \cdot \frac{y.im}{y.re}}
\] |
Applied egg-rr91.3%
[Start]89.5 | \[ \frac{x.im}{y.re} - \frac{x.re}{y.re} \cdot \frac{y.im}{y.re}
\] |
|---|---|
*-commutative [=>]89.5 | \[ \frac{x.im}{y.re} - \color{blue}{\frac{y.im}{y.re} \cdot \frac{x.re}{y.re}}
\] |
clear-num [=>]89.2 | \[ \frac{x.im}{y.re} - \color{blue}{\frac{1}{\frac{y.re}{y.im}}} \cdot \frac{x.re}{y.re}
\] |
frac-times [=>]91.3 | \[ \frac{x.im}{y.re} - \color{blue}{\frac{1 \cdot x.re}{\frac{y.re}{y.im} \cdot y.re}}
\] |
*-un-lft-identity [<=]91.3 | \[ \frac{x.im}{y.re} - \frac{\color{blue}{x.re}}{\frac{y.re}{y.im} \cdot y.re}
\] |
if 3.9e-218 < y.im < 3.2000000000000001e-98Initial program 66.4%
Applied egg-rr79.9%
[Start]66.4 | \[ \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
|---|---|
*-un-lft-identity [=>]66.4 | \[ \frac{\color{blue}{1 \cdot \left(x.im \cdot y.re - x.re \cdot y.im\right)}}{y.re \cdot y.re + y.im \cdot y.im}
\] |
add-sqr-sqrt [=>]66.4 | \[ \frac{1 \cdot \left(x.im \cdot y.re - x.re \cdot y.im\right)}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}
\] |
times-frac [=>]66.4 | \[ \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}
\] |
hypot-def [=>]66.4 | \[ \frac{1}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \cdot \frac{x.im \cdot y.re - x.re \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}
\] |
hypot-def [=>]79.9 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.im \cdot y.re - x.re \cdot y.im}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}}
\] |
if 3.2000000000000001e-98 < y.im < 1.2599999999999999e133Initial program 71.6%
Applied egg-rr79.9%
[Start]71.6 | \[ \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
|---|---|
div-sub [=>]71.6 | \[ \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}
\] |
*-un-lft-identity [=>]71.6 | \[ \frac{\color{blue}{1 \cdot \left(x.im \cdot y.re\right)}}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
add-sqr-sqrt [=>]71.6 | \[ \frac{1 \cdot \left(x.im \cdot y.re\right)}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
times-frac [=>]71.6 | \[ \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
fma-neg [=>]71.6 | \[ \color{blue}{\mathsf{fma}\left(\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)}
\] |
hypot-def [=>]71.6 | \[ \mathsf{fma}\left(\frac{1}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}}, \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)
\] |
hypot-def [=>]75.4 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)
\] |
associate-/l* [=>]79.9 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\color{blue}{\frac{x.re}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.im}}}\right)
\] |
add-sqr-sqrt [=>]79.9 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{y.im}}\right)
\] |
pow2 [=>]79.9 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}{y.im}}\right)
\] |
hypot-def [=>]79.9 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}{y.im}}\right)
\] |
Simplified91.0%
[Start]79.9 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}\right)
\] |
|---|---|
fma-neg [<=]79.9 | \[ \color{blue}{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}}
\] |
*-commutative [<=]79.9 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\color{blue}{y.re \cdot x.im}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}
\] |
associate-/l* [=>]94.0 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \color{blue}{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}}} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}
\] |
associate-/l* [<=]88.7 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \color{blue}{\frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}}
\] |
*-commutative [=>]88.7 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{\color{blue}{y.im \cdot x.re}}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}
\] |
associate-/l* [=>]91.0 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \color{blue}{\frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}}
\] |
if 1.2599999999999999e133 < y.im Initial program 32.5%
Applied egg-rr43.1%
[Start]32.5 | \[ \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
|---|---|
div-sub [=>]32.5 | \[ \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}}
\] |
*-un-lft-identity [=>]32.5 | \[ \frac{\color{blue}{1 \cdot \left(x.im \cdot y.re\right)}}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
add-sqr-sqrt [=>]32.5 | \[ \frac{1 \cdot \left(x.im \cdot y.re\right)}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
times-frac [=>]32.5 | \[ \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\] |
fma-neg [=>]32.5 | \[ \color{blue}{\mathsf{fma}\left(\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)}
\] |
hypot-def [=>]32.5 | \[ \mathsf{fma}\left(\frac{1}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}}, \frac{x.im \cdot y.re}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)
\] |
hypot-def [=>]39.9 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}}, -\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)
\] |
associate-/l* [=>]43.1 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\color{blue}{\frac{x.re}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.im}}}\right)
\] |
add-sqr-sqrt [=>]43.1 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{y.im}}\right)
\] |
pow2 [=>]43.1 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}{y.im}}\right)
\] |
hypot-def [=>]43.1 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}{y.im}}\right)
\] |
Simplified51.4%
[Start]43.1 | \[ \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, -\frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}\right)
\] |
|---|---|
fma-neg [<=]43.1 | \[ \color{blue}{\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}}
\] |
*-commutative [<=]43.1 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\color{blue}{y.re \cdot x.im}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}
\] |
associate-/l* [=>]52.7 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \color{blue}{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}}} - \frac{x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}
\] |
associate-/l* [<=]47.4 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \color{blue}{\frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}}
\] |
*-commutative [=>]47.4 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{\color{blue}{y.im \cdot x.re}}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}
\] |
associate-/l* [=>]51.4 | \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \color{blue}{\frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}}
\] |
Taylor expanded in y.im around inf 91.8%
Final simplification89.9%
| Alternative 1 | |
|---|---|
| Accuracy | 89.8% |
| Cost | 27348 |
| Alternative 2 | |
|---|---|
| Accuracy | 86.7% |
| Cost | 14288 |
| Alternative 3 | |
|---|---|
| Accuracy | 86.8% |
| Cost | 14288 |
| Alternative 4 | |
|---|---|
| Accuracy | 83.4% |
| Cost | 14028 |
| Alternative 5 | |
|---|---|
| Accuracy | 81.0% |
| Cost | 7960 |
| Alternative 6 | |
|---|---|
| Accuracy | 80.8% |
| Cost | 1752 |
| Alternative 7 | |
|---|---|
| Accuracy | 74.3% |
| Cost | 1497 |
| Alternative 8 | |
|---|---|
| Accuracy | 74.6% |
| Cost | 1232 |
| Alternative 9 | |
|---|---|
| Accuracy | 73.5% |
| Cost | 1170 |
| Alternative 10 | |
|---|---|
| Accuracy | 69.4% |
| Cost | 841 |
| Alternative 11 | |
|---|---|
| Accuracy | 63.8% |
| Cost | 520 |
| Alternative 12 | |
|---|---|
| Accuracy | 41.8% |
| Cost | 192 |
herbie shell --seed 2023151
(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))))