
(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))))
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));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
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));
}
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))
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 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
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]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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))))
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));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
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));
}
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))
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 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
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]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im) :precision binary64 (fma (/ y.re (hypot y.re y.im)) (/ x.im (hypot y.re y.im)) (* x.re (/ (/ y.im (hypot y.im y.re)) (- (hypot y.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), (x_46_re * ((y_46_im / hypot(y_46_im, y_46_re)) / -hypot(y_46_im, y_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(x_46_re * Float64(Float64(y_46_im / hypot(y_46_im, y_46_re)) / Float64(-hypot(y_46_im, y_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(y$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] / (-N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, x.re \cdot \frac{\frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)}}{-\mathsf{hypot}\left(y.im, y.re\right)}\right)
\end{array}
Initial program 62.6%
fma-neg62.6%
distribute-rgt-neg-out62.6%
+-commutative62.6%
fma-define62.6%
Simplified62.6%
distribute-rgt-neg-out62.6%
fma-neg62.6%
fma-undefine62.6%
+-commutative62.6%
div-sub58.6%
*-commutative58.6%
add-sqr-sqrt58.6%
times-frac60.3%
fma-neg60.3%
hypot-define60.3%
hypot-define73.7%
associate-/l*76.7%
add-sqr-sqrt76.7%
pow276.7%
Applied egg-rr76.7%
*-un-lft-identity76.7%
unpow276.7%
times-frac95.5%
Applied egg-rr95.5%
associate-*l/95.5%
*-lft-identity95.5%
hypot-undefine76.7%
unpow276.7%
unpow276.7%
+-commutative76.7%
unpow276.7%
unpow276.7%
hypot-define95.5%
hypot-undefine76.7%
unpow276.7%
unpow276.7%
+-commutative76.7%
unpow276.7%
unpow276.7%
hypot-define95.5%
Simplified95.5%
Final simplification95.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ y.re (hypot y.re y.im)))
(t_1 (/ x.im (hypot y.re y.im)))
(t_2 (fma t_0 t_1 (* x.re (/ y.im (- (pow (hypot y.re y.im) 2.0))))))
(t_3 (fma t_0 t_1 (/ x.re (- y.im)))))
(if (<= y.im -5.5e+111)
t_3
(if (<= y.im -1.6e-120)
t_2
(if (<= y.im 1.6e-168)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 6.9e+136) t_2 t_3))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re / hypot(y_46_re, y_46_im);
double t_1 = x_46_im / hypot(y_46_re, y_46_im);
double t_2 = fma(t_0, t_1, (x_46_re * (y_46_im / -pow(hypot(y_46_re, y_46_im), 2.0))));
double t_3 = fma(t_0, t_1, (x_46_re / -y_46_im));
double tmp;
if (y_46_im <= -5.5e+111) {
tmp = t_3;
} else if (y_46_im <= -1.6e-120) {
tmp = t_2;
} else if (y_46_im <= 1.6e-168) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 6.9e+136) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re / hypot(y_46_re, y_46_im)) t_1 = Float64(x_46_im / hypot(y_46_re, y_46_im)) t_2 = fma(t_0, t_1, Float64(x_46_re * Float64(y_46_im / Float64(-(hypot(y_46_re, y_46_im) ^ 2.0))))) t_3 = fma(t_0, t_1, Float64(x_46_re / Float64(-y_46_im))) tmp = 0.0 if (y_46_im <= -5.5e+111) tmp = t_3; elseif (y_46_im <= -1.6e-120) tmp = t_2; elseif (y_46_im <= 1.6e-168) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 6.9e+136) tmp = t_2; else tmp = t_3; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * t$95$1 + N[(x$46$re * N[(y$46$im / (-N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * t$95$1 + N[(x$46$re / (-y$46$im)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5.5e+111], t$95$3, If[LessEqual[y$46$im, -1.6e-120], t$95$2, If[LessEqual[y$46$im, 1.6e-168], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 6.9e+136], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_2 := \mathsf{fma}\left(t\_0, t\_1, x.re \cdot \frac{y.im}{-{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)\\
t_3 := \mathsf{fma}\left(t\_0, t\_1, \frac{x.re}{-y.im}\right)\\
\mathbf{if}\;y.im \leq -5.5 \cdot 10^{+111}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.im \leq -1.6 \cdot 10^{-120}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{-168}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 6.9 \cdot 10^{+136}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y.im < -5.4999999999999998e111 or 6.9e136 < y.im Initial program 36.2%
fma-neg36.2%
distribute-rgt-neg-out36.2%
+-commutative36.2%
fma-define36.2%
Simplified36.2%
distribute-rgt-neg-out36.2%
fma-neg36.2%
fma-undefine36.2%
+-commutative36.2%
div-sub36.2%
*-commutative36.2%
add-sqr-sqrt36.2%
times-frac36.5%
fma-neg36.5%
hypot-define36.5%
hypot-define45.1%
associate-/l*50.0%
add-sqr-sqrt50.0%
pow250.0%
Applied egg-rr50.0%
Taylor expanded in y.im around inf 96.4%
if -5.4999999999999998e111 < y.im < -1.6e-120 or 1.60000000000000003e-168 < y.im < 6.9e136Initial program 77.8%
fma-neg77.8%
distribute-rgt-neg-out77.8%
+-commutative77.8%
fma-define77.8%
Simplified77.8%
distribute-rgt-neg-out77.8%
fma-neg77.8%
fma-undefine77.8%
+-commutative77.8%
div-sub76.9%
*-commutative76.9%
add-sqr-sqrt76.9%
times-frac77.5%
fma-neg77.5%
hypot-define77.5%
hypot-define90.1%
associate-/l*94.7%
add-sqr-sqrt94.7%
pow294.7%
Applied egg-rr94.7%
if -1.6e-120 < y.im < 1.60000000000000003e-168Initial program 68.4%
fma-neg68.4%
distribute-rgt-neg-out68.4%
+-commutative68.4%
fma-define68.4%
Simplified68.4%
Taylor expanded in y.re around inf 91.8%
associate-*r/91.8%
neg-mul-191.8%
distribute-lft-neg-in91.8%
Simplified91.8%
Final simplification94.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(/ x.re (- y.im)))))
(if (<= y.im -1.55e-34)
t_0
(if (<= y.im 4.8e-117)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1e+29)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), (x_46_re / -y_46_im));
double tmp;
if (y_46_im <= -1.55e-34) {
tmp = t_0;
} else if (y_46_im <= 4.8e-117) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1e+29) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(x_46_re / Float64(-y_46_im))) tmp = 0.0 if (y_46_im <= -1.55e-34) tmp = t_0; elseif (y_46_im <= 4.8e-117) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 1e+29) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(x$46$re / (-y$46$im)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.55e-34], t$95$0, If[LessEqual[y$46$im, 4.8e-117], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1e+29], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.re}{-y.im}\right)\\
\mathbf{if}\;y.im \leq -1.55 \cdot 10^{-34}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4.8 \cdot 10^{-117}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 10^{+29}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.5499999999999999e-34 or 9.99999999999999914e28 < y.im Initial program 50.8%
fma-neg50.8%
distribute-rgt-neg-out50.8%
+-commutative50.8%
fma-define50.8%
Simplified50.8%
distribute-rgt-neg-out50.8%
fma-neg50.8%
fma-undefine50.8%
+-commutative50.8%
div-sub50.8%
*-commutative50.8%
add-sqr-sqrt50.9%
times-frac52.7%
fma-neg52.7%
hypot-define52.7%
hypot-define61.9%
associate-/l*67.3%
add-sqr-sqrt67.3%
pow267.3%
Applied egg-rr67.3%
Taylor expanded in y.im around inf 91.4%
if -1.5499999999999999e-34 < y.im < 4.80000000000000028e-117Initial program 68.9%
fma-neg68.9%
distribute-rgt-neg-out68.9%
+-commutative68.9%
fma-define68.9%
Simplified68.9%
Taylor expanded in y.re around inf 91.0%
associate-*r/91.0%
neg-mul-191.0%
distribute-lft-neg-in91.0%
Simplified91.0%
if 4.80000000000000028e-117 < y.im < 9.99999999999999914e28Initial program 87.6%
Final simplification90.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -3.1e-12)
(fma (/ y.re (hypot y.re y.im)) (/ x.im (- y.im)) (/ x.re (- y.im)))
(if (<= y.im 1.7e-113)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1.8e+29)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(- (* x.im (/ (/ y.re y.im) y.im)) (/ x.re y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -3.1e-12) {
tmp = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / -y_46_im), (x_46_re / -y_46_im));
} else if (y_46_im <= 1.7e-113) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.8e+29) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (x_46_re / y_46_im);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -3.1e-12) tmp = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / Float64(-y_46_im)), Float64(x_46_re / Float64(-y_46_im))); elseif (y_46_im <= 1.7e-113) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 1.8e+29) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(x_46_im * Float64(Float64(y_46_re / y_46_im) / y_46_im)) - Float64(x_46_re / y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -3.1e-12], N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / (-y$46$im)), $MachinePrecision] + N[(x$46$re / (-y$46$im)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.7e-113], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.8e+29], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * N[(N[(y$46$re / y$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.1 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{-y.im}, \frac{x.re}{-y.im}\right)\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{-113}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+29}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \frac{\frac{y.re}{y.im}}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -3.1000000000000001e-12Initial program 46.1%
fma-neg46.1%
distribute-rgt-neg-out46.1%
+-commutative46.1%
fma-define46.2%
Simplified46.2%
distribute-rgt-neg-out46.2%
fma-neg46.2%
fma-undefine46.1%
+-commutative46.1%
div-sub46.1%
*-commutative46.1%
add-sqr-sqrt46.2%
times-frac49.4%
fma-neg49.4%
hypot-define49.4%
hypot-define62.1%
associate-/l*64.3%
add-sqr-sqrt64.3%
pow264.3%
Applied egg-rr64.3%
Taylor expanded in y.im around inf 91.3%
Taylor expanded in y.im around -inf 84.2%
associate-*r/84.2%
neg-mul-184.2%
Simplified84.2%
if -3.1000000000000001e-12 < y.im < 1.7000000000000001e-113Initial program 69.4%
fma-neg69.4%
distribute-rgt-neg-out69.4%
+-commutative69.4%
fma-define69.4%
Simplified69.4%
Taylor expanded in y.re around inf 89.4%
associate-*r/89.4%
neg-mul-189.4%
distribute-lft-neg-in89.4%
Simplified89.4%
if 1.7000000000000001e-113 < y.im < 1.79999999999999988e29Initial program 87.6%
if 1.79999999999999988e29 < y.im Initial program 54.2%
fma-neg54.2%
distribute-rgt-neg-out54.2%
+-commutative54.2%
fma-define54.1%
Simplified54.1%
distribute-rgt-neg-out54.1%
fma-neg54.1%
fma-undefine54.2%
+-commutative54.2%
div-sub54.2%
*-commutative54.2%
add-sqr-sqrt54.2%
times-frac54.4%
fma-neg54.4%
hypot-define54.4%
hypot-define58.0%
associate-/l*68.0%
add-sqr-sqrt68.0%
pow268.0%
Applied egg-rr68.0%
Taylor expanded in y.re around 0 89.6%
associate-/l*89.7%
Simplified89.7%
*-un-lft-identity89.7%
unpow289.7%
times-frac89.9%
Applied egg-rr89.9%
associate-*l/89.9%
*-lft-identity89.9%
Simplified89.9%
Final simplification87.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5e-10)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im 1.2e-117)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1.8e+29)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(- (* x.im (/ (/ y.re y.im) y.im)) (/ x.re y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5e-10) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 1.2e-117) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.8e+29) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (x_46_re / y_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46im <= (-5d-10)) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else if (y_46im <= 1.2d-117) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if (y_46im <= 1.8d+29) then
tmp = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
else
tmp = (x_46im * ((y_46re / y_46im) / y_46im)) - (x_46re / y_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5e-10) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 1.2e-117) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.8e+29) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (x_46_re / y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -5e-10: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= 1.2e-117: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_im <= 1.8e+29: tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) else: tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (x_46_re / y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -5e-10) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= 1.2e-117) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 1.8e+29) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(x_46_im * Float64(Float64(y_46_re / y_46_im) / y_46_im)) - Float64(x_46_re / y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -5e-10) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= 1.2e-117) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_im <= 1.8e+29) tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); else tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (x_46_re / y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -5e-10], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.2e-117], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.8e+29], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * N[(N[(y$46$re / y$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5 \cdot 10^{-10}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 1.2 \cdot 10^{-117}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+29}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \frac{\frac{y.re}{y.im}}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -5.00000000000000031e-10Initial program 46.1%
fma-neg46.1%
distribute-rgt-neg-out46.1%
+-commutative46.1%
fma-define46.2%
Simplified46.2%
Taylor expanded in y.re around 0 75.1%
+-commutative75.1%
mul-1-neg75.1%
unsub-neg75.1%
unpow275.1%
associate-/r*76.7%
div-sub76.7%
*-commutative76.7%
associate-/l*83.9%
Simplified83.9%
if -5.00000000000000031e-10 < y.im < 1.20000000000000007e-117Initial program 69.4%
fma-neg69.4%
distribute-rgt-neg-out69.4%
+-commutative69.4%
fma-define69.4%
Simplified69.4%
Taylor expanded in y.re around inf 89.4%
associate-*r/89.4%
neg-mul-189.4%
distribute-lft-neg-in89.4%
Simplified89.4%
if 1.20000000000000007e-117 < y.im < 1.79999999999999988e29Initial program 87.6%
if 1.79999999999999988e29 < y.im Initial program 54.2%
fma-neg54.2%
distribute-rgt-neg-out54.2%
+-commutative54.2%
fma-define54.1%
Simplified54.1%
distribute-rgt-neg-out54.1%
fma-neg54.1%
fma-undefine54.2%
+-commutative54.2%
div-sub54.2%
*-commutative54.2%
add-sqr-sqrt54.2%
times-frac54.4%
fma-neg54.4%
hypot-define54.4%
hypot-define58.0%
associate-/l*68.0%
add-sqr-sqrt68.0%
pow268.0%
Applied egg-rr68.0%
Taylor expanded in y.re around 0 89.6%
associate-/l*89.7%
Simplified89.7%
*-un-lft-identity89.7%
unpow289.7%
times-frac89.9%
Applied egg-rr89.9%
associate-*l/89.9%
*-lft-identity89.9%
Simplified89.9%
Final simplification87.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.5e-9)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im 1.02e-7)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(- (* x.im (/ (/ y.re y.im) y.im)) (/ x.re y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5.5e-9) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 1.02e-7) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else {
tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (x_46_re / y_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46im <= (-5.5d-9)) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else if (y_46im <= 1.02d-7) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else
tmp = (x_46im * ((y_46re / y_46im) / y_46im)) - (x_46re / y_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5.5e-9) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 1.02e-7) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else {
tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (x_46_re / y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -5.5e-9: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= 1.02e-7: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re else: tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (x_46_re / y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -5.5e-9) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= 1.02e-7) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); else tmp = Float64(Float64(x_46_im * Float64(Float64(y_46_re / y_46_im) / y_46_im)) - Float64(x_46_re / y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -5.5e-9) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= 1.02e-7) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; else tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (x_46_re / y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -5.5e-9], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.02e-7], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(x$46$im * N[(N[(y$46$re / y$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 1.02 \cdot 10^{-7}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \frac{\frac{y.re}{y.im}}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -5.4999999999999996e-9Initial program 46.1%
fma-neg46.1%
distribute-rgt-neg-out46.1%
+-commutative46.1%
fma-define46.2%
Simplified46.2%
Taylor expanded in y.re around 0 75.1%
+-commutative75.1%
mul-1-neg75.1%
unsub-neg75.1%
unpow275.1%
associate-/r*76.7%
div-sub76.7%
*-commutative76.7%
associate-/l*83.9%
Simplified83.9%
if -5.4999999999999996e-9 < y.im < 1.02e-7Initial program 72.0%
fma-neg72.0%
distribute-rgt-neg-out72.0%
+-commutative72.0%
fma-define72.0%
Simplified72.0%
Taylor expanded in y.re around inf 84.6%
associate-*r/84.6%
neg-mul-184.6%
distribute-lft-neg-in84.6%
Simplified84.6%
if 1.02e-7 < y.im Initial program 60.8%
fma-neg60.8%
distribute-rgt-neg-out60.8%
+-commutative60.8%
fma-define60.8%
Simplified60.8%
distribute-rgt-neg-out60.8%
fma-neg60.8%
fma-undefine60.8%
+-commutative60.8%
div-sub60.8%
*-commutative60.8%
add-sqr-sqrt60.8%
times-frac61.0%
fma-neg61.0%
hypot-define61.0%
hypot-define64.1%
associate-/l*72.6%
add-sqr-sqrt72.6%
pow272.6%
Applied egg-rr72.6%
Taylor expanded in y.re around 0 87.9%
associate-/l*88.1%
Simplified88.1%
*-un-lft-identity88.1%
unpow288.1%
times-frac88.2%
Applied egg-rr88.2%
associate-*l/88.2%
*-lft-identity88.2%
Simplified88.2%
Final simplification85.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -5.8e-11) (not (<= y.im 5.2e-8))) (/ (- (* y.re (/ x.im y.im)) x.re) y.im) (/ (- x.im (/ (* y.im x.re) y.re)) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -5.8e-11) || !(y_46_im <= 5.2e-8)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-5.8d-11)) .or. (.not. (y_46im <= 5.2d-8))) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -5.8e-11) || !(y_46_im <= 5.2e-8)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -5.8e-11) or not (y_46_im <= 5.2e-8): tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -5.8e-11) || !(y_46_im <= 5.2e-8)) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -5.8e-11) || ~((y_46_im <= 5.2e-8))) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -5.8e-11], N[Not[LessEqual[y$46$im, 5.2e-8]], $MachinePrecision]], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.8 \cdot 10^{-11} \lor \neg \left(y.im \leq 5.2 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -5.8e-11 or 5.2000000000000002e-8 < y.im Initial program 53.1%
fma-neg53.1%
distribute-rgt-neg-out53.1%
+-commutative53.1%
fma-define53.1%
Simplified53.1%
Taylor expanded in y.re around 0 81.2%
+-commutative81.2%
mul-1-neg81.2%
unsub-neg81.2%
unpow281.2%
associate-/r*82.1%
div-sub82.1%
*-commutative82.1%
associate-/l*85.9%
Simplified85.9%
if -5.8e-11 < y.im < 5.2000000000000002e-8Initial program 72.0%
fma-neg72.0%
distribute-rgt-neg-out72.0%
+-commutative72.0%
fma-define72.0%
Simplified72.0%
Taylor expanded in y.re around inf 84.6%
associate-*r/84.6%
neg-mul-184.6%
distribute-lft-neg-in84.6%
Simplified84.6%
Final simplification85.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.4e-9) (not (<= y.im 4.8e-8))) (/ (- (* y.re (/ x.im y.im)) x.re) y.im) (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.4e-9) || !(y_46_im <= 4.8e-8)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-1.4d-9)) .or. (.not. (y_46im <= 4.8d-8))) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.4e-9) || !(y_46_im <= 4.8e-8)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.4e-9) or not (y_46_im <= 4.8e-8): tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.4e-9) || !(y_46_im <= 4.8e-8)) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.4e-9) || ~((y_46_im <= 4.8e-8))) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.4e-9], N[Not[LessEqual[y$46$im, 4.8e-8]], $MachinePrecision]], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.4 \cdot 10^{-9} \lor \neg \left(y.im \leq 4.8 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -1.39999999999999992e-9 or 4.79999999999999997e-8 < y.im Initial program 53.1%
fma-neg53.1%
distribute-rgt-neg-out53.1%
+-commutative53.1%
fma-define53.1%
Simplified53.1%
Taylor expanded in y.re around 0 81.2%
+-commutative81.2%
mul-1-neg81.2%
unsub-neg81.2%
unpow281.2%
associate-/r*82.1%
div-sub82.1%
*-commutative82.1%
associate-/l*85.9%
Simplified85.9%
if -1.39999999999999992e-9 < y.im < 4.79999999999999997e-8Initial program 72.0%
fma-neg72.0%
distribute-rgt-neg-out72.0%
+-commutative72.0%
fma-define72.0%
Simplified72.0%
Taylor expanded in y.re around inf 84.6%
mul-1-neg84.6%
unsub-neg84.6%
associate-/l*83.5%
Simplified83.5%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -8.2e-11) (not (<= y.im 5.5e-8))) (/ (- (* x.im (/ y.re y.im)) x.re) y.im) (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -8.2e-11) || !(y_46_im <= 5.5e-8)) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-8.2d-11)) .or. (.not. (y_46im <= 5.5d-8))) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -8.2e-11) || !(y_46_im <= 5.5e-8)) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -8.2e-11) or not (y_46_im <= 5.5e-8): tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -8.2e-11) || !(y_46_im <= 5.5e-8)) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -8.2e-11) || ~((y_46_im <= 5.5e-8))) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -8.2e-11], N[Not[LessEqual[y$46$im, 5.5e-8]], $MachinePrecision]], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -8.2 \cdot 10^{-11} \lor \neg \left(y.im \leq 5.5 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -8.2000000000000001e-11 or 5.5000000000000003e-8 < y.im Initial program 53.1%
fma-neg53.1%
distribute-rgt-neg-out53.1%
+-commutative53.1%
fma-define53.1%
Simplified53.1%
distribute-rgt-neg-out53.1%
fma-neg53.1%
fma-undefine53.1%
+-commutative53.1%
div-sub53.1%
*-commutative53.1%
add-sqr-sqrt53.2%
times-frac54.9%
fma-neg54.9%
hypot-define54.9%
hypot-define63.1%
associate-/l*68.3%
add-sqr-sqrt68.3%
pow268.3%
Applied egg-rr68.3%
Taylor expanded in y.im around inf 82.1%
associate-/l*85.2%
Simplified85.2%
if -8.2000000000000001e-11 < y.im < 5.5000000000000003e-8Initial program 72.0%
fma-neg72.0%
distribute-rgt-neg-out72.0%
+-commutative72.0%
fma-define72.0%
Simplified72.0%
Taylor expanded in y.re around inf 84.6%
mul-1-neg84.6%
unsub-neg84.6%
associate-/l*83.5%
Simplified83.5%
Final simplification84.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -5.6e-10) (not (<= y.im 3.4e-7))) (/ x.re (- y.im)) (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -5.6e-10) || !(y_46_im <= 3.4e-7)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-5.6d-10)) .or. (.not. (y_46im <= 3.4d-7))) then
tmp = x_46re / -y_46im
else
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -5.6e-10) || !(y_46_im <= 3.4e-7)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -5.6e-10) or not (y_46_im <= 3.4e-7): tmp = x_46_re / -y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -5.6e-10) || !(y_46_im <= 3.4e-7)) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -5.6e-10) || ~((y_46_im <= 3.4e-7))) tmp = x_46_re / -y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -5.6e-10], N[Not[LessEqual[y$46$im, 3.4e-7]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.6 \cdot 10^{-10} \lor \neg \left(y.im \leq 3.4 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -5.60000000000000031e-10 or 3.39999999999999974e-7 < y.im Initial program 53.1%
fma-neg53.1%
distribute-rgt-neg-out53.1%
+-commutative53.1%
fma-define53.1%
Simplified53.1%
Taylor expanded in y.re around 0 71.0%
associate-*r/71.0%
neg-mul-171.0%
Simplified71.0%
if -5.60000000000000031e-10 < y.im < 3.39999999999999974e-7Initial program 72.0%
fma-neg72.0%
distribute-rgt-neg-out72.0%
+-commutative72.0%
fma-define72.0%
Simplified72.0%
Taylor expanded in y.re around inf 84.6%
mul-1-neg84.6%
unsub-neg84.6%
associate-/l*83.5%
Simplified83.5%
Final simplification77.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.1e-12) (not (<= y.im 2.3e-68))) (/ x.re (- y.im)) (/ x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.1e-12) || !(y_46_im <= 2.3e-68)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-1.1d-12)) .or. (.not. (y_46im <= 2.3d-68))) then
tmp = x_46re / -y_46im
else
tmp = x_46im / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.1e-12) || !(y_46_im <= 2.3e-68)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.1e-12) or not (y_46_im <= 2.3e-68): tmp = x_46_re / -y_46_im else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.1e-12) || !(y_46_im <= 2.3e-68)) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(x_46_im / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.1e-12) || ~((y_46_im <= 2.3e-68))) tmp = x_46_re / -y_46_im; else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.1e-12], N[Not[LessEqual[y$46$im, 2.3e-68]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.1 \cdot 10^{-12} \lor \neg \left(y.im \leq 2.3 \cdot 10^{-68}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.09999999999999996e-12 or 2.29999999999999997e-68 < y.im Initial program 55.9%
fma-neg55.9%
distribute-rgt-neg-out55.9%
+-commutative55.9%
fma-define55.9%
Simplified55.9%
Taylor expanded in y.re around 0 67.4%
associate-*r/67.4%
neg-mul-167.4%
Simplified67.4%
if -1.09999999999999996e-12 < y.im < 2.29999999999999997e-68Initial program 71.0%
fma-neg71.0%
distribute-rgt-neg-out71.0%
+-commutative71.0%
fma-define71.0%
Simplified71.0%
Taylor expanded in y.re around inf 64.4%
Final simplification66.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -8e+104) (not (<= y.im 1.55e+104))) (/ x.re y.im) (/ x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -8e+104) || !(y_46_im <= 1.55e+104)) {
tmp = x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-8d+104)) .or. (.not. (y_46im <= 1.55d+104))) then
tmp = x_46re / y_46im
else
tmp = x_46im / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -8e+104) || !(y_46_im <= 1.55e+104)) {
tmp = x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -8e+104) or not (y_46_im <= 1.55e+104): tmp = x_46_re / y_46_im else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -8e+104) || !(y_46_im <= 1.55e+104)) tmp = Float64(x_46_re / y_46_im); else tmp = Float64(x_46_im / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -8e+104) || ~((y_46_im <= 1.55e+104))) tmp = x_46_re / y_46_im; else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -8e+104], N[Not[LessEqual[y$46$im, 1.55e+104]], $MachinePrecision]], N[(x$46$re / y$46$im), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -8 \cdot 10^{+104} \lor \neg \left(y.im \leq 1.55 \cdot 10^{+104}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -8e104 or 1.55000000000000008e104 < y.im Initial program 38.5%
fma-neg38.5%
distribute-rgt-neg-out38.5%
+-commutative38.5%
fma-define38.4%
Simplified38.4%
Taylor expanded in y.re around 0 80.6%
associate-*r/80.6%
neg-mul-180.6%
Simplified80.6%
neg-sub080.6%
sub-neg80.6%
add-sqr-sqrt32.8%
sqrt-unprod36.5%
sqr-neg36.5%
sqrt-unprod13.9%
add-sqr-sqrt25.2%
Applied egg-rr25.2%
+-lft-identity25.2%
Simplified25.2%
if -8e104 < y.im < 1.55000000000000008e104Initial program 74.1%
fma-neg74.1%
distribute-rgt-neg-out74.1%
+-commutative74.1%
fma-define74.1%
Simplified74.1%
Taylor expanded in y.re around inf 50.6%
Final simplification42.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.re))
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;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46re
end function
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;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.re}
\end{array}
Initial program 62.6%
fma-neg62.6%
distribute-rgt-neg-out62.6%
+-commutative62.6%
fma-define62.6%
Simplified62.6%
Taylor expanded in y.re around inf 37.4%
herbie shell --seed 2024132
(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))))