
(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 14 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 (/ (- (* (/ y.re (hypot y.re y.im)) x.im) (* (/ y.im (hypot y.re y.im)) x.re)) (hypot y.re y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (((y_46_re / hypot(y_46_re, y_46_im)) * x_46_im) - ((y_46_im / hypot(y_46_re, y_46_im)) * x_46_re)) / hypot(y_46_re, y_46_im);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (((y_46_re / Math.hypot(y_46_re, y_46_im)) * x_46_im) - ((y_46_im / Math.hypot(y_46_re, y_46_im)) * x_46_re)) / Math.hypot(y_46_re, y_46_im);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return (((y_46_re / math.hypot(y_46_re, y_46_im)) * x_46_im) - ((y_46_im / math.hypot(y_46_re, y_46_im)) * x_46_re)) / math.hypot(y_46_re, y_46_im)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(Float64(y_46_re / hypot(y_46_re, y_46_im)) * x_46_im) - Float64(Float64(y_46_im / hypot(y_46_re, y_46_im)) * x_46_re)) / hypot(y_46_re, y_46_im)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = (((y_46_re / hypot(y_46_re, y_46_im)) * x_46_im) - ((y_46_im / hypot(y_46_re, y_46_im)) * x_46_re)) / hypot(y_46_re, y_46_im); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision] - N[(N[(y$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot x.im - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}
\end{array}
Initial program 60.3%
*-un-lft-identity60.3%
add-sqr-sqrt60.3%
times-frac60.3%
hypot-def60.3%
hypot-def74.4%
Applied egg-rr74.4%
div-sub74.4%
*-commutative74.4%
*-commutative74.4%
Applied egg-rr74.4%
associate-/l*85.0%
associate-/l*97.9%
Simplified97.9%
associate-*l/98.1%
*-un-lft-identity98.1%
associate-/r/98.9%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 1e+229)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re 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 t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+229) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = 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));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 1e+229) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); else tmp = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(-x_46_re) / y_46_im)); 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 * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+229], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 10^{+229}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\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)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 9.9999999999999999e228Initial program 78.8%
*-un-lft-identity78.8%
add-sqr-sqrt78.8%
times-frac78.8%
hypot-def78.8%
hypot-def96.1%
Applied egg-rr96.1%
if 9.9999999999999999e228 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 12.9%
div-sub9.8%
sub-neg9.8%
*-commutative9.8%
add-sqr-sqrt9.8%
times-frac13.7%
fma-def13.7%
hypot-def13.7%
hypot-def45.8%
associate-/l*50.2%
add-sqr-sqrt50.2%
pow250.2%
hypot-def50.2%
Applied egg-rr50.2%
Taylor expanded in y.re around 0 81.3%
Final simplification91.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ 1.0 (hypot y.re y.im))) (t_1 (- (* y.re x.im) (* y.im x.re))))
(if (<= (/ t_1 (+ (* y.re y.re) (* y.im y.im))) 5e+257)
(* t_0 (/ t_1 (hypot y.re y.im)))
(* t_0 (- (/ y.re (/ (hypot y.re y.im) x.im)) x.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 / hypot(y_46_re, y_46_im);
double t_1 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_1 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+257) {
tmp = t_0 * (t_1 / hypot(y_46_re, y_46_im));
} else {
tmp = t_0 * ((y_46_re / (hypot(y_46_re, y_46_im) / x_46_im)) - x_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 / Math.hypot(y_46_re, y_46_im);
double t_1 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_1 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+257) {
tmp = t_0 * (t_1 / Math.hypot(y_46_re, y_46_im));
} else {
tmp = t_0 * ((y_46_re / (Math.hypot(y_46_re, y_46_im) / x_46_im)) - x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = 1.0 / math.hypot(y_46_re, y_46_im) t_1 = (y_46_re * x_46_im) - (y_46_im * x_46_re) tmp = 0 if (t_1 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+257: tmp = t_0 * (t_1 / math.hypot(y_46_re, y_46_im)) else: tmp = t_0 * ((y_46_re / (math.hypot(y_46_re, y_46_im) / x_46_im)) - x_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 / hypot(y_46_re, y_46_im)) t_1 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (Float64(t_1 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 5e+257) tmp = Float64(t_0 * Float64(t_1 / hypot(y_46_re, y_46_im))); else tmp = Float64(t_0 * Float64(Float64(y_46_re / Float64(hypot(y_46_re, y_46_im) / x_46_im)) - x_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 1.0 / hypot(y_46_re, y_46_im); t_1 = (y_46_re * x_46_im) - (y_46_im * x_46_re); tmp = 0.0; if ((t_1 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+257) tmp = t_0 * (t_1 / hypot(y_46_re, y_46_im)); else tmp = t_0 * ((y_46_re / (hypot(y_46_re, y_46_im) / x_46_im)) - x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+257], N[(t$95$0 * N[(t$95$1 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(y$46$re / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;\frac{t_1}{y.re \cdot y.re + y.im \cdot y.im} \leq 5 \cdot 10^{+257}:\\
\;\;\;\;t_0 \cdot \frac{t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - x.re\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 5.00000000000000028e257Initial program 79.1%
*-un-lft-identity79.1%
add-sqr-sqrt79.0%
times-frac79.0%
hypot-def79.0%
hypot-def96.1%
Applied egg-rr96.1%
if 5.00000000000000028e257 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 10.4%
*-un-lft-identity10.4%
add-sqr-sqrt10.4%
times-frac10.4%
hypot-def10.4%
hypot-def16.7%
Applied egg-rr16.7%
div-sub16.7%
*-commutative16.7%
*-commutative16.7%
Applied egg-rr16.7%
associate-/l*54.2%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y.im around inf 77.4%
Final simplification91.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
(if (<= y.re -2.7e+109)
(* (/ 1.0 (hypot y.re y.im)) (- (/ x.re (/ y.re y.im)) x.im))
(if (<= y.re -3.1e+46)
(- (/ y.re (* y.im (/ y.im x.im))) (/ x.re y.im))
(if (<= y.re -3.4e-22)
(/ t_0 (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 3.3e-94)
(* (/ -1.0 y.im) (- x.re (/ (* y.re x.im) y.im)))
(if (<= y.re 2.1e-5)
(* t_0 (/ 1.0 (pow (hypot y.re y.im) 2.0)))
(/
(- x.im (/ y.im (/ (hypot y.re y.im) x.re)))
(hypot y.re y.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if (y_46_re <= -2.7e+109) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * ((x_46_re / (y_46_re / y_46_im)) - x_46_im);
} else if (y_46_re <= -3.1e+46) {
tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im);
} else if (y_46_re <= -3.4e-22) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 3.3e-94) {
tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / y_46_im));
} else if (y_46_re <= 2.1e-5) {
tmp = t_0 * (1.0 / pow(hypot(y_46_re, y_46_im), 2.0));
} else {
tmp = (x_46_im - (y_46_im / (hypot(y_46_re, y_46_im) / x_46_re))) / hypot(y_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) {
double t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if (y_46_re <= -2.7e+109) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * ((x_46_re / (y_46_re / y_46_im)) - x_46_im);
} else if (y_46_re <= -3.1e+46) {
tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im);
} else if (y_46_re <= -3.4e-22) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 3.3e-94) {
tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / y_46_im));
} else if (y_46_re <= 2.1e-5) {
tmp = t_0 * (1.0 / Math.pow(Math.hypot(y_46_re, y_46_im), 2.0));
} else {
tmp = (x_46_im - (y_46_im / (Math.hypot(y_46_re, y_46_im) / x_46_re))) / Math.hypot(y_46_re, y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re) tmp = 0 if y_46_re <= -2.7e+109: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * ((x_46_re / (y_46_re / y_46_im)) - x_46_im) elif y_46_re <= -3.1e+46: tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im) elif y_46_re <= -3.4e-22: tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_re <= 3.3e-94: tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / y_46_im)) elif y_46_re <= 2.1e-5: tmp = t_0 * (1.0 / math.pow(math.hypot(y_46_re, y_46_im), 2.0)) else: tmp = (x_46_im - (y_46_im / (math.hypot(y_46_re, y_46_im) / x_46_re))) / math.hypot(y_46_re, y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (y_46_re <= -2.7e+109) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(Float64(x_46_re / Float64(y_46_re / y_46_im)) - x_46_im)); elseif (y_46_re <= -3.1e+46) tmp = Float64(Float64(y_46_re / Float64(y_46_im * Float64(y_46_im / x_46_im))) - Float64(x_46_re / y_46_im)); elseif (y_46_re <= -3.4e-22) tmp = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_re <= 3.3e-94) tmp = Float64(Float64(-1.0 / y_46_im) * Float64(x_46_re - Float64(Float64(y_46_re * x_46_im) / y_46_im))); elseif (y_46_re <= 2.1e-5) tmp = Float64(t_0 * Float64(1.0 / (hypot(y_46_re, y_46_im) ^ 2.0))); else tmp = Float64(Float64(x_46_im - Float64(y_46_im / Float64(hypot(y_46_re, y_46_im) / x_46_re))) / hypot(y_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) t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re); tmp = 0.0; if (y_46_re <= -2.7e+109) tmp = (1.0 / hypot(y_46_re, y_46_im)) * ((x_46_re / (y_46_re / y_46_im)) - x_46_im); elseif (y_46_re <= -3.1e+46) tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im); elseif (y_46_re <= -3.4e-22) tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_re <= 3.3e-94) tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / y_46_im)); elseif (y_46_re <= 2.1e-5) tmp = t_0 * (1.0 / (hypot(y_46_re, y_46_im) ^ 2.0)); else tmp = (x_46_im - (y_46_im / (hypot(y_46_re, y_46_im) / x_46_re))) / hypot(y_46_re, y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.7e+109], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -3.1e+46], N[(N[(y$46$re / N[(y$46$im * N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -3.4e-22], N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.3e-94], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(x$46$re - N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.1e-5], N[(t$95$0 * N[(1.0 / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im - N[(y$46$im / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;y.re \leq -2.7 \cdot 10^{+109}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\frac{x.re}{\frac{y.re}{y.im}} - x.im\right)\\
\mathbf{elif}\;y.re \leq -3.1 \cdot 10^{+46}:\\
\;\;\;\;\frac{y.re}{y.im \cdot \frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.re \leq -3.4 \cdot 10^{-22}:\\
\;\;\;\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 3.3 \cdot 10^{-94}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(x.re - \frac{y.re \cdot x.im}{y.im}\right)\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-5}:\\
\;\;\;\;t_0 \cdot \frac{1}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{y.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.re}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -2.70000000000000001e109Initial program 40.0%
*-un-lft-identity40.0%
add-sqr-sqrt40.0%
times-frac40.0%
hypot-def40.0%
hypot-def54.7%
Applied egg-rr54.7%
Taylor expanded in y.re around -inf 76.4%
+-commutative76.4%
mul-1-neg76.4%
unsub-neg76.4%
associate-/l*85.9%
Simplified85.9%
if -2.70000000000000001e109 < y.re < -3.09999999999999975e46Initial program 47.1%
Taylor expanded in y.re around 0 77.8%
+-commutative77.8%
mul-1-neg77.8%
unsub-neg77.8%
*-commutative77.8%
associate-/l*77.8%
Simplified77.8%
pow277.8%
*-un-lft-identity77.8%
times-frac77.8%
Applied egg-rr77.8%
if -3.09999999999999975e46 < y.re < -3.3999999999999998e-22Initial program 73.7%
if -3.3999999999999998e-22 < y.re < 3.3000000000000001e-94Initial program 69.8%
*-un-lft-identity69.8%
add-sqr-sqrt69.8%
times-frac69.8%
hypot-def69.8%
hypot-def82.5%
Applied egg-rr82.5%
Taylor expanded in y.im around -inf 50.1%
Taylor expanded in y.im around -inf 87.9%
if 3.3000000000000001e-94 < y.re < 2.09999999999999988e-5Initial program 99.5%
clear-num99.3%
associate-/r/99.6%
add-sqr-sqrt99.6%
pow299.6%
hypot-def99.6%
Applied egg-rr99.6%
if 2.09999999999999988e-5 < y.re Initial program 49.4%
*-un-lft-identity49.4%
add-sqr-sqrt49.4%
times-frac49.4%
hypot-def49.4%
hypot-def69.8%
Applied egg-rr69.8%
div-sub69.8%
*-commutative69.8%
*-commutative69.8%
Applied egg-rr69.8%
associate-/l*91.9%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in y.re around inf 88.8%
expm1-log1p-u75.9%
expm1-udef32.0%
associate-*l/32.0%
*-un-lft-identity32.0%
associate-/r/32.0%
associate-*l/31.7%
Applied egg-rr31.7%
expm1-def70.5%
expm1-log1p83.5%
associate-/l*88.9%
Simplified88.9%
Final simplification87.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -2.8e+109)
(* (/ 1.0 (hypot y.re y.im)) (- (/ x.re (/ y.re y.im)) x.im))
(if (<= y.re -1.6e+47)
(- (/ y.re (* y.im (/ y.im x.im))) (/ x.re y.im))
(if (<= y.re -5.6e-23)
t_0
(if (<= y.re 6.8e-96)
(* (/ -1.0 y.im) (- x.re (/ (* y.re x.im) y.im)))
(if (<= y.re 1.72e-9)
t_0
(/
(- x.im (/ y.im (/ (hypot y.re y.im) x.re)))
(hypot y.re y.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -2.8e+109) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * ((x_46_re / (y_46_re / y_46_im)) - x_46_im);
} else if (y_46_re <= -1.6e+47) {
tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im);
} else if (y_46_re <= -5.6e-23) {
tmp = t_0;
} else if (y_46_re <= 6.8e-96) {
tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / y_46_im));
} else if (y_46_re <= 1.72e-9) {
tmp = t_0;
} else {
tmp = (x_46_im - (y_46_im / (hypot(y_46_re, y_46_im) / x_46_re))) / hypot(y_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) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -2.8e+109) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * ((x_46_re / (y_46_re / y_46_im)) - x_46_im);
} else if (y_46_re <= -1.6e+47) {
tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im);
} else if (y_46_re <= -5.6e-23) {
tmp = t_0;
} else if (y_46_re <= 6.8e-96) {
tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / y_46_im));
} else if (y_46_re <= 1.72e-9) {
tmp = t_0;
} else {
tmp = (x_46_im - (y_46_im / (Math.hypot(y_46_re, y_46_im) / x_46_re))) / Math.hypot(y_46_re, y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -2.8e+109: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * ((x_46_re / (y_46_re / y_46_im)) - x_46_im) elif y_46_re <= -1.6e+47: tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im) elif y_46_re <= -5.6e-23: tmp = t_0 elif y_46_re <= 6.8e-96: tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / y_46_im)) elif y_46_re <= 1.72e-9: tmp = t_0 else: tmp = (x_46_im - (y_46_im / (math.hypot(y_46_re, y_46_im) / x_46_re))) / math.hypot(y_46_re, y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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))) tmp = 0.0 if (y_46_re <= -2.8e+109) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(Float64(x_46_re / Float64(y_46_re / y_46_im)) - x_46_im)); elseif (y_46_re <= -1.6e+47) tmp = Float64(Float64(y_46_re / Float64(y_46_im * Float64(y_46_im / x_46_im))) - Float64(x_46_re / y_46_im)); elseif (y_46_re <= -5.6e-23) tmp = t_0; elseif (y_46_re <= 6.8e-96) tmp = Float64(Float64(-1.0 / y_46_im) * Float64(x_46_re - Float64(Float64(y_46_re * x_46_im) / y_46_im))); elseif (y_46_re <= 1.72e-9) tmp = t_0; else tmp = Float64(Float64(x_46_im - Float64(y_46_im / Float64(hypot(y_46_re, y_46_im) / x_46_re))) / hypot(y_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) t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -2.8e+109) tmp = (1.0 / hypot(y_46_re, y_46_im)) * ((x_46_re / (y_46_re / y_46_im)) - x_46_im); elseif (y_46_re <= -1.6e+47) tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im); elseif (y_46_re <= -5.6e-23) tmp = t_0; elseif (y_46_re <= 6.8e-96) tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / y_46_im)); elseif (y_46_re <= 1.72e-9) tmp = t_0; else tmp = (x_46_im - (y_46_im / (hypot(y_46_re, y_46_im) / x_46_re))) / hypot(y_46_re, y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = 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]}, If[LessEqual[y$46$re, -2.8e+109], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.6e+47], N[(N[(y$46$re / N[(y$46$im * N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -5.6e-23], t$95$0, If[LessEqual[y$46$re, 6.8e-96], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(x$46$re - N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.72e-9], t$95$0, N[(N[(x$46$im - N[(y$46$im / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -2.8 \cdot 10^{+109}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\frac{x.re}{\frac{y.re}{y.im}} - x.im\right)\\
\mathbf{elif}\;y.re \leq -1.6 \cdot 10^{+47}:\\
\;\;\;\;\frac{y.re}{y.im \cdot \frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.re \leq -5.6 \cdot 10^{-23}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 6.8 \cdot 10^{-96}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(x.re - \frac{y.re \cdot x.im}{y.im}\right)\\
\mathbf{elif}\;y.re \leq 1.72 \cdot 10^{-9}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{y.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.re}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -2.8000000000000002e109Initial program 40.0%
*-un-lft-identity40.0%
add-sqr-sqrt40.0%
times-frac40.0%
hypot-def40.0%
hypot-def54.7%
Applied egg-rr54.7%
Taylor expanded in y.re around -inf 76.4%
+-commutative76.4%
mul-1-neg76.4%
unsub-neg76.4%
associate-/l*85.9%
Simplified85.9%
if -2.8000000000000002e109 < y.re < -1.6e47Initial program 47.1%
Taylor expanded in y.re around 0 77.8%
+-commutative77.8%
mul-1-neg77.8%
unsub-neg77.8%
*-commutative77.8%
associate-/l*77.8%
Simplified77.8%
pow277.8%
*-un-lft-identity77.8%
times-frac77.8%
Applied egg-rr77.8%
if -1.6e47 < y.re < -5.5999999999999994e-23 or 6.8000000000000002e-96 < y.re < 1.72000000000000006e-9Initial program 87.8%
if -5.5999999999999994e-23 < y.re < 6.8000000000000002e-96Initial program 69.8%
*-un-lft-identity69.8%
add-sqr-sqrt69.8%
times-frac69.8%
hypot-def69.8%
hypot-def82.5%
Applied egg-rr82.5%
Taylor expanded in y.im around -inf 50.1%
Taylor expanded in y.im around -inf 87.9%
if 1.72000000000000006e-9 < y.re Initial program 49.4%
*-un-lft-identity49.4%
add-sqr-sqrt49.4%
times-frac49.4%
hypot-def49.4%
hypot-def69.8%
Applied egg-rr69.8%
div-sub69.8%
*-commutative69.8%
*-commutative69.8%
Applied egg-rr69.8%
associate-/l*91.9%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in y.re around inf 88.8%
expm1-log1p-u75.9%
expm1-udef32.0%
associate-*l/32.0%
*-un-lft-identity32.0%
associate-/r/32.0%
associate-*l/31.7%
Applied egg-rr31.7%
expm1-def70.5%
expm1-log1p83.5%
associate-/l*88.9%
Simplified88.9%
Final simplification87.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ 1.0 (hypot y.re y.im))))
(if (<= y.im -5e+72)
(* t_1 (- x.re (* y.re (/ x.im y.im))))
(if (<= y.im -7.8e-199)
t_0
(if (<= y.im 3.2e-128)
(/ x.im y.re)
(if (<= y.im 1.35e+73)
t_0
(* t_1 (- (/ x.im (/ y.im y.re)) x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = 1.0 / hypot(y_46_re, y_46_im);
double tmp;
if (y_46_im <= -5e+72) {
tmp = t_1 * (x_46_re - (y_46_re * (x_46_im / y_46_im)));
} else if (y_46_im <= -7.8e-199) {
tmp = t_0;
} else if (y_46_im <= 3.2e-128) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 1.35e+73) {
tmp = t_0;
} else {
tmp = t_1 * ((x_46_im / (y_46_im / y_46_re)) - x_46_re);
}
return tmp;
}
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_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = 1.0 / Math.hypot(y_46_re, y_46_im);
double tmp;
if (y_46_im <= -5e+72) {
tmp = t_1 * (x_46_re - (y_46_re * (x_46_im / y_46_im)));
} else if (y_46_im <= -7.8e-199) {
tmp = t_0;
} else if (y_46_im <= 3.2e-128) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 1.35e+73) {
tmp = t_0;
} else {
tmp = t_1 * ((x_46_im / (y_46_im / y_46_re)) - x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = 1.0 / math.hypot(y_46_re, y_46_im) tmp = 0 if y_46_im <= -5e+72: tmp = t_1 * (x_46_re - (y_46_re * (x_46_im / y_46_im))) elif y_46_im <= -7.8e-199: tmp = t_0 elif y_46_im <= 3.2e-128: tmp = x_46_im / y_46_re elif y_46_im <= 1.35e+73: tmp = t_0 else: tmp = t_1 * ((x_46_im / (y_46_im / y_46_re)) - x_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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))) t_1 = Float64(1.0 / hypot(y_46_re, y_46_im)) tmp = 0.0 if (y_46_im <= -5e+72) tmp = Float64(t_1 * Float64(x_46_re - Float64(y_46_re * Float64(x_46_im / y_46_im)))); elseif (y_46_im <= -7.8e-199) tmp = t_0; elseif (y_46_im <= 3.2e-128) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 1.35e+73) tmp = t_0; else tmp = Float64(t_1 * Float64(Float64(x_46_im / Float64(y_46_im / y_46_re)) - x_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = 1.0 / hypot(y_46_re, y_46_im); tmp = 0.0; if (y_46_im <= -5e+72) tmp = t_1 * (x_46_re - (y_46_re * (x_46_im / y_46_im))); elseif (y_46_im <= -7.8e-199) tmp = t_0; elseif (y_46_im <= 3.2e-128) tmp = x_46_im / y_46_re; elseif (y_46_im <= 1.35e+73) tmp = t_0; else tmp = t_1 * ((x_46_im / (y_46_im / y_46_re)) - x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5e+72], N[(t$95$1 * N[(x$46$re - N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -7.8e-199], t$95$0, If[LessEqual[y$46$im, 3.2e-128], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.35e+73], t$95$0, N[(t$95$1 * N[(N[(x$46$im / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{if}\;y.im \leq -5 \cdot 10^{+72}:\\
\;\;\;\;t_1 \cdot \left(x.re - y.re \cdot \frac{x.im}{y.im}\right)\\
\mathbf{elif}\;y.im \leq -7.8 \cdot 10^{-199}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{-128}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 1.35 \cdot 10^{+73}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(\frac{x.im}{\frac{y.im}{y.re}} - x.re\right)\\
\end{array}
\end{array}
if y.im < -4.99999999999999992e72Initial program 41.5%
*-un-lft-identity41.5%
add-sqr-sqrt41.5%
times-frac41.6%
hypot-def41.6%
hypot-def63.4%
Applied egg-rr63.4%
Taylor expanded in y.im around -inf 78.7%
add-sqr-sqrt42.9%
fma-def43.0%
mul-1-neg43.0%
add-sqr-sqrt25.2%
sqrt-unprod39.1%
sqr-neg39.1%
mul-1-neg39.1%
mul-1-neg39.1%
sqrt-unprod31.7%
add-sqr-sqrt38.2%
fma-neg38.2%
add-sqr-sqrt70.2%
add-sqr-sqrt50.9%
sqrt-unprod71.3%
mul-1-neg71.3%
mul-1-neg71.3%
Applied egg-rr83.3%
associate-/r/83.3%
Simplified83.3%
if -4.99999999999999992e72 < y.im < -7.8000000000000002e-199 or 3.1999999999999998e-128 < y.im < 1.35e73Initial program 83.1%
if -7.8000000000000002e-199 < y.im < 3.1999999999999998e-128Initial program 59.1%
Taylor expanded in y.re around inf 78.8%
if 1.35e73 < y.im Initial program 40.2%
*-un-lft-identity40.2%
add-sqr-sqrt40.2%
times-frac40.2%
hypot-def40.2%
hypot-def55.3%
Applied egg-rr55.3%
Taylor expanded in y.re around 0 84.3%
+-commutative84.3%
mul-1-neg84.3%
unsub-neg84.3%
associate-/l*88.8%
Simplified88.8%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (- x.re (* y.re (/ x.im y.im)))))
(if (<= y.im -7e+71)
(* (/ 1.0 (hypot y.re y.im)) t_1)
(if (<= y.im -2.8e-198)
t_0
(if (<= y.im 7.6e-128)
(/ x.im y.re)
(if (<= y.im 5.4e+73) t_0 (* (/ -1.0 y.im) t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = x_46_re - (y_46_re * (x_46_im / y_46_im));
double tmp;
if (y_46_im <= -7e+71) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * t_1;
} else if (y_46_im <= -2.8e-198) {
tmp = t_0;
} else if (y_46_im <= 7.6e-128) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 5.4e+73) {
tmp = t_0;
} else {
tmp = (-1.0 / y_46_im) * t_1;
}
return tmp;
}
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_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = x_46_re - (y_46_re * (x_46_im / y_46_im));
double tmp;
if (y_46_im <= -7e+71) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * t_1;
} else if (y_46_im <= -2.8e-198) {
tmp = t_0;
} else if (y_46_im <= 7.6e-128) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 5.4e+73) {
tmp = t_0;
} else {
tmp = (-1.0 / y_46_im) * t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = x_46_re - (y_46_re * (x_46_im / y_46_im)) tmp = 0 if y_46_im <= -7e+71: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * t_1 elif y_46_im <= -2.8e-198: tmp = t_0 elif y_46_im <= 7.6e-128: tmp = x_46_im / y_46_re elif y_46_im <= 5.4e+73: tmp = t_0 else: tmp = (-1.0 / y_46_im) * t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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))) t_1 = Float64(x_46_re - Float64(y_46_re * Float64(x_46_im / y_46_im))) tmp = 0.0 if (y_46_im <= -7e+71) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * t_1); elseif (y_46_im <= -2.8e-198) tmp = t_0; elseif (y_46_im <= 7.6e-128) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 5.4e+73) tmp = t_0; else tmp = Float64(Float64(-1.0 / y_46_im) * t_1); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = x_46_re - (y_46_re * (x_46_im / y_46_im)); tmp = 0.0; if (y_46_im <= -7e+71) tmp = (1.0 / hypot(y_46_re, y_46_im)) * t_1; elseif (y_46_im <= -2.8e-198) tmp = t_0; elseif (y_46_im <= 7.6e-128) tmp = x_46_im / y_46_re; elseif (y_46_im <= 5.4e+73) tmp = t_0; else tmp = (-1.0 / y_46_im) * t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(x$46$re - N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -7e+71], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, -2.8e-198], t$95$0, If[LessEqual[y$46$im, 7.6e-128], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5.4e+73], t$95$0, N[(N[(-1.0 / y$46$im), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := x.re - y.re \cdot \frac{x.im}{y.im}\\
\mathbf{if}\;y.im \leq -7 \cdot 10^{+71}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot t_1\\
\mathbf{elif}\;y.im \leq -2.8 \cdot 10^{-198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 7.6 \cdot 10^{-128}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 5.4 \cdot 10^{+73}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.im} \cdot t_1\\
\end{array}
\end{array}
if y.im < -6.9999999999999998e71Initial program 41.5%
*-un-lft-identity41.5%
add-sqr-sqrt41.5%
times-frac41.6%
hypot-def41.6%
hypot-def63.4%
Applied egg-rr63.4%
Taylor expanded in y.im around -inf 78.7%
add-sqr-sqrt42.9%
fma-def43.0%
mul-1-neg43.0%
add-sqr-sqrt25.2%
sqrt-unprod39.1%
sqr-neg39.1%
mul-1-neg39.1%
mul-1-neg39.1%
sqrt-unprod31.7%
add-sqr-sqrt38.2%
fma-neg38.2%
add-sqr-sqrt70.2%
add-sqr-sqrt50.9%
sqrt-unprod71.3%
mul-1-neg71.3%
mul-1-neg71.3%
Applied egg-rr83.3%
associate-/r/83.3%
Simplified83.3%
if -6.9999999999999998e71 < y.im < -2.7999999999999999e-198 or 7.6000000000000005e-128 < y.im < 5.3999999999999998e73Initial program 83.1%
if -2.7999999999999999e-198 < y.im < 7.6000000000000005e-128Initial program 59.1%
Taylor expanded in y.re around inf 78.8%
if 5.3999999999999998e73 < y.im Initial program 40.2%
*-un-lft-identity40.2%
add-sqr-sqrt40.2%
times-frac40.2%
hypot-def40.2%
hypot-def55.3%
Applied egg-rr55.3%
Taylor expanded in y.im around -inf 27.1%
add-sqr-sqrt17.3%
fma-def17.3%
mul-1-neg17.3%
add-sqr-sqrt8.9%
sqrt-unprod19.2%
sqr-neg19.2%
mul-1-neg19.2%
mul-1-neg19.2%
sqrt-unprod18.8%
add-sqr-sqrt21.3%
fma-neg21.3%
add-sqr-sqrt34.7%
add-sqr-sqrt28.4%
sqrt-unprod31.0%
mul-1-neg31.0%
mul-1-neg31.0%
Applied egg-rr27.2%
associate-/r/27.2%
Simplified27.2%
Taylor expanded in y.im around -inf 88.7%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (* (/ -1.0 y.im) (- x.re (* y.re (/ x.im y.im))))))
(if (<= y.im -4e+84)
t_1
(if (<= y.im -9.2e-198)
t_0
(if (<= y.im 5.3e-128) (/ x.im y.re) (if (<= y.im 1e+73) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (-1.0 / y_46_im) * (x_46_re - (y_46_re * (x_46_im / y_46_im)));
double tmp;
if (y_46_im <= -4e+84) {
tmp = t_1;
} else if (y_46_im <= -9.2e-198) {
tmp = t_0;
} else if (y_46_im <= 5.3e-128) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 1e+73) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = ((-1.0d0) / y_46im) * (x_46re - (y_46re * (x_46im / y_46im)))
if (y_46im <= (-4d+84)) then
tmp = t_1
else if (y_46im <= (-9.2d-198)) then
tmp = t_0
else if (y_46im <= 5.3d-128) then
tmp = x_46im / y_46re
else if (y_46im <= 1d+73) then
tmp = t_0
else
tmp = t_1
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 t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (-1.0 / y_46_im) * (x_46_re - (y_46_re * (x_46_im / y_46_im)));
double tmp;
if (y_46_im <= -4e+84) {
tmp = t_1;
} else if (y_46_im <= -9.2e-198) {
tmp = t_0;
} else if (y_46_im <= 5.3e-128) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 1e+73) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (-1.0 / y_46_im) * (x_46_re - (y_46_re * (x_46_im / y_46_im))) tmp = 0 if y_46_im <= -4e+84: tmp = t_1 elif y_46_im <= -9.2e-198: tmp = t_0 elif y_46_im <= 5.3e-128: tmp = x_46_im / y_46_re elif y_46_im <= 1e+73: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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))) t_1 = Float64(Float64(-1.0 / y_46_im) * Float64(x_46_re - Float64(y_46_re * Float64(x_46_im / y_46_im)))) tmp = 0.0 if (y_46_im <= -4e+84) tmp = t_1; elseif (y_46_im <= -9.2e-198) tmp = t_0; elseif (y_46_im <= 5.3e-128) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 1e+73) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (-1.0 / y_46_im) * (x_46_re - (y_46_re * (x_46_im / y_46_im))); tmp = 0.0; if (y_46_im <= -4e+84) tmp = t_1; elseif (y_46_im <= -9.2e-198) tmp = t_0; elseif (y_46_im <= 5.3e-128) tmp = x_46_im / y_46_re; elseif (y_46_im <= 1e+73) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(x$46$re - N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -4e+84], t$95$1, If[LessEqual[y$46$im, -9.2e-198], t$95$0, If[LessEqual[y$46$im, 5.3e-128], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1e+73], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{-1}{y.im} \cdot \left(x.re - y.re \cdot \frac{x.im}{y.im}\right)\\
\mathbf{if}\;y.im \leq -4 \cdot 10^{+84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -9.2 \cdot 10^{-198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 5.3 \cdot 10^{-128}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 10^{+73}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -4.00000000000000023e84 or 9.99999999999999983e72 < y.im Initial program 38.6%
*-un-lft-identity38.6%
add-sqr-sqrt38.6%
times-frac38.6%
hypot-def38.6%
hypot-def58.0%
Applied egg-rr58.0%
Taylor expanded in y.im around -inf 52.5%
add-sqr-sqrt30.1%
fma-def30.1%
mul-1-neg30.1%
add-sqr-sqrt17.2%
sqrt-unprod28.9%
sqr-neg28.9%
mul-1-neg28.9%
mul-1-neg28.9%
sqrt-unprod25.7%
add-sqr-sqrt29.4%
fma-neg29.4%
add-sqr-sqrt52.6%
add-sqr-sqrt39.9%
sqrt-unprod51.3%
mul-1-neg51.3%
mul-1-neg51.3%
Applied egg-rr55.2%
associate-/r/55.2%
Simplified55.2%
Taylor expanded in y.im around -inf 85.1%
if -4.00000000000000023e84 < y.im < -9.20000000000000053e-198 or 5.2999999999999999e-128 < y.im < 9.99999999999999983e72Initial program 83.8%
if -9.20000000000000053e-198 < y.im < 5.2999999999999999e-128Initial program 59.1%
Taylor expanded in y.re around inf 78.8%
Final simplification83.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.75e+114) (not (<= y.re 2.2e+26))) (/ x.im y.re) (* (/ -1.0 y.im) (- x.re (* y.re (/ x.im 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_re <= -1.75e+114) || !(y_46_re <= 2.2e+26)) {
tmp = x_46_im / y_46_re;
} else {
tmp = (-1.0 / y_46_im) * (x_46_re - (y_46_re * (x_46_im / 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_46re <= (-1.75d+114)) .or. (.not. (y_46re <= 2.2d+26))) then
tmp = x_46im / y_46re
else
tmp = ((-1.0d0) / y_46im) * (x_46re - (y_46re * (x_46im / 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_re <= -1.75e+114) || !(y_46_re <= 2.2e+26)) {
tmp = x_46_im / y_46_re;
} else {
tmp = (-1.0 / y_46_im) * (x_46_re - (y_46_re * (x_46_im / y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.75e+114) or not (y_46_re <= 2.2e+26): tmp = x_46_im / y_46_re else: tmp = (-1.0 / y_46_im) * (x_46_re - (y_46_re * (x_46_im / 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_re <= -1.75e+114) || !(y_46_re <= 2.2e+26)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(-1.0 / y_46_im) * Float64(x_46_re - Float64(y_46_re * Float64(x_46_im / 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_re <= -1.75e+114) || ~((y_46_re <= 2.2e+26))) tmp = x_46_im / y_46_re; else tmp = (-1.0 / y_46_im) * (x_46_re - (y_46_re * (x_46_im / y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.75e+114], N[Not[LessEqual[y$46$re, 2.2e+26]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(x$46$re - N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.75 \cdot 10^{+114} \lor \neg \left(y.re \leq 2.2 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(x.re - y.re \cdot \frac{x.im}{y.im}\right)\\
\end{array}
\end{array}
if y.re < -1.75e114 or 2.20000000000000007e26 < y.re Initial program 44.8%
Taylor expanded in y.re around inf 68.9%
if -1.75e114 < y.re < 2.20000000000000007e26Initial program 71.8%
*-un-lft-identity71.8%
add-sqr-sqrt71.8%
times-frac71.7%
hypot-def71.7%
hypot-def82.6%
Applied egg-rr82.6%
Taylor expanded in y.im around -inf 44.0%
add-sqr-sqrt18.4%
fma-def18.4%
mul-1-neg18.4%
add-sqr-sqrt11.3%
sqrt-unprod19.7%
sqr-neg19.7%
mul-1-neg19.7%
mul-1-neg19.7%
sqrt-unprod18.0%
add-sqr-sqrt23.5%
fma-neg23.5%
add-sqr-sqrt46.5%
add-sqr-sqrt33.2%
sqrt-unprod43.3%
mul-1-neg43.3%
mul-1-neg43.3%
Applied egg-rr44.6%
associate-/r/44.7%
Simplified44.7%
Taylor expanded in y.im around -inf 78.5%
Final simplification74.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.2e+109) (not (<= y.re 3.1e+27))) (/ x.im y.re) (* (/ -1.0 y.im) (- x.re (/ (* y.re x.im) 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_re <= -3.2e+109) || !(y_46_re <= 3.1e+27)) {
tmp = x_46_im / y_46_re;
} else {
tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / 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_46re <= (-3.2d+109)) .or. (.not. (y_46re <= 3.1d+27))) then
tmp = x_46im / y_46re
else
tmp = ((-1.0d0) / y_46im) * (x_46re - ((y_46re * x_46im) / 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_re <= -3.2e+109) || !(y_46_re <= 3.1e+27)) {
tmp = x_46_im / y_46_re;
} else {
tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3.2e+109) or not (y_46_re <= 3.1e+27): tmp = x_46_im / y_46_re else: tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / 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_re <= -3.2e+109) || !(y_46_re <= 3.1e+27)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(-1.0 / y_46_im) * Float64(x_46_re - Float64(Float64(y_46_re * x_46_im) / 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_re <= -3.2e+109) || ~((y_46_re <= 3.1e+27))) tmp = x_46_im / y_46_re; else tmp = (-1.0 / y_46_im) * (x_46_re - ((y_46_re * x_46_im) / y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3.2e+109], N[Not[LessEqual[y$46$re, 3.1e+27]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(x$46$re - N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.2 \cdot 10^{+109} \lor \neg \left(y.re \leq 3.1 \cdot 10^{+27}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(x.re - \frac{y.re \cdot x.im}{y.im}\right)\\
\end{array}
\end{array}
if y.re < -3.2000000000000001e109 or 3.09999999999999996e27 < y.re Initial program 44.8%
Taylor expanded in y.re around inf 68.9%
if -3.2000000000000001e109 < y.re < 3.09999999999999996e27Initial program 71.8%
*-un-lft-identity71.8%
add-sqr-sqrt71.8%
times-frac71.7%
hypot-def71.7%
hypot-def82.6%
Applied egg-rr82.6%
Taylor expanded in y.im around -inf 44.0%
Taylor expanded in y.im around -inf 79.2%
Final simplification74.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -7.5e-67) (not (<= y.im 2.4e+88))) (/ (- 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 <= -7.5e-67) || !(y_46_im <= 2.4e+88)) {
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 <= (-7.5d-67)) .or. (.not. (y_46im <= 2.4d+88))) 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 <= -7.5e-67) || !(y_46_im <= 2.4e+88)) {
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 <= -7.5e-67) or not (y_46_im <= 2.4e+88): 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 <= -7.5e-67) || !(y_46_im <= 2.4e+88)) tmp = Float64(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 <= -7.5e-67) || ~((y_46_im <= 2.4e+88))) 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, -7.5e-67], N[Not[LessEqual[y$46$im, 2.4e+88]], $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 -7.5 \cdot 10^{-67} \lor \neg \left(y.im \leq 2.4 \cdot 10^{+88}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -7.5000000000000005e-67 or 2.3999999999999999e88 < y.im Initial program 49.9%
Taylor expanded in y.re around 0 70.4%
associate-*r/70.4%
neg-mul-170.4%
Simplified70.4%
if -7.5000000000000005e-67 < y.im < 2.3999999999999999e88Initial program 70.8%
Taylor expanded in y.re around inf 63.2%
Final simplification66.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.7e+264) (not (<= y.im 4.4e+152))) (/ 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.7e+264) || !(y_46_im <= 4.4e+152)) {
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.7d+264)) .or. (.not. (y_46im <= 4.4d+152))) 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.7e+264) || !(y_46_im <= 4.4e+152)) {
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.7e+264) or not (y_46_im <= 4.4e+152): 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.7e+264) || !(y_46_im <= 4.4e+152)) 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 <= -1.7e+264) || ~((y_46_im <= 4.4e+152))) 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.7e+264], N[Not[LessEqual[y$46$im, 4.4e+152]], $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.7 \cdot 10^{+264} \lor \neg \left(y.im \leq 4.4 \cdot 10^{+152}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.7e264 or 4.3999999999999996e152 < y.im Initial program 36.5%
*-un-lft-identity36.5%
add-sqr-sqrt36.5%
times-frac36.4%
hypot-def36.4%
hypot-def52.3%
Applied egg-rr52.3%
Taylor expanded in y.im around -inf 49.6%
Taylor expanded in y.re around 0 35.7%
if -1.7e264 < y.im < 4.3999999999999996e152Initial program 66.2%
Taylor expanded in y.re around inf 49.6%
Final simplification46.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 2.9e+151) (/ x.im y.re) (/ x.im 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 <= 2.9e+151) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_im / 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 <= 2.9d+151) then
tmp = x_46im / y_46re
else
tmp = x_46im / 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 <= 2.9e+151) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_im / 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 <= 2.9e+151: tmp = x_46_im / y_46_re else: tmp = x_46_im / 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 <= 2.9e+151) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(x_46_im / 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 <= 2.9e+151) tmp = x_46_im / y_46_re; else tmp = x_46_im / 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, 2.9e+151], N[(x$46$im / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 2.9 \cdot 10^{+151}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < 2.90000000000000018e151Initial program 64.6%
Taylor expanded in y.re around inf 47.0%
if 2.90000000000000018e151 < y.im Initial program 35.0%
*-un-lft-identity35.0%
add-sqr-sqrt35.0%
times-frac34.9%
hypot-def34.9%
hypot-def52.6%
Applied egg-rr52.6%
Taylor expanded in y.im around -inf 33.0%
Taylor expanded in y.re around -inf 22.6%
Final simplification43.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.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_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_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_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_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_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 60.3%
*-un-lft-identity60.3%
add-sqr-sqrt60.3%
times-frac60.3%
hypot-def60.3%
hypot-def74.4%
Applied egg-rr74.4%
Taylor expanded in y.im around -inf 33.6%
Taylor expanded in y.re around -inf 11.8%
Final simplification11.8%
herbie shell --seed 2023311
(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))))