
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im 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_re * y_46_re) + (x_46_im * 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_46re * y_46re) + (x_46im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + Float64(x_46_im * 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_re * y_46_re) + (x_46_im * 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$re * y$46$re), $MachinePrecision] + N[(x$46$im * 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.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im 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_re * y_46_re) + (x_46_im * 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_46re * y_46re) + (x_46im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + Float64(x_46_im * 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_re * y_46_re) + (x_46_im * 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$re * y$46$re), $MachinePrecision] + N[(x$46$im * 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.re \cdot y.re + x.im \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
(let* ((t_0 (+ (* x.re y.re) (* x.im y.im))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) INFINITY)
(/ (/ t_0 (hypot y.re y.im)) (hypot y.re y.im))
(+ (/ x.im y.im) (/ 1.0 (/ y.im (* x.re (/ 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 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= ((double) INFINITY)) {
tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
} else {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (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 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= Double.POSITIVE_INFINITY) {
tmp = (t_0 / Math.hypot(y_46_re, y_46_im)) / Math.hypot(y_46_re, y_46_im);
} else {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im))));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= math.inf: tmp = (t_0 / math.hypot(y_46_re, y_46_im)) / math.hypot(y_46_re, y_46_im) else: tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (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(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= Inf) tmp = Float64(Float64(t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)); else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im / Float64(x_46_re * Float64(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 = (x_46_re * y_46_re) + (x_46_im * y_46_im); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= Inf) tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im); else tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (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[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $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], Infinity], N[(N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im / N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot y.re + x.im \cdot y.im\\
\mathbf{if}\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im} \leq \infty:\\
\;\;\;\;\frac{\frac{t_0}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < +inf.0Initial program 77.6%
*-un-lft-identity77.6%
add-sqr-sqrt77.6%
times-frac77.5%
hypot-def77.5%
fma-def77.5%
hypot-def94.0%
Applied egg-rr94.0%
associate-*l/94.3%
*-un-lft-identity94.3%
Applied egg-rr94.3%
fma-def94.3%
Applied egg-rr94.3%
if +inf.0 < (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 0.0%
Taylor expanded in y.re around 0 45.3%
+-commutative45.3%
unpow245.3%
associate-/l*48.0%
Simplified48.0%
clear-num48.0%
inv-pow48.0%
associate-/l*51.7%
Applied egg-rr51.7%
unpow-151.7%
associate-/l/55.3%
Simplified55.3%
Final simplification86.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ y.im (/ y.re x.im))))
(if (<= y.re -1.46e+85)
(/ (- (- x.re) t_1) (hypot y.re y.im))
(if (<= y.re -9e-46)
t_0
(if (<= y.re 2.6e-159)
(+ (/ x.im y.im) (/ 1.0 (/ y.im (* x.re (/ y.re y.im)))))
(if (<= y.re 2.45e+36)
t_0
(* (/ 1.0 (hypot y.re y.im)) (+ x.re t_1))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = y_46_im / (y_46_re / x_46_im);
double tmp;
if (y_46_re <= -1.46e+85) {
tmp = (-x_46_re - t_1) / hypot(y_46_re, y_46_im);
} else if (y_46_re <= -9e-46) {
tmp = t_0;
} else if (y_46_re <= 2.6e-159) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im))));
} else if (y_46_re <= 2.45e+36) {
tmp = t_0;
} else {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_re + 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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = y_46_im / (y_46_re / x_46_im);
double tmp;
if (y_46_re <= -1.46e+85) {
tmp = (-x_46_re - t_1) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_re <= -9e-46) {
tmp = t_0;
} else if (y_46_re <= 2.6e-159) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im))));
} else if (y_46_re <= 2.45e+36) {
tmp = t_0;
} else {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_re + t_1);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = y_46_im / (y_46_re / x_46_im) tmp = 0 if y_46_re <= -1.46e+85: tmp = (-x_46_re - t_1) / math.hypot(y_46_re, y_46_im) elif y_46_re <= -9e-46: tmp = t_0 elif y_46_re <= 2.6e-159: tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im)))) elif y_46_re <= 2.45e+36: tmp = t_0 else: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_re + t_1) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(y_46_im / Float64(y_46_re / x_46_im)) tmp = 0.0 if (y_46_re <= -1.46e+85) tmp = Float64(Float64(Float64(-x_46_re) - t_1) / hypot(y_46_re, y_46_im)); elseif (y_46_re <= -9e-46) tmp = t_0; elseif (y_46_re <= 2.6e-159) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im / Float64(x_46_re * Float64(y_46_re / y_46_im))))); elseif (y_46_re <= 2.45e+36) tmp = t_0; else tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_re + t_1)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = y_46_im / (y_46_re / x_46_im); tmp = 0.0; if (y_46_re <= -1.46e+85) tmp = (-x_46_re - t_1) / hypot(y_46_re, y_46_im); elseif (y_46_re <= -9e-46) tmp = t_0; elseif (y_46_re <= 2.6e-159) tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im)))); elseif (y_46_re <= 2.45e+36) tmp = t_0; else tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_re + 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[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $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[(y$46$im / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.46e+85], N[(N[((-x$46$re) - t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -9e-46], t$95$0, If[LessEqual[y$46$re, 2.6e-159], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im / N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.45e+36], t$95$0, N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{y.im}{\frac{y.re}{x.im}}\\
\mathbf{if}\;y.re \leq -1.46 \cdot 10^{+85}:\\
\;\;\;\;\frac{\left(-x.re\right) - t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \leq -9 \cdot 10^{-46}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 2.6 \cdot 10^{-159}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{+36}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.re + t_1\right)\\
\end{array}
\end{array}
if y.re < -1.46e85Initial program 41.5%
*-un-lft-identity41.5%
add-sqr-sqrt41.5%
times-frac41.5%
hypot-def41.5%
fma-def41.5%
hypot-def57.7%
Applied egg-rr57.7%
associate-*l/57.9%
*-un-lft-identity57.9%
Applied egg-rr57.9%
Taylor expanded in y.re around -inf 83.6%
+-commutative83.6%
mul-1-neg83.6%
unsub-neg83.6%
mul-1-neg83.6%
associate-/l*87.7%
Simplified87.7%
if -1.46e85 < y.re < -9.00000000000000001e-46 or 2.5999999999999998e-159 < y.re < 2.4499999999999999e36Initial program 90.0%
if -9.00000000000000001e-46 < y.re < 2.5999999999999998e-159Initial program 63.0%
Taylor expanded in y.re around 0 80.4%
+-commutative80.4%
unpow280.4%
associate-/l*77.1%
Simplified77.1%
clear-num77.1%
inv-pow77.1%
associate-/l*82.2%
Applied egg-rr82.2%
unpow-182.2%
associate-/l/85.4%
Simplified85.4%
if 2.4499999999999999e36 < y.re Initial program 43.4%
*-un-lft-identity43.4%
add-sqr-sqrt43.4%
times-frac43.4%
hypot-def43.4%
fma-def43.4%
hypot-def62.3%
Applied egg-rr62.3%
Taylor expanded in y.re around inf 78.6%
associate-/l*80.5%
Simplified80.5%
Final simplification86.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ y.im (/ y.re x.im))))
(if (<= y.re -2.15e+85)
(/ (- (- x.re) t_1) (hypot y.re y.im))
(if (<= y.re -1.15e-45)
t_0
(if (<= y.re 4.5e-159)
(+ (/ x.im y.im) (/ 1.0 (/ y.im (* x.re (/ y.re y.im)))))
(if (<= y.re 1.2e+34) t_0 (* (+ x.re t_1) (/ 1.0 y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = y_46_im / (y_46_re / x_46_im);
double tmp;
if (y_46_re <= -2.15e+85) {
tmp = (-x_46_re - t_1) / hypot(y_46_re, y_46_im);
} else if (y_46_re <= -1.15e-45) {
tmp = t_0;
} else if (y_46_re <= 4.5e-159) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im))));
} else if (y_46_re <= 1.2e+34) {
tmp = t_0;
} else {
tmp = (x_46_re + t_1) * (1.0 / y_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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = y_46_im / (y_46_re / x_46_im);
double tmp;
if (y_46_re <= -2.15e+85) {
tmp = (-x_46_re - t_1) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_re <= -1.15e-45) {
tmp = t_0;
} else if (y_46_re <= 4.5e-159) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im))));
} else if (y_46_re <= 1.2e+34) {
tmp = t_0;
} else {
tmp = (x_46_re + t_1) * (1.0 / y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = y_46_im / (y_46_re / x_46_im) tmp = 0 if y_46_re <= -2.15e+85: tmp = (-x_46_re - t_1) / math.hypot(y_46_re, y_46_im) elif y_46_re <= -1.15e-45: tmp = t_0 elif y_46_re <= 4.5e-159: tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im)))) elif y_46_re <= 1.2e+34: tmp = t_0 else: tmp = (x_46_re + t_1) * (1.0 / y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(y_46_im / Float64(y_46_re / x_46_im)) tmp = 0.0 if (y_46_re <= -2.15e+85) tmp = Float64(Float64(Float64(-x_46_re) - t_1) / hypot(y_46_re, y_46_im)); elseif (y_46_re <= -1.15e-45) tmp = t_0; elseif (y_46_re <= 4.5e-159) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im / Float64(x_46_re * Float64(y_46_re / y_46_im))))); elseif (y_46_re <= 1.2e+34) tmp = t_0; else tmp = Float64(Float64(x_46_re + t_1) * Float64(1.0 / y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = y_46_im / (y_46_re / x_46_im); tmp = 0.0; if (y_46_re <= -2.15e+85) tmp = (-x_46_re - t_1) / hypot(y_46_re, y_46_im); elseif (y_46_re <= -1.15e-45) tmp = t_0; elseif (y_46_re <= 4.5e-159) tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im)))); elseif (y_46_re <= 1.2e+34) tmp = t_0; else tmp = (x_46_re + t_1) * (1.0 / y_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[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $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[(y$46$im / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.15e+85], N[(N[((-x$46$re) - t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.15e-45], t$95$0, If[LessEqual[y$46$re, 4.5e-159], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im / N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.2e+34], t$95$0, N[(N[(x$46$re + t$95$1), $MachinePrecision] * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{y.im}{\frac{y.re}{x.im}}\\
\mathbf{if}\;y.re \leq -2.15 \cdot 10^{+85}:\\
\;\;\;\;\frac{\left(-x.re\right) - t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \leq -1.15 \cdot 10^{-45}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 4.5 \cdot 10^{-159}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+34}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(x.re + t_1\right) \cdot \frac{1}{y.re}\\
\end{array}
\end{array}
if y.re < -2.15e85Initial program 41.5%
*-un-lft-identity41.5%
add-sqr-sqrt41.5%
times-frac41.5%
hypot-def41.5%
fma-def41.5%
hypot-def57.7%
Applied egg-rr57.7%
associate-*l/57.9%
*-un-lft-identity57.9%
Applied egg-rr57.9%
Taylor expanded in y.re around -inf 83.6%
+-commutative83.6%
mul-1-neg83.6%
unsub-neg83.6%
mul-1-neg83.6%
associate-/l*87.7%
Simplified87.7%
if -2.15e85 < y.re < -1.14999999999999996e-45 or 4.49999999999999989e-159 < y.re < 1.19999999999999993e34Initial program 90.0%
if -1.14999999999999996e-45 < y.re < 4.49999999999999989e-159Initial program 63.0%
Taylor expanded in y.re around 0 80.4%
+-commutative80.4%
unpow280.4%
associate-/l*77.1%
Simplified77.1%
clear-num77.1%
inv-pow77.1%
associate-/l*82.2%
Applied egg-rr82.2%
unpow-182.2%
associate-/l/85.4%
Simplified85.4%
if 1.19999999999999993e34 < y.re Initial program 43.4%
*-un-lft-identity43.4%
add-sqr-sqrt43.4%
times-frac43.4%
hypot-def43.4%
fma-def43.4%
hypot-def62.3%
Applied egg-rr62.3%
Taylor expanded in y.re around inf 78.6%
associate-/l*80.5%
Simplified80.5%
Taylor expanded in y.re around inf 80.2%
Final simplification86.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4.1e+18) (not (<= y.im 7e+26))) (+ (/ x.im y.im) (/ 1.0 (/ y.im (* x.re (/ y.re y.im))))) (* (+ x.re (/ y.im (/ y.re x.im))) (/ 1.0 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 <= -4.1e+18) || !(y_46_im <= 7e+26)) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im))));
} else {
tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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 <= (-4.1d+18)) .or. (.not. (y_46im <= 7d+26))) then
tmp = (x_46im / y_46im) + (1.0d0 / (y_46im / (x_46re * (y_46re / y_46im))))
else
tmp = (x_46re + (y_46im / (y_46re / x_46im))) * (1.0d0 / 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 <= -4.1e+18) || !(y_46_im <= 7e+26)) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im))));
} else {
tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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 <= -4.1e+18) or not (y_46_im <= 7e+26): tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im)))) else: tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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 <= -4.1e+18) || !(y_46_im <= 7e+26)) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im / Float64(x_46_re * Float64(y_46_re / y_46_im))))); else tmp = Float64(Float64(x_46_re + Float64(y_46_im / Float64(y_46_re / x_46_im))) * Float64(1.0 / 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 <= -4.1e+18) || ~((y_46_im <= 7e+26))) tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re * (y_46_re / y_46_im)))); else tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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, -4.1e+18], N[Not[LessEqual[y$46$im, 7e+26]], $MachinePrecision]], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im / N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re + N[(y$46$im / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.1 \cdot 10^{+18} \lor \neg \left(y.im \leq 7 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{x.re \cdot \frac{y.re}{y.im}}}\\
\mathbf{else}:\\
\;\;\;\;\left(x.re + \frac{y.im}{\frac{y.re}{x.im}}\right) \cdot \frac{1}{y.re}\\
\end{array}
\end{array}
if y.im < -4.1e18 or 6.9999999999999998e26 < y.im Initial program 48.9%
Taylor expanded in y.re around 0 74.4%
+-commutative74.4%
unpow274.4%
associate-/l*70.8%
Simplified70.8%
clear-num70.8%
inv-pow70.8%
associate-/l*73.2%
Applied egg-rr73.2%
unpow-173.2%
associate-/l/79.1%
Simplified79.1%
if -4.1e18 < y.im < 6.9999999999999998e26Initial program 73.4%
*-un-lft-identity73.4%
add-sqr-sqrt73.4%
times-frac73.4%
hypot-def73.4%
fma-def73.4%
hypot-def85.4%
Applied egg-rr85.4%
Taylor expanded in y.re around inf 54.2%
associate-/l*53.5%
Simplified53.5%
Taylor expanded in y.re around inf 86.3%
Final simplification82.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2e+38) (not (<= y.im 4e+37))) (/ x.im y.im) (* (+ x.re (/ y.im (/ y.re x.im))) (/ 1.0 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 <= -2e+38) || !(y_46_im <= 4e+37)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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 <= (-2d+38)) .or. (.not. (y_46im <= 4d+37))) then
tmp = x_46im / y_46im
else
tmp = (x_46re + (y_46im / (y_46re / x_46im))) * (1.0d0 / 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 <= -2e+38) || !(y_46_im <= 4e+37)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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 <= -2e+38) or not (y_46_im <= 4e+37): tmp = x_46_im / y_46_im else: tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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 <= -2e+38) || !(y_46_im <= 4e+37)) tmp = Float64(x_46_im / y_46_im); else tmp = Float64(Float64(x_46_re + Float64(y_46_im / Float64(y_46_re / x_46_im))) * Float64(1.0 / 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 <= -2e+38) || ~((y_46_im <= 4e+37))) tmp = x_46_im / y_46_im; else tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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, -2e+38], N[Not[LessEqual[y$46$im, 4e+37]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], N[(N[(x$46$re + N[(y$46$im / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2 \cdot 10^{+38} \lor \neg \left(y.im \leq 4 \cdot 10^{+37}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\left(x.re + \frac{y.im}{\frac{y.re}{x.im}}\right) \cdot \frac{1}{y.re}\\
\end{array}
\end{array}
if y.im < -1.99999999999999995e38 or 3.99999999999999982e37 < y.im Initial program 47.1%
Taylor expanded in y.re around 0 67.1%
if -1.99999999999999995e38 < y.im < 3.99999999999999982e37Initial program 73.9%
*-un-lft-identity73.9%
add-sqr-sqrt73.8%
times-frac73.8%
hypot-def73.8%
fma-def73.9%
hypot-def85.3%
Applied egg-rr85.3%
Taylor expanded in y.re around inf 52.7%
associate-/l*52.1%
Simplified52.1%
Taylor expanded in y.re around inf 84.2%
Final simplification76.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4.8e+18) (not (<= y.im 8e+26))) (+ (/ x.im y.im) (* y.re (/ x.re (* y.im y.im)))) (* (+ x.re (/ y.im (/ y.re x.im))) (/ 1.0 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 <= -4.8e+18) || !(y_46_im <= 8e+26)) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / (y_46_im * y_46_im)));
} else {
tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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 <= (-4.8d+18)) .or. (.not. (y_46im <= 8d+26))) then
tmp = (x_46im / y_46im) + (y_46re * (x_46re / (y_46im * y_46im)))
else
tmp = (x_46re + (y_46im / (y_46re / x_46im))) * (1.0d0 / 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 <= -4.8e+18) || !(y_46_im <= 8e+26)) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / (y_46_im * y_46_im)));
} else {
tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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 <= -4.8e+18) or not (y_46_im <= 8e+26): tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / (y_46_im * y_46_im))) else: tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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 <= -4.8e+18) || !(y_46_im <= 8e+26)) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(y_46_re * Float64(x_46_re / Float64(y_46_im * y_46_im)))); else tmp = Float64(Float64(x_46_re + Float64(y_46_im / Float64(y_46_re / x_46_im))) * Float64(1.0 / 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 <= -4.8e+18) || ~((y_46_im <= 8e+26))) tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / (y_46_im * y_46_im))); else tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) * (1.0 / 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, -4.8e+18], N[Not[LessEqual[y$46$im, 8e+26]], $MachinePrecision]], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(y$46$re * N[(x$46$re / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re + N[(y$46$im / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.8 \cdot 10^{+18} \lor \neg \left(y.im \leq 8 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x.im}{y.im} + y.re \cdot \frac{x.re}{y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\left(x.re + \frac{y.im}{\frac{y.re}{x.im}}\right) \cdot \frac{1}{y.re}\\
\end{array}
\end{array}
if y.im < -4.8e18 or 8.00000000000000038e26 < y.im Initial program 48.9%
Taylor expanded in y.re around 0 74.4%
+-commutative74.4%
unpow274.4%
associate-/l*70.8%
associate-/r/76.3%
Simplified76.3%
if -4.8e18 < y.im < 8.00000000000000038e26Initial program 73.4%
*-un-lft-identity73.4%
add-sqr-sqrt73.4%
times-frac73.4%
hypot-def73.4%
fma-def73.4%
hypot-def85.4%
Applied egg-rr85.4%
Taylor expanded in y.re around inf 54.2%
associate-/l*53.5%
Simplified53.5%
Taylor expanded in y.re around inf 86.3%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.9e+38) (not (<= y.im 3.3e+34))) (/ x.im y.im) (/ x.re (+ y.re (/ (* y.im y.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.9e+38) || !(y_46_im <= 3.3e+34)) {
tmp = x_46_im / y_46_im;
} else {
tmp = x_46_re / (y_46_re + ((y_46_im * y_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.9d+38)) .or. (.not. (y_46im <= 3.3d+34))) then
tmp = x_46im / y_46im
else
tmp = x_46re / (y_46re + ((y_46im * y_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.9e+38) || !(y_46_im <= 3.3e+34)) {
tmp = x_46_im / y_46_im;
} else {
tmp = x_46_re / (y_46_re + ((y_46_im * y_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.9e+38) or not (y_46_im <= 3.3e+34): tmp = x_46_im / y_46_im else: tmp = x_46_re / (y_46_re + ((y_46_im * y_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.9e+38) || !(y_46_im <= 3.3e+34)) tmp = Float64(x_46_im / y_46_im); else tmp = Float64(x_46_re / Float64(y_46_re + Float64(Float64(y_46_im * y_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.9e+38) || ~((y_46_im <= 3.3e+34))) tmp = x_46_im / y_46_im; else tmp = x_46_re / (y_46_re + ((y_46_im * y_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.9e+38], N[Not[LessEqual[y$46$im, 3.3e+34]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], N[(x$46$re / N[(y$46$re + N[(N[(y$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.9 \cdot 10^{+38} \lor \neg \left(y.im \leq 3.3 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re + \frac{y.im \cdot y.im}{y.re}}\\
\end{array}
\end{array}
if y.im < -1.8999999999999999e38 or 3.29999999999999988e34 < y.im Initial program 47.1%
Taylor expanded in y.re around 0 67.1%
if -1.8999999999999999e38 < y.im < 3.29999999999999988e34Initial program 73.9%
*-un-lft-identity73.9%
add-sqr-sqrt73.8%
times-frac73.8%
hypot-def73.8%
fma-def73.9%
hypot-def85.3%
Applied egg-rr85.3%
Taylor expanded in x.re around inf 49.1%
associate-/l*53.8%
unpow253.8%
unpow253.8%
Simplified53.8%
Taylor expanded in y.re around 0 69.4%
unpow269.4%
Simplified69.4%
Final simplification68.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -2.1e+38) (/ x.im y.im) (if (<= y.im 7e+26) (/ 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_im <= -2.1e+38) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 7e+26) {
tmp = x_46_re / 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.1d+38)) then
tmp = x_46im / y_46im
else if (y_46im <= 7d+26) then
tmp = x_46re / 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.1e+38) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 7e+26) {
tmp = x_46_re / 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.1e+38: tmp = x_46_im / y_46_im elif y_46_im <= 7e+26: tmp = x_46_re / 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.1e+38) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 7e+26) tmp = Float64(x_46_re / 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.1e+38) tmp = x_46_im / y_46_im; elseif (y_46_im <= 7e+26) tmp = x_46_re / 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.1e+38], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 7e+26], N[(x$46$re / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.1 \cdot 10^{+38}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 7 \cdot 10^{+26}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -2.1e38 or 6.9999999999999998e26 < y.im Initial program 47.6%
Taylor expanded in y.re around 0 66.3%
if -2.1e38 < y.im < 6.9999999999999998e26Initial program 74.0%
Taylor expanded in y.re around inf 65.5%
Final simplification65.9%
(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 61.8%
Taylor expanded in y.re around 0 38.3%
Final simplification38.3%
herbie shell --seed 2023230
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
:precision binary64
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))