
(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 12 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 (* (/ 1.0 (hypot y.re y.im)) (- (/ x.im (/ (hypot y.re y.im) y.re)) (/ x.re (/ (hypot 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 (1.0 / hypot(y_46_re, y_46_im)) * ((x_46_im / (hypot(y_46_re, y_46_im) / y_46_re)) - (x_46_re / (hypot(y_46_re, y_46_im) / y_46_im)));
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (1.0 / Math.hypot(y_46_re, y_46_im)) * ((x_46_im / (Math.hypot(y_46_re, y_46_im) / y_46_re)) - (x_46_re / (Math.hypot(y_46_re, y_46_im) / y_46_im)));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return (1.0 / math.hypot(y_46_re, y_46_im)) * ((x_46_im / (math.hypot(y_46_re, y_46_im) / y_46_re)) - (x_46_re / (math.hypot(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(1.0 / hypot(y_46_re, y_46_im)) * Float64(Float64(x_46_im / Float64(hypot(y_46_re, y_46_im) / y_46_re)) - Float64(x_46_re / Float64(hypot(y_46_re, y_46_im) / y_46_im)))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = (1.0 / hypot(y_46_re, y_46_im)) * ((x_46_im / (hypot(y_46_re, y_46_im) / y_46_re)) - (x_46_re / (hypot(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[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(x$46$im / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}} - \frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}}\right)
\end{array}
Initial program 64.5%
*-un-lft-identity64.5%
add-sqr-sqrt64.5%
times-frac64.5%
hypot-def64.5%
hypot-def79.6%
Applied egg-rr79.6%
div-sub79.6%
Applied egg-rr79.6%
associate-/l*86.8%
associate-/l*99.2%
Simplified99.2%
Final simplification99.2%
(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))) INFINITY)
(* t_0 (/ t_1 (hypot y.re y.im)))
(* t_0 (- x.im (/ x.re (/ (hypot y.re y.im) y.im)))))))
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))) <= ((double) INFINITY)) {
tmp = t_0 * (t_1 / hypot(y_46_re, y_46_im));
} else {
tmp = t_0 * (x_46_im - (x_46_re / (hypot(y_46_re, y_46_im) / 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 = 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))) <= Double.POSITIVE_INFINITY) {
tmp = t_0 * (t_1 / Math.hypot(y_46_re, y_46_im));
} else {
tmp = t_0 * (x_46_im - (x_46_re / (Math.hypot(y_46_re, y_46_im) / y_46_im)));
}
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))) <= math.inf: tmp = t_0 * (t_1 / math.hypot(y_46_re, y_46_im)) else: tmp = t_0 * (x_46_im - (x_46_re / (math.hypot(y_46_re, y_46_im) / y_46_im))) 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))) <= Inf) tmp = Float64(t_0 * Float64(t_1 / hypot(y_46_re, y_46_im))); else tmp = Float64(t_0 * Float64(x_46_im - Float64(x_46_re / Float64(hypot(y_46_re, y_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) 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))) <= Inf) tmp = t_0 * (t_1 / hypot(y_46_re, y_46_im)); else tmp = t_0 * (x_46_im - (x_46_re / (hypot(y_46_re, y_46_im) / 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[(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], Infinity], 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[(x$46$im - N[(x$46$re / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $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 \infty:\\
\;\;\;\;t_0 \cdot \frac{t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(x.im - \frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{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))) < +inf.0Initial program 79.0%
*-un-lft-identity79.0%
add-sqr-sqrt79.0%
times-frac79.0%
hypot-def79.0%
hypot-def96.9%
Applied egg-rr96.9%
if +inf.0 < (/.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 0.0%
*-un-lft-identity0.0%
add-sqr-sqrt0.0%
times-frac0.0%
hypot-def0.0%
hypot-def2.8%
Applied egg-rr2.8%
div-sub2.8%
Applied egg-rr2.8%
associate-/l*41.7%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in y.re around inf 65.4%
Final simplification91.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ 1.0 (hypot y.re y.im))))
(if (<= y.re -4.6e+72)
(* t_0 (- (* x.re (/ y.im y.re)) x.im))
(if (<= y.re -2.4e-154)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 9.5e-92)
(- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im))
(* t_0 (- x.im (/ x.re (/ (hypot y.re y.im) y.im)))))))))
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 tmp;
if (y_46_re <= -4.6e+72) {
tmp = t_0 * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_re <= -2.4e-154) {
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 if (y_46_re <= 9.5e-92) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else {
tmp = t_0 * (x_46_im - (x_46_re / (hypot(y_46_re, y_46_im) / 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 = 1.0 / Math.hypot(y_46_re, y_46_im);
double tmp;
if (y_46_re <= -4.6e+72) {
tmp = t_0 * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_re <= -2.4e-154) {
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 if (y_46_re <= 9.5e-92) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else {
tmp = t_0 * (x_46_im - (x_46_re / (Math.hypot(y_46_re, y_46_im) / y_46_im)));
}
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) tmp = 0 if y_46_re <= -4.6e+72: tmp = t_0 * ((x_46_re * (y_46_im / y_46_re)) - x_46_im) elif y_46_re <= -2.4e-154: 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)) elif y_46_re <= 9.5e-92: tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) else: tmp = t_0 * (x_46_im - (x_46_re / (math.hypot(y_46_re, y_46_im) / y_46_im))) 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)) tmp = 0.0 if (y_46_re <= -4.6e+72) tmp = Float64(t_0 * Float64(Float64(x_46_re * Float64(y_46_im / y_46_re)) - x_46_im)); elseif (y_46_re <= -2.4e-154) 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))); elseif (y_46_re <= 9.5e-92) tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)); else tmp = Float64(t_0 * Float64(x_46_im - Float64(x_46_re / Float64(hypot(y_46_re, y_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) t_0 = 1.0 / hypot(y_46_re, y_46_im); tmp = 0.0; if (y_46_re <= -4.6e+72) tmp = t_0 * ((x_46_re * (y_46_im / y_46_re)) - x_46_im); elseif (y_46_re <= -2.4e-154) 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)); elseif (y_46_re <= 9.5e-92) tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); else tmp = t_0 * (x_46_im - (x_46_re / (hypot(y_46_re, y_46_im) / 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[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -4.6e+72], N[(t$95$0 * N[(N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -2.4e-154], 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, 9.5e-92], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(x$46$im - N[(x$46$re / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{if}\;y.re \leq -4.6 \cdot 10^{+72}:\\
\;\;\;\;t_0 \cdot \left(x.re \cdot \frac{y.im}{y.re} - x.im\right)\\
\mathbf{elif}\;y.re \leq -2.4 \cdot 10^{-154}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-92}:\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(x.im - \frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}}\right)\\
\end{array}
\end{array}
if y.re < -4.6e72Initial program 37.6%
*-un-lft-identity37.6%
add-sqr-sqrt37.6%
times-frac37.6%
hypot-def37.6%
hypot-def54.7%
Applied egg-rr54.7%
Taylor expanded in y.re around -inf 73.8%
+-commutative73.8%
mul-1-neg73.8%
unsub-neg73.8%
associate-*r/82.9%
Simplified82.9%
if -4.6e72 < y.re < -2.39999999999999987e-154Initial program 82.1%
if -2.39999999999999987e-154 < y.re < 9.49999999999999946e-92Initial program 71.9%
Taylor expanded in y.re around 0 82.7%
+-commutative82.7%
mul-1-neg82.7%
unsub-neg82.7%
unpow282.7%
times-frac86.3%
Simplified86.3%
if 9.49999999999999946e-92 < y.re Initial program 59.0%
*-un-lft-identity59.0%
add-sqr-sqrt59.0%
times-frac58.9%
hypot-def58.9%
hypot-def76.7%
Applied egg-rr76.7%
div-sub76.7%
Applied egg-rr76.7%
associate-/l*88.1%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in y.re around inf 94.7%
Final simplification87.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.im -5.8e+20)
(* (/ 1.0 (hypot y.re y.im)) (- x.re (/ (* y.re x.im) y.im)))
(if (<= y.im -1.55e-118)
(/ (- (* y.re x.im) (* y.im x.re)) t_0)
(if (<= y.im 9.5e-111)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 2.9e+60)
(- (/ (* y.re x.im) t_0) (/ (* y.im x.re) t_0))
(- (* (/ y.re y.im) (/ x.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 t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_im <= -5.8e+20) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_re - ((y_46_re * x_46_im) / y_46_im));
} else if (y_46_im <= -1.55e-118) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_0;
} else if (y_46_im <= 9.5e-111) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 2.9e+60) {
tmp = ((y_46_re * x_46_im) / t_0) - ((y_46_im * x_46_re) / t_0);
} else {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_im <= -5.8e+20) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_re - ((y_46_re * x_46_im) / y_46_im));
} else if (y_46_im <= -1.55e-118) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_0;
} else if (y_46_im <= 9.5e-111) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 2.9e+60) {
tmp = ((y_46_re * x_46_im) / t_0) - ((y_46_im * x_46_re) / t_0);
} else {
tmp = ((y_46_re / y_46_im) * (x_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): t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im) tmp = 0 if y_46_im <= -5.8e+20: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_re - ((y_46_re * x_46_im) / y_46_im)) elif y_46_im <= -1.55e-118: tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_0 elif y_46_im <= 9.5e-111: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 2.9e+60: tmp = ((y_46_re * x_46_im) / t_0) - ((y_46_im * x_46_re) / t_0) else: tmp = ((y_46_re / y_46_im) * (x_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) t_0 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) tmp = 0.0 if (y_46_im <= -5.8e+20) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_re - Float64(Float64(y_46_re * x_46_im) / y_46_im))); elseif (y_46_im <= -1.55e-118) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / t_0); elseif (y_46_im <= 9.5e-111) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 2.9e+60) tmp = Float64(Float64(Float64(y_46_re * x_46_im) / t_0) - Float64(Float64(y_46_im * x_46_re) / t_0)); else tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_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) t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im); tmp = 0.0; if (y_46_im <= -5.8e+20) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_re - ((y_46_re * x_46_im) / y_46_im)); elseif (y_46_im <= -1.55e-118) tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_0; elseif (y_46_im <= 9.5e-111) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 2.9e+60) tmp = ((y_46_re * x_46_im) / t_0) - ((y_46_im * x_46_re) / t_0); else tmp = ((y_46_re / y_46_im) * (x_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_] := Block[{t$95$0 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5.8e+20], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re - N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.55e-118], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 9.5e-111], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 2.9e+60], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / t$95$0), $MachinePrecision] - N[(N[(y$46$im * x$46$re), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
\mathbf{if}\;y.im \leq -5.8 \cdot 10^{+20}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.re - \frac{y.re \cdot x.im}{y.im}\right)\\
\mathbf{elif}\;y.im \leq -1.55 \cdot 10^{-118}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{t_0}\\
\mathbf{elif}\;y.im \leq 9.5 \cdot 10^{-111}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 2.9 \cdot 10^{+60}:\\
\;\;\;\;\frac{y.re \cdot x.im}{t_0} - \frac{y.im \cdot x.re}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -5.8e20Initial program 43.9%
*-un-lft-identity43.9%
add-sqr-sqrt43.9%
times-frac43.9%
hypot-def43.9%
hypot-def66.8%
Applied egg-rr66.8%
Taylor expanded in y.im around -inf 80.2%
+-commutative80.2%
mul-1-neg80.2%
unsub-neg80.2%
Simplified80.2%
if -5.8e20 < y.im < -1.5500000000000001e-118Initial program 79.3%
if -1.5500000000000001e-118 < y.im < 9.4999999999999995e-111Initial program 71.8%
*-un-lft-identity71.8%
add-sqr-sqrt71.8%
times-frac71.8%
hypot-def71.8%
hypot-def89.3%
Applied egg-rr89.3%
Taylor expanded in y.re around inf 83.6%
metadata-eval83.6%
unpow283.6%
times-frac90.9%
cancel-sign-sub-inv90.9%
*-commutative90.9%
*-rgt-identity90.9%
associate-*l/92.0%
associate-*r/91.7%
div-sub92.9%
associate-*r/93.2%
Simplified93.2%
if 9.4999999999999995e-111 < y.im < 2.9e60Initial program 89.7%
Taylor expanded in x.im around 0 89.7%
+-commutative89.7%
associate-*r/89.7%
mul-1-neg89.7%
distribute-rgt-neg-out89.7%
unpow289.7%
unpow289.7%
unpow289.7%
unpow289.7%
Simplified89.7%
if 2.9e60 < y.im Initial program 53.2%
Taylor expanded in y.re around 0 80.1%
+-commutative80.1%
mul-1-neg80.1%
unsub-neg80.1%
unpow280.1%
times-frac82.0%
Simplified82.0%
Final simplification85.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im)))
(t_1 (- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im))))
(if (<= y.im -5e+20)
t_1
(if (<= y.im -3.6e-122)
(/ (- (* y.re x.im) (* y.im x.re)) t_0)
(if (<= y.im 1.28e-107)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 3.8e+62)
(- (/ (* y.re x.im) t_0) (/ (* y.im x.re) 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 * y_46_re) + (y_46_im * y_46_im);
double t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -5e+20) {
tmp = t_1;
} else if (y_46_im <= -3.6e-122) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_0;
} else if (y_46_im <= 1.28e-107) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 3.8e+62) {
tmp = ((y_46_re * x_46_im) / t_0) - ((y_46_im * x_46_re) / 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 * y_46re) + (y_46im * y_46im)
t_1 = ((y_46re / y_46im) * (x_46im / y_46im)) - (x_46re / y_46im)
if (y_46im <= (-5d+20)) then
tmp = t_1
else if (y_46im <= (-3.6d-122)) then
tmp = ((y_46re * x_46im) - (y_46im * x_46re)) / t_0
else if (y_46im <= 1.28d-107) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else if (y_46im <= 3.8d+62) then
tmp = ((y_46re * x_46im) / t_0) - ((y_46im * x_46re) / 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 * y_46_re) + (y_46_im * y_46_im);
double t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -5e+20) {
tmp = t_1;
} else if (y_46_im <= -3.6e-122) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_0;
} else if (y_46_im <= 1.28e-107) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 3.8e+62) {
tmp = ((y_46_re * x_46_im) / t_0) - ((y_46_im * x_46_re) / 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 * y_46_re) + (y_46_im * y_46_im) t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -5e+20: tmp = t_1 elif y_46_im <= -3.6e-122: tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_0 elif y_46_im <= 1.28e-107: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 3.8e+62: tmp = ((y_46_re * x_46_im) / t_0) - ((y_46_im * x_46_re) / 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(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) t_1 = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -5e+20) tmp = t_1; elseif (y_46_im <= -3.6e-122) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / t_0); elseif (y_46_im <= 1.28e-107) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 3.8e+62) tmp = Float64(Float64(Float64(y_46_re * x_46_im) / t_0) - Float64(Float64(y_46_im * x_46_re) / 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 * y_46_re) + (y_46_im * y_46_im); t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -5e+20) tmp = t_1; elseif (y_46_im <= -3.6e-122) tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_0; elseif (y_46_im <= 1.28e-107) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 3.8e+62) tmp = ((y_46_re * x_46_im) / t_0) - ((y_46_im * x_46_re) / 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[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5e+20], t$95$1, If[LessEqual[y$46$im, -3.6e-122], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 1.28e-107], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 3.8e+62], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / t$95$0), $MachinePrecision] - N[(N[(y$46$im * x$46$re), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
t_1 := \frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -5 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -3.6 \cdot 10^{-122}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{t_0}\\
\mathbf{elif}\;y.im \leq 1.28 \cdot 10^{-107}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 3.8 \cdot 10^{+62}:\\
\;\;\;\;\frac{y.re \cdot x.im}{t_0} - \frac{y.im \cdot x.re}{t_0}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -5e20 or 3.79999999999999984e62 < y.im Initial program 48.3%
Taylor expanded in y.re around 0 78.5%
+-commutative78.5%
mul-1-neg78.5%
unsub-neg78.5%
unpow278.5%
times-frac80.2%
Simplified80.2%
if -5e20 < y.im < -3.59999999999999994e-122Initial program 79.3%
if -3.59999999999999994e-122 < y.im < 1.28e-107Initial program 71.8%
*-un-lft-identity71.8%
add-sqr-sqrt71.8%
times-frac71.8%
hypot-def71.8%
hypot-def89.3%
Applied egg-rr89.3%
Taylor expanded in y.re around inf 83.6%
metadata-eval83.6%
unpow283.6%
times-frac90.9%
cancel-sign-sub-inv90.9%
*-commutative90.9%
*-rgt-identity90.9%
associate-*l/92.0%
associate-*r/91.7%
div-sub92.9%
associate-*r/93.2%
Simplified93.2%
if 1.28e-107 < y.im < 3.79999999999999984e62Initial program 89.7%
Taylor expanded in x.im around 0 89.7%
+-commutative89.7%
associate-*r/89.7%
mul-1-neg89.7%
distribute-rgt-neg-out89.7%
unpow289.7%
unpow289.7%
unpow289.7%
unpow289.7%
Simplified89.7%
Final simplification85.5%
(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 (- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im))))
(if (<= y.im -5.6e+20)
t_1
(if (<= y.im -2.2e-115)
t_0
(if (<= y.im 1.45e-114)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 2.9e+58) 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 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -5.6e+20) {
tmp = t_1;
} else if (y_46_im <= -2.2e-115) {
tmp = t_0;
} else if (y_46_im <= 1.45e-114) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 2.9e+58) {
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 = ((y_46re / y_46im) * (x_46im / y_46im)) - (x_46re / y_46im)
if (y_46im <= (-5.6d+20)) then
tmp = t_1
else if (y_46im <= (-2.2d-115)) then
tmp = t_0
else if (y_46im <= 1.45d-114) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else if (y_46im <= 2.9d+58) 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 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -5.6e+20) {
tmp = t_1;
} else if (y_46_im <= -2.2e-115) {
tmp = t_0;
} else if (y_46_im <= 1.45e-114) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 2.9e+58) {
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 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -5.6e+20: tmp = t_1 elif y_46_im <= -2.2e-115: tmp = t_0 elif y_46_im <= 1.45e-114: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 2.9e+58: 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(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -5.6e+20) tmp = t_1; elseif (y_46_im <= -2.2e-115) tmp = t_0; elseif (y_46_im <= 1.45e-114) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 2.9e+58) 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 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -5.6e+20) tmp = t_1; elseif (y_46_im <= -2.2e-115) tmp = t_0; elseif (y_46_im <= 1.45e-114) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 2.9e+58) 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[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5.6e+20], t$95$1, If[LessEqual[y$46$im, -2.2e-115], t$95$0, If[LessEqual[y$46$im, 1.45e-114], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 2.9e+58], 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{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -5.6 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -2.2 \cdot 10^{-115}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.45 \cdot 10^{-114}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 2.9 \cdot 10^{+58}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -5.6e20 or 2.90000000000000002e58 < y.im Initial program 48.3%
Taylor expanded in y.re around 0 78.5%
+-commutative78.5%
mul-1-neg78.5%
unsub-neg78.5%
unpow278.5%
times-frac80.2%
Simplified80.2%
if -5.6e20 < y.im < -2.1999999999999999e-115 or 1.44999999999999998e-114 < y.im < 2.90000000000000002e58Initial program 84.5%
if -2.1999999999999999e-115 < y.im < 1.44999999999999998e-114Initial program 71.8%
*-un-lft-identity71.8%
add-sqr-sqrt71.8%
times-frac71.8%
hypot-def71.8%
hypot-def89.3%
Applied egg-rr89.3%
Taylor expanded in y.re around inf 83.6%
metadata-eval83.6%
unpow283.6%
times-frac90.9%
cancel-sign-sub-inv90.9%
*-commutative90.9%
*-rgt-identity90.9%
associate-*l/92.0%
associate-*r/91.7%
div-sub92.9%
associate-*r/93.2%
Simplified93.2%
Final simplification85.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3e+21) (not (<= y.im 1.1e-32))) (- (* (/ y.re y.im) (/ 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 <= -3e+21) || !(y_46_im <= 1.1e-32)) {
tmp = ((y_46_re / y_46_im) * (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 <= (-3d+21)) .or. (.not. (y_46im <= 1.1d-32))) then
tmp = ((y_46re / y_46im) * (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 <= -3e+21) || !(y_46_im <= 1.1e-32)) {
tmp = ((y_46_re / y_46_im) * (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 <= -3e+21) or not (y_46_im <= 1.1e-32): tmp = ((y_46_re / y_46_im) * (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 <= -3e+21) || !(y_46_im <= 1.1e-32)) tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(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 <= -3e+21) || ~((y_46_im <= 1.1e-32))) tmp = ((y_46_re / y_46_im) * (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, -3e+21], N[Not[LessEqual[y$46$im, 1.1e-32]], $MachinePrecision]], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $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 -3 \cdot 10^{+21} \lor \neg \left(y.im \leq 1.1 \cdot 10^{-32}\right):\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \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 < -3e21 or 1.1e-32 < y.im Initial program 54.0%
Taylor expanded in y.re around 0 76.7%
+-commutative76.7%
mul-1-neg76.7%
unsub-neg76.7%
unpow276.7%
times-frac78.2%
Simplified78.2%
if -3e21 < y.im < 1.1e-32Initial program 75.1%
*-un-lft-identity75.1%
add-sqr-sqrt75.1%
times-frac75.0%
hypot-def75.1%
hypot-def88.3%
Applied egg-rr88.3%
Taylor expanded in y.re around inf 76.7%
metadata-eval76.7%
unpow276.7%
times-frac81.5%
cancel-sign-sub-inv81.5%
*-commutative81.5%
*-rgt-identity81.5%
associate-*l/82.2%
associate-*r/82.0%
div-sub82.9%
associate-*r/83.1%
Simplified83.1%
Final simplification80.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.75e+23) (not (<= y.im 5.5e+34))) (- (/ 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.75e+23) || !(y_46_im <= 5.5e+34)) {
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 <= (-1.75d+23)) .or. (.not. (y_46im <= 5.5d+34))) 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 <= -1.75e+23) || !(y_46_im <= 5.5e+34)) {
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 <= -1.75e+23) or not (y_46_im <= 5.5e+34): 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 <= -1.75e+23) || !(y_46_im <= 5.5e+34)) tmp = Float64(-Float64(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.75e+23) || ~((y_46_im <= 5.5e+34))) 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, -1.75e+23], N[Not[LessEqual[y$46$im, 5.5e+34]], $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 -1.75 \cdot 10^{+23} \lor \neg \left(y.im \leq 5.5 \cdot 10^{+34}\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 < -1.7500000000000001e23 or 5.4999999999999996e34 < y.im Initial program 50.9%
Taylor expanded in y.re around 0 76.1%
associate-*r/76.1%
neg-mul-176.1%
Simplified76.1%
if -1.7500000000000001e23 < y.im < 5.4999999999999996e34Initial program 75.8%
*-un-lft-identity75.8%
add-sqr-sqrt75.8%
times-frac75.8%
hypot-def75.8%
hypot-def89.3%
Applied egg-rr89.3%
Taylor expanded in y.re around inf 72.5%
metadata-eval72.5%
unpow272.5%
times-frac78.2%
cancel-sign-sub-inv78.2%
*-commutative78.2%
*-rgt-identity78.2%
associate-*l/78.9%
associate-*r/78.7%
div-sub79.6%
associate-*r/79.7%
Simplified79.7%
Final simplification78.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.7e+21) (not (<= y.im 1.7e-10))) (- (/ 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+21) || !(y_46_im <= 1.7e-10)) {
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+21)) .or. (.not. (y_46im <= 1.7d-10))) 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+21) || !(y_46_im <= 1.7e-10)) {
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+21) or not (y_46_im <= 1.7e-10): 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+21) || !(y_46_im <= 1.7e-10)) 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 <= -1.7e+21) || ~((y_46_im <= 1.7e-10))) 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+21], N[Not[LessEqual[y$46$im, 1.7e-10]], $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^{+21} \lor \neg \left(y.im \leq 1.7 \cdot 10^{-10}\right):\\
\;\;\;\;-\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.7e21 or 1.70000000000000007e-10 < y.im Initial program 51.4%
Taylor expanded in y.re around 0 74.7%
associate-*r/74.7%
neg-mul-174.7%
Simplified74.7%
if -1.7e21 < y.im < 1.70000000000000007e-10Initial program 76.3%
Taylor expanded in y.re around inf 65.5%
Final simplification69.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -5e+130) (/ x.re y.im) (if (<= y.im 2.8e+225) (/ x.im y.re) (/ 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+130) {
tmp = x_46_re / y_46_im;
} else if (y_46_im <= 2.8e+225) {
tmp = x_46_im / y_46_re;
} else {
tmp = 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+130)) then
tmp = x_46re / y_46im
else if (y_46im <= 2.8d+225) then
tmp = x_46im / y_46re
else
tmp = 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+130) {
tmp = x_46_re / y_46_im;
} else if (y_46_im <= 2.8e+225) {
tmp = x_46_im / y_46_re;
} else {
tmp = 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+130: tmp = x_46_re / y_46_im elif y_46_im <= 2.8e+225: tmp = x_46_im / y_46_re else: tmp = 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+130) tmp = Float64(x_46_re / y_46_im); elseif (y_46_im <= 2.8e+225) tmp = Float64(x_46_im / y_46_re); else tmp = 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+130) tmp = x_46_re / y_46_im; elseif (y_46_im <= 2.8e+225) tmp = x_46_im / y_46_re; else tmp = 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+130], N[(x$46$re / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 2.8e+225], N[(x$46$im / y$46$re), $MachinePrecision], N[(x$46$re / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5 \cdot 10^{+130}:\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 2.8 \cdot 10^{+225}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -4.9999999999999996e130 or 2.8e225 < y.im Initial program 33.2%
*-un-lft-identity33.2%
add-sqr-sqrt33.2%
times-frac33.2%
hypot-def33.2%
hypot-def56.5%
Applied egg-rr56.5%
Taylor expanded in y.im around -inf 69.5%
Taylor expanded in y.re around 0 32.3%
if -4.9999999999999996e130 < y.im < 2.8e225Initial program 72.9%
Taylor expanded in y.re around inf 51.9%
Final simplification47.8%
(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 64.5%
*-un-lft-identity64.5%
add-sqr-sqrt64.5%
times-frac64.5%
hypot-def64.5%
hypot-def79.6%
Applied egg-rr79.6%
Taylor expanded in y.re around -inf 34.2%
Taylor expanded in y.im around -inf 5.9%
+-commutative5.9%
mul-1-neg5.9%
unsub-neg5.9%
Simplified5.9%
Taylor expanded in x.im around inf 9.0%
Final simplification9.0%
(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 64.5%
Taylor expanded in y.re around inf 43.3%
Final simplification43.3%
herbie shell --seed 2023200
(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))))