
(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 12 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
(if (<=
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
INFINITY)
(/ (/ (fma x.re y.re (* x.im y.im)) (hypot y.re y.im)) (hypot y.re y.im))
(* (/ y.re (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 tmp;
if ((((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) INFINITY)) {
tmp = (fma(x_46_re, y_46_re, (x_46_im * y_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
} else {
tmp = (y_46_re / hypot(y_46_re, y_46_im)) * (x_46_re / hypot(y_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 (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))) <= Inf) tmp = Float64(Float64(fma(x_46_re, y_46_re, Float64(x_46_im * y_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)); else tmp = Float64(Float64(y_46_re / hypot(y_46_re, y_46_im)) * Float64(x_46_re / hypot(y_46_re, y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[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], Infinity], N[(N[(N[(x$46$re * y$46$re + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / 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[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leq \infty:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\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 79.7%
*-un-lft-identity79.7%
add-sqr-sqrt79.7%
times-frac79.6%
hypot-def79.7%
fma-def79.7%
hypot-def96.4%
Applied egg-rr96.4%
associate-*l/96.6%
*-un-lft-identity96.6%
Applied egg-rr96.6%
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 x.re around inf 1.3%
*-commutative1.3%
Simplified1.3%
add-sqr-sqrt1.3%
sqrt-div0.9%
hypot-udef0.9%
sqrt-div0.9%
hypot-udef1.9%
times-frac0.9%
add-sqr-sqrt1.3%
times-frac61.8%
Applied egg-rr61.8%
Final simplification90.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)))))
(if (<= y.re -1.25e+126)
(+ (/ x.re y.re) (* (/ y.im y.re) (/ x.im y.re)))
(if (<= y.re -8.2e-141)
t_0
(if (<= y.re 1.05e-119)
(+ (/ x.im y.im) (/ 1.0 (/ y.im (* y.re (/ x.re y.im)))))
(if (<= y.re 2.2e+130)
t_0
(/ (+ x.re (/ y.im (/ y.re x.im))) (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 = ((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 tmp;
if (y_46_re <= -1.25e+126) {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
} else if (y_46_re <= -8.2e-141) {
tmp = t_0;
} else if (y_46_re <= 1.05e-119) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im))));
} else if (y_46_re <= 2.2e+130) {
tmp = t_0;
} else {
tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) / 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 = ((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 tmp;
if (y_46_re <= -1.25e+126) {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
} else if (y_46_re <= -8.2e-141) {
tmp = t_0;
} else if (y_46_re <= 1.05e-119) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im))));
} else if (y_46_re <= 2.2e+130) {
tmp = t_0;
} else {
tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) / 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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -1.25e+126: tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)) elif y_46_re <= -8.2e-141: tmp = t_0 elif y_46_re <= 1.05e-119: tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im)))) elif y_46_re <= 2.2e+130: tmp = t_0 else: tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) / 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(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))) tmp = 0.0 if (y_46_re <= -1.25e+126) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im / y_46_re) * Float64(x_46_im / y_46_re))); elseif (y_46_re <= -8.2e-141) tmp = t_0; elseif (y_46_re <= 1.05e-119) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im / Float64(y_46_re * Float64(x_46_re / y_46_im))))); elseif (y_46_re <= 2.2e+130) tmp = t_0; else tmp = Float64(Float64(x_46_re + Float64(y_46_im / Float64(y_46_re / x_46_im))) / 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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -1.25e+126) tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)); elseif (y_46_re <= -8.2e-141) tmp = t_0; elseif (y_46_re <= 1.05e-119) tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im)))); elseif (y_46_re <= 2.2e+130) tmp = t_0; else tmp = (x_46_re + (y_46_im / (y_46_re / x_46_im))) / 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[(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]}, If[LessEqual[y$46$re, -1.25e+126], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im / y$46$re), $MachinePrecision] * N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -8.2e-141], t$95$0, If[LessEqual[y$46$re, 1.05e-119], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im / N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.2e+130], t$95$0, N[(N[(x$46$re + N[(y$46$im / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $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}\\
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{+126}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -8.2 \cdot 10^{-141}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.05 \cdot 10^{-119}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{y.re \cdot \frac{x.re}{y.im}}}\\
\mathbf{elif}\;y.re \leq 2.2 \cdot 10^{+130}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + \frac{y.im}{\frac{y.re}{x.im}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.24999999999999994e126Initial program 47.8%
Taylor expanded in y.re around inf 77.1%
unpow277.1%
times-frac88.6%
Simplified88.6%
if -1.24999999999999994e126 < y.re < -8.20000000000000005e-141 or 1.05e-119 < y.re < 2.19999999999999993e130Initial program 82.0%
if -8.20000000000000005e-141 < y.re < 1.05e-119Initial program 64.5%
Taylor expanded in y.re around 0 80.0%
+-commutative80.0%
*-commutative80.0%
unpow280.0%
associate-/l*76.5%
Simplified76.5%
clear-num76.5%
inv-pow76.5%
associate-/l*80.3%
Applied egg-rr80.3%
unpow-180.3%
associate-/l/92.3%
Simplified92.3%
if 2.19999999999999993e130 < y.re Initial program 37.5%
*-un-lft-identity37.5%
add-sqr-sqrt37.5%
times-frac37.5%
hypot-def37.5%
fma-def37.5%
hypot-def55.8%
Applied egg-rr55.8%
associate-*l/55.8%
*-un-lft-identity55.8%
Applied egg-rr55.8%
Taylor expanded in y.re around inf 84.4%
associate-/l*88.9%
Simplified88.9%
Final simplification87.0%
(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 -4.4e+109)
(/ (- (- x.re) t_1) (hypot y.re y.im))
(if (<= y.re -2.05e-141)
t_0
(if (<= y.re 8e-122)
(+ (/ x.im y.im) (/ 1.0 (/ y.im (* y.re (/ x.re y.im)))))
(if (<= y.re 1.1e+131) t_0 (/ (+ x.re t_1) (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 = ((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 <= -4.4e+109) {
tmp = (-x_46_re - t_1) / hypot(y_46_re, y_46_im);
} else if (y_46_re <= -2.05e-141) {
tmp = t_0;
} else if (y_46_re <= 8e-122) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im))));
} else if (y_46_re <= 1.1e+131) {
tmp = t_0;
} else {
tmp = (x_46_re + t_1) / 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 = ((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 <= -4.4e+109) {
tmp = (-x_46_re - t_1) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_re <= -2.05e-141) {
tmp = t_0;
} else if (y_46_re <= 8e-122) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im))));
} else if (y_46_re <= 1.1e+131) {
tmp = t_0;
} else {
tmp = (x_46_re + t_1) / 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 = ((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 <= -4.4e+109: tmp = (-x_46_re - t_1) / math.hypot(y_46_re, y_46_im) elif y_46_re <= -2.05e-141: tmp = t_0 elif y_46_re <= 8e-122: tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im)))) elif y_46_re <= 1.1e+131: tmp = t_0 else: tmp = (x_46_re + t_1) / 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(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 <= -4.4e+109) tmp = Float64(Float64(Float64(-x_46_re) - t_1) / hypot(y_46_re, y_46_im)); elseif (y_46_re <= -2.05e-141) tmp = t_0; elseif (y_46_re <= 8e-122) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im / Float64(y_46_re * Float64(x_46_re / y_46_im))))); elseif (y_46_re <= 1.1e+131) tmp = t_0; else tmp = Float64(Float64(x_46_re + t_1) / 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 = ((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 <= -4.4e+109) tmp = (-x_46_re - t_1) / hypot(y_46_re, y_46_im); elseif (y_46_re <= -2.05e-141) tmp = t_0; elseif (y_46_re <= 8e-122) tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im)))); elseif (y_46_re <= 1.1e+131) tmp = t_0; else tmp = (x_46_re + t_1) / 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[(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, -4.4e+109], 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, -2.05e-141], t$95$0, If[LessEqual[y$46$re, 8e-122], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im / N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.1e+131], t$95$0, N[(N[(x$46$re + t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $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 -4.4 \cdot 10^{+109}:\\
\;\;\;\;\frac{\left(-x.re\right) - t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \leq -2.05 \cdot 10^{-141}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{-122}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{1}{\frac{y.im}{y.re \cdot \frac{x.re}{y.im}}}\\
\mathbf{elif}\;y.re \leq 1.1 \cdot 10^{+131}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -4.3999999999999998e109Initial program 52.0%
*-un-lft-identity52.0%
add-sqr-sqrt52.0%
times-frac52.0%
hypot-def52.0%
fma-def52.0%
hypot-def64.7%
Applied egg-rr64.7%
associate-*l/64.9%
*-un-lft-identity64.9%
Applied egg-rr64.9%
Taylor expanded in y.re around -inf 85.3%
+-commutative85.3%
mul-1-neg85.3%
unsub-neg85.3%
neg-mul-185.3%
associate-/l*88.0%
Simplified88.0%
if -4.3999999999999998e109 < y.re < -2.05000000000000001e-141 or 8.00000000000000047e-122 < y.re < 1.0999999999999999e131Initial program 82.1%
if -2.05000000000000001e-141 < y.re < 8.00000000000000047e-122Initial program 64.5%
Taylor expanded in y.re around 0 80.0%
+-commutative80.0%
*-commutative80.0%
unpow280.0%
associate-/l*76.5%
Simplified76.5%
clear-num76.5%
inv-pow76.5%
associate-/l*80.3%
Applied egg-rr80.3%
unpow-180.3%
associate-/l/92.3%
Simplified92.3%
if 1.0999999999999999e131 < y.re Initial program 37.5%
*-un-lft-identity37.5%
add-sqr-sqrt37.5%
times-frac37.5%
hypot-def37.5%
fma-def37.5%
hypot-def55.8%
Applied egg-rr55.8%
associate-*l/55.8%
*-un-lft-identity55.8%
Applied egg-rr55.8%
Taylor expanded in y.re around inf 84.4%
associate-/l*88.9%
Simplified88.9%
Final simplification87.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im)))))
(t_1 (+ (/ x.im y.im) (/ 1.0 (/ y.im (* y.re (/ x.re y.im)))))))
(if (<= y.im -2e+120)
t_1
(if (<= y.im -1.5e+100)
t_0
(if (<= y.im -1.55e-23)
(* x.im (/ y.im (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.im 1.55e+28) 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 = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
double t_1 = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im))));
double tmp;
if (y_46_im <= -2e+120) {
tmp = t_1;
} else if (y_46_im <= -1.5e+100) {
tmp = t_0;
} else if (y_46_im <= -1.55e-23) {
tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
} else if (y_46_im <= 1.55e+28) {
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 = (x_46re / y_46re) + (x_46im / (y_46re * (y_46re / y_46im)))
t_1 = (x_46im / y_46im) + (1.0d0 / (y_46im / (y_46re * (x_46re / y_46im))))
if (y_46im <= (-2d+120)) then
tmp = t_1
else if (y_46im <= (-1.5d+100)) then
tmp = t_0
else if (y_46im <= (-1.55d-23)) then
tmp = x_46im * (y_46im / ((y_46re * y_46re) + (y_46im * y_46im)))
else if (y_46im <= 1.55d+28) 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 = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
double t_1 = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im))));
double tmp;
if (y_46_im <= -2e+120) {
tmp = t_1;
} else if (y_46_im <= -1.5e+100) {
tmp = t_0;
} else if (y_46_im <= -1.55e-23) {
tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
} else if (y_46_im <= 1.55e+28) {
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 = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))) t_1 = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im)))) tmp = 0 if y_46_im <= -2e+120: tmp = t_1 elif y_46_im <= -1.5e+100: tmp = t_0 elif y_46_im <= -1.55e-23: tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) elif y_46_im <= 1.55e+28: 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(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))) t_1 = Float64(Float64(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im / Float64(y_46_re * Float64(x_46_re / y_46_im))))) tmp = 0.0 if (y_46_im <= -2e+120) tmp = t_1; elseif (y_46_im <= -1.5e+100) tmp = t_0; elseif (y_46_im <= -1.55e-23) tmp = Float64(x_46_im * Float64(y_46_im / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))); elseif (y_46_im <= 1.55e+28) 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 = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))); t_1 = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im)))); tmp = 0.0; if (y_46_im <= -2e+120) tmp = t_1; elseif (y_46_im <= -1.5e+100) tmp = t_0; elseif (y_46_im <= -1.55e-23) tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im))); elseif (y_46_im <= 1.55e+28) 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[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im / N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2e+120], t$95$1, If[LessEqual[y$46$im, -1.5e+100], t$95$0, If[LessEqual[y$46$im, -1.55e-23], N[(x$46$im * N[(y$46$im / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.55e+28], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
t_1 := \frac{x.im}{y.im} + \frac{1}{\frac{y.im}{y.re \cdot \frac{x.re}{y.im}}}\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+120}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -1.5 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -1.55 \cdot 10^{-23}:\\
\;\;\;\;x.im \cdot \frac{y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.55 \cdot 10^{+28}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -2e120 or 1.55e28 < y.im Initial program 50.7%
Taylor expanded in y.re around 0 75.8%
+-commutative75.8%
*-commutative75.8%
unpow275.8%
associate-/l*78.5%
Simplified78.5%
clear-num78.5%
inv-pow78.5%
associate-/l*83.4%
Applied egg-rr83.4%
unpow-183.4%
associate-/l/89.6%
Simplified89.6%
if -2e120 < y.im < -1.49999999999999993e100 or -1.5499999999999999e-23 < y.im < 1.55e28Initial program 70.2%
Taylor expanded in y.re around inf 76.3%
*-commutative76.3%
unpow276.3%
associate-/l*74.3%
Simplified74.3%
Taylor expanded in y.re around 0 74.3%
unpow274.3%
associate-*r/81.2%
Simplified81.2%
if -1.49999999999999993e100 < y.im < -1.5499999999999999e-23Initial program 89.8%
Taylor expanded in x.re around 0 85.4%
associate-/l*89.7%
associate-/r/89.9%
unpow289.9%
unpow289.9%
fma-udef89.9%
Simplified89.9%
fma-def89.9%
Applied egg-rr89.9%
Final simplification84.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (/ x.re y.re) (* (/ y.im y.re) (/ x.im y.re))))
(t_1 (+ (/ x.im y.im) (* (/ x.re y.im) (/ y.re y.im)))))
(if (<= y.im -6e+141)
t_1
(if (<= y.im -1.5e+100)
t_0
(if (<= y.im -1.45e-23)
(* x.im (/ y.im (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.im 4.7e+30) 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 = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
double t_1 = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im));
double tmp;
if (y_46_im <= -6e+141) {
tmp = t_1;
} else if (y_46_im <= -1.5e+100) {
tmp = t_0;
} else if (y_46_im <= -1.45e-23) {
tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
} else if (y_46_im <= 4.7e+30) {
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 = (x_46re / y_46re) + ((y_46im / y_46re) * (x_46im / y_46re))
t_1 = (x_46im / y_46im) + ((x_46re / y_46im) * (y_46re / y_46im))
if (y_46im <= (-6d+141)) then
tmp = t_1
else if (y_46im <= (-1.5d+100)) then
tmp = t_0
else if (y_46im <= (-1.45d-23)) then
tmp = x_46im * (y_46im / ((y_46re * y_46re) + (y_46im * y_46im)))
else if (y_46im <= 4.7d+30) 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 = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
double t_1 = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im));
double tmp;
if (y_46_im <= -6e+141) {
tmp = t_1;
} else if (y_46_im <= -1.5e+100) {
tmp = t_0;
} else if (y_46_im <= -1.45e-23) {
tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
} else if (y_46_im <= 4.7e+30) {
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 = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)) t_1 = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im)) tmp = 0 if y_46_im <= -6e+141: tmp = t_1 elif y_46_im <= -1.5e+100: tmp = t_0 elif y_46_im <= -1.45e-23: tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) elif y_46_im <= 4.7e+30: 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(x_46_re / y_46_re) + Float64(Float64(y_46_im / y_46_re) * Float64(x_46_im / y_46_re))) t_1 = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(x_46_re / y_46_im) * Float64(y_46_re / y_46_im))) tmp = 0.0 if (y_46_im <= -6e+141) tmp = t_1; elseif (y_46_im <= -1.5e+100) tmp = t_0; elseif (y_46_im <= -1.45e-23) tmp = Float64(x_46_im * Float64(y_46_im / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))); elseif (y_46_im <= 4.7e+30) 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 = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)); t_1 = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im)); tmp = 0.0; if (y_46_im <= -6e+141) tmp = t_1; elseif (y_46_im <= -1.5e+100) tmp = t_0; elseif (y_46_im <= -1.45e-23) tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im))); elseif (y_46_im <= 4.7e+30) 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[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im / y$46$re), $MachinePrecision] * N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(x$46$re / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6e+141], t$95$1, If[LessEqual[y$46$im, -1.5e+100], t$95$0, If[LessEqual[y$46$im, -1.45e-23], N[(x$46$im * N[(y$46$im / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 4.7e+30], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\
t_1 := \frac{x.im}{y.im} + \frac{x.re}{y.im} \cdot \frac{y.re}{y.im}\\
\mathbf{if}\;y.im \leq -6 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -1.5 \cdot 10^{+100}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -1.45 \cdot 10^{-23}:\\
\;\;\;\;x.im \cdot \frac{y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 4.7 \cdot 10^{+30}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -5.9999999999999998e141 or 4.6999999999999999e30 < y.im Initial program 50.7%
Taylor expanded in y.re around 0 76.9%
+-commutative76.9%
*-commutative76.9%
unpow276.9%
times-frac90.1%
Simplified90.1%
if -5.9999999999999998e141 < y.im < -1.49999999999999993e100 or -1.4500000000000001e-23 < y.im < 4.6999999999999999e30Initial program 69.7%
Taylor expanded in y.re around inf 75.0%
unpow275.0%
times-frac79.2%
Simplified79.2%
if -1.49999999999999993e100 < y.im < -1.4500000000000001e-23Initial program 89.8%
Taylor expanded in x.re around 0 85.4%
associate-/l*89.7%
associate-/r/89.9%
unpow289.9%
unpow289.9%
fma-udef89.9%
Simplified89.9%
fma-def89.9%
Applied egg-rr89.9%
Final simplification83.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im)))))
(t_1 (+ (/ x.im y.im) (* (/ x.re y.im) (/ y.re y.im)))))
(if (<= y.im -6e+141)
t_1
(if (<= y.im -6.8e+99)
t_0
(if (<= y.im -7e-21)
(* x.im (/ y.im (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.im 1.9e+29) 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 = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
double t_1 = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im));
double tmp;
if (y_46_im <= -6e+141) {
tmp = t_1;
} else if (y_46_im <= -6.8e+99) {
tmp = t_0;
} else if (y_46_im <= -7e-21) {
tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
} else if (y_46_im <= 1.9e+29) {
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 = (x_46re / y_46re) + (x_46im / (y_46re * (y_46re / y_46im)))
t_1 = (x_46im / y_46im) + ((x_46re / y_46im) * (y_46re / y_46im))
if (y_46im <= (-6d+141)) then
tmp = t_1
else if (y_46im <= (-6.8d+99)) then
tmp = t_0
else if (y_46im <= (-7d-21)) then
tmp = x_46im * (y_46im / ((y_46re * y_46re) + (y_46im * y_46im)))
else if (y_46im <= 1.9d+29) 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 = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
double t_1 = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im));
double tmp;
if (y_46_im <= -6e+141) {
tmp = t_1;
} else if (y_46_im <= -6.8e+99) {
tmp = t_0;
} else if (y_46_im <= -7e-21) {
tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
} else if (y_46_im <= 1.9e+29) {
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 = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))) t_1 = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im)) tmp = 0 if y_46_im <= -6e+141: tmp = t_1 elif y_46_im <= -6.8e+99: tmp = t_0 elif y_46_im <= -7e-21: tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) elif y_46_im <= 1.9e+29: 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(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))) t_1 = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(x_46_re / y_46_im) * Float64(y_46_re / y_46_im))) tmp = 0.0 if (y_46_im <= -6e+141) tmp = t_1; elseif (y_46_im <= -6.8e+99) tmp = t_0; elseif (y_46_im <= -7e-21) tmp = Float64(x_46_im * Float64(y_46_im / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))); elseif (y_46_im <= 1.9e+29) 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 = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))); t_1 = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im)); tmp = 0.0; if (y_46_im <= -6e+141) tmp = t_1; elseif (y_46_im <= -6.8e+99) tmp = t_0; elseif (y_46_im <= -7e-21) tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im))); elseif (y_46_im <= 1.9e+29) 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[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(x$46$re / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6e+141], t$95$1, If[LessEqual[y$46$im, -6.8e+99], t$95$0, If[LessEqual[y$46$im, -7e-21], N[(x$46$im * N[(y$46$im / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.9e+29], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
t_1 := \frac{x.im}{y.im} + \frac{x.re}{y.im} \cdot \frac{y.re}{y.im}\\
\mathbf{if}\;y.im \leq -6 \cdot 10^{+141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -6.8 \cdot 10^{+99}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -7 \cdot 10^{-21}:\\
\;\;\;\;x.im \cdot \frac{y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.9 \cdot 10^{+29}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -5.9999999999999998e141 or 1.89999999999999985e29 < y.im Initial program 50.7%
Taylor expanded in y.re around 0 76.9%
+-commutative76.9%
*-commutative76.9%
unpow276.9%
times-frac90.1%
Simplified90.1%
if -5.9999999999999998e141 < y.im < -6.79999999999999968e99 or -7.0000000000000007e-21 < y.im < 1.89999999999999985e29Initial program 69.7%
Taylor expanded in y.re around inf 75.0%
*-commutative75.0%
unpow275.0%
associate-/l*73.0%
Simplified73.0%
Taylor expanded in y.re around 0 73.0%
unpow273.0%
associate-*r/80.4%
Simplified80.4%
if -6.79999999999999968e99 < y.im < -7.0000000000000007e-21Initial program 89.8%
Taylor expanded in x.re around 0 85.4%
associate-/l*89.7%
associate-/r/89.9%
unpow289.9%
unpow289.9%
fma-udef89.9%
Simplified89.9%
fma-def89.9%
Applied egg-rr89.9%
Final simplification84.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (/ x.im y.im) (/ 1.0 (/ y.im (* y.re (/ x.re y.im)))))))
(if (<= y.im -1.5e+120)
t_0
(if (<= y.im -8.5e-117)
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 2.3e+28)
(+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im))))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im))));
double tmp;
if (y_46_im <= -1.5e+120) {
tmp = t_0;
} else if (y_46_im <= -8.5e-117) {
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));
} else if (y_46_im <= 2.3e+28) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else {
tmp = t_0;
}
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) :: tmp
t_0 = (x_46im / y_46im) + (1.0d0 / (y_46im / (y_46re * (x_46re / y_46im))))
if (y_46im <= (-1.5d+120)) then
tmp = t_0
else if (y_46im <= (-8.5d-117)) then
tmp = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46im <= 2.3d+28) then
tmp = (x_46re / y_46re) + (x_46im / (y_46re * (y_46re / y_46im)))
else
tmp = t_0
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 = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im))));
double tmp;
if (y_46_im <= -1.5e+120) {
tmp = t_0;
} else if (y_46_im <= -8.5e-117) {
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));
} else if (y_46_im <= 2.3e+28) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im)))) tmp = 0 if y_46_im <= -1.5e+120: tmp = t_0 elif y_46_im <= -8.5e-117: 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)) elif y_46_im <= 2.3e+28: tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im / Float64(y_46_re * Float64(x_46_re / y_46_im))))) tmp = 0.0 if (y_46_im <= -1.5e+120) tmp = t_0; elseif (y_46_im <= -8.5e-117) tmp = 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))); elseif (y_46_im <= 2.3e+28) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im / y_46_im) + (1.0 / (y_46_im / (y_46_re * (x_46_re / y_46_im)))); tmp = 0.0; if (y_46_im <= -1.5e+120) tmp = t_0; elseif (y_46_im <= -8.5e-117) 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)); elseif (y_46_im <= 2.3e+28) tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))); else tmp = t_0; 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$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im / N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.5e+120], t$95$0, If[LessEqual[y$46$im, -8.5e-117], 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], If[LessEqual[y$46$im, 2.3e+28], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{y.im} + \frac{1}{\frac{y.im}{y.re \cdot \frac{x.re}{y.im}}}\\
\mathbf{if}\;y.im \leq -1.5 \cdot 10^{+120}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -8.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 2.3 \cdot 10^{+28}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.im < -1.5e120 or 2.29999999999999984e28 < y.im Initial program 50.2%
Taylor expanded in y.re around 0 75.0%
+-commutative75.0%
*-commutative75.0%
unpow275.0%
associate-/l*77.7%
Simplified77.7%
clear-num77.7%
inv-pow77.7%
associate-/l*82.6%
Applied egg-rr82.6%
unpow-182.6%
associate-/l/88.7%
Simplified88.7%
if -1.5e120 < y.im < -8.49999999999999981e-117Initial program 82.3%
if -8.49999999999999981e-117 < y.im < 2.29999999999999984e28Initial program 69.5%
Taylor expanded in y.re around inf 77.6%
*-commutative77.6%
unpow277.6%
associate-/l*76.7%
Simplified76.7%
Taylor expanded in y.re around 0 76.7%
unpow276.7%
associate-*r/83.6%
Simplified83.6%
Final simplification85.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.8e+120)
(/ x.im y.im)
(if (<= y.im -1.35e-127)
(* x.im (/ y.im (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.im 1700.0) (/ 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 <= -1.8e+120) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -1.35e-127) {
tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
} else if (y_46_im <= 1700.0) {
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 <= (-1.8d+120)) then
tmp = x_46im / y_46im
else if (y_46im <= (-1.35d-127)) then
tmp = x_46im * (y_46im / ((y_46re * y_46re) + (y_46im * y_46im)))
else if (y_46im <= 1700.0d0) 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 <= -1.8e+120) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -1.35e-127) {
tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
} else if (y_46_im <= 1700.0) {
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 <= -1.8e+120: tmp = x_46_im / y_46_im elif y_46_im <= -1.35e-127: tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) elif y_46_im <= 1700.0: 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 <= -1.8e+120) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -1.35e-127) tmp = Float64(x_46_im * Float64(y_46_im / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))); elseif (y_46_im <= 1700.0) 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 <= -1.8e+120) tmp = x_46_im / y_46_im; elseif (y_46_im <= -1.35e-127) tmp = x_46_im * (y_46_im / ((y_46_re * y_46_re) + (y_46_im * y_46_im))); elseif (y_46_im <= 1700.0) 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, -1.8e+120], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -1.35e-127], N[(x$46$im * N[(y$46$im / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1700.0], 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 -1.8 \cdot 10^{+120}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -1.35 \cdot 10^{-127}:\\
\;\;\;\;x.im \cdot \frac{y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1700:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -1.80000000000000008e120 or 1700 < y.im Initial program 52.2%
Taylor expanded in y.re around 0 67.6%
if -1.80000000000000008e120 < y.im < -1.35e-127Initial program 83.1%
Taylor expanded in x.re around 0 65.4%
associate-/l*59.4%
associate-/r/64.8%
unpow264.8%
unpow264.8%
fma-udef64.8%
Simplified64.8%
fma-def64.8%
Applied egg-rr64.8%
if -1.35e-127 < y.im < 1700Initial program 67.9%
Taylor expanded in y.re around inf 67.6%
Final simplification67.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.2e+46)
(/ x.re y.re)
(if (<= y.re 1.4e+82)
(+ (/ x.im y.im) (* (/ x.re y.im) (/ y.re y.im)))
(/ x.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_re <= -1.2e+46) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= 1.4e+82) {
tmp = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im));
} else {
tmp = x_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_46re <= (-1.2d+46)) then
tmp = x_46re / y_46re
else if (y_46re <= 1.4d+82) then
tmp = (x_46im / y_46im) + ((x_46re / y_46im) * (y_46re / y_46im))
else
tmp = x_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_re <= -1.2e+46) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= 1.4e+82) {
tmp = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im));
} else {
tmp = x_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_re <= -1.2e+46: tmp = x_46_re / y_46_re elif y_46_re <= 1.4e+82: tmp = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im)) else: tmp = x_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_re <= -1.2e+46) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= 1.4e+82) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(x_46_re / y_46_im) * Float64(y_46_re / y_46_im))); else tmp = Float64(x_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_re <= -1.2e+46) tmp = x_46_re / y_46_re; elseif (y_46_re <= 1.4e+82) tmp = (x_46_im / y_46_im) + ((x_46_re / y_46_im) * (y_46_re / y_46_im)); else tmp = x_46_re / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.2e+46], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 1.4e+82], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(x$46$re / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.2 \cdot 10^{+46}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq 1.4 \cdot 10^{+82}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{y.im} \cdot \frac{y.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.re < -1.20000000000000004e46 or 1.4e82 < y.re Initial program 52.5%
Taylor expanded in y.re around inf 72.0%
if -1.20000000000000004e46 < y.re < 1.4e82Initial program 73.1%
Taylor expanded in y.re around 0 65.1%
+-commutative65.1%
*-commutative65.1%
unpow265.1%
times-frac73.6%
Simplified73.6%
Final simplification73.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -6e+141)
(/ x.im y.im)
(if (or (<= y.im -1.5e+100) (and (not (<= y.im -2.75e-108)) (<= y.im 1.6)))
(/ 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 <= -6e+141) {
tmp = x_46_im / y_46_im;
} else if ((y_46_im <= -1.5e+100) || (!(y_46_im <= -2.75e-108) && (y_46_im <= 1.6))) {
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 <= (-6d+141)) then
tmp = x_46im / y_46im
else if ((y_46im <= (-1.5d+100)) .or. (.not. (y_46im <= (-2.75d-108))) .and. (y_46im <= 1.6d0)) 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 <= -6e+141) {
tmp = x_46_im / y_46_im;
} else if ((y_46_im <= -1.5e+100) || (!(y_46_im <= -2.75e-108) && (y_46_im <= 1.6))) {
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 <= -6e+141: tmp = x_46_im / y_46_im elif (y_46_im <= -1.5e+100) or (not (y_46_im <= -2.75e-108) and (y_46_im <= 1.6)): 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 <= -6e+141) tmp = Float64(x_46_im / y_46_im); elseif ((y_46_im <= -1.5e+100) || (!(y_46_im <= -2.75e-108) && (y_46_im <= 1.6))) 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 <= -6e+141) tmp = x_46_im / y_46_im; elseif ((y_46_im <= -1.5e+100) || (~((y_46_im <= -2.75e-108)) && (y_46_im <= 1.6))) 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, -6e+141], N[(x$46$im / y$46$im), $MachinePrecision], If[Or[LessEqual[y$46$im, -1.5e+100], And[N[Not[LessEqual[y$46$im, -2.75e-108]], $MachinePrecision], LessEqual[y$46$im, 1.6]]], 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 -6 \cdot 10^{+141}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -1.5 \cdot 10^{+100} \lor \neg \left(y.im \leq -2.75 \cdot 10^{-108}\right) \land y.im \leq 1.6:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -5.9999999999999998e141 or -1.49999999999999993e100 < y.im < -2.75000000000000016e-108 or 1.6000000000000001 < y.im Initial program 61.5%
Taylor expanded in y.re around 0 66.5%
if -5.9999999999999998e141 < y.im < -1.49999999999999993e100 or -2.75000000000000016e-108 < y.im < 1.6000000000000001Initial program 67.8%
Taylor expanded in y.re around inf 64.0%
Final simplification65.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -6e+141)
(/ x.im y.im)
(if (<= y.im -9.6e+88)
(/ x.re y.re)
(if (<= y.im -3.9e-108)
(/ 1.0 (/ y.im x.im))
(if (<= y.im 3.4) (/ 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 <= -6e+141) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -9.6e+88) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= -3.9e-108) {
tmp = 1.0 / (y_46_im / x_46_im);
} else if (y_46_im <= 3.4) {
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 <= (-6d+141)) then
tmp = x_46im / y_46im
else if (y_46im <= (-9.6d+88)) then
tmp = x_46re / y_46re
else if (y_46im <= (-3.9d-108)) then
tmp = 1.0d0 / (y_46im / x_46im)
else if (y_46im <= 3.4d0) 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 <= -6e+141) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -9.6e+88) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= -3.9e-108) {
tmp = 1.0 / (y_46_im / x_46_im);
} else if (y_46_im <= 3.4) {
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 <= -6e+141: tmp = x_46_im / y_46_im elif y_46_im <= -9.6e+88: tmp = x_46_re / y_46_re elif y_46_im <= -3.9e-108: tmp = 1.0 / (y_46_im / x_46_im) elif y_46_im <= 3.4: 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 <= -6e+141) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -9.6e+88) tmp = Float64(x_46_re / y_46_re); elseif (y_46_im <= -3.9e-108) tmp = Float64(1.0 / Float64(y_46_im / x_46_im)); elseif (y_46_im <= 3.4) 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 <= -6e+141) tmp = x_46_im / y_46_im; elseif (y_46_im <= -9.6e+88) tmp = x_46_re / y_46_re; elseif (y_46_im <= -3.9e-108) tmp = 1.0 / (y_46_im / x_46_im); elseif (y_46_im <= 3.4) 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, -6e+141], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -9.6e+88], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, -3.9e-108], N[(1.0 / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.4], 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 -6 \cdot 10^{+141}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -9.6 \cdot 10^{+88}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.im \leq -3.9 \cdot 10^{-108}:\\
\;\;\;\;\frac{1}{\frac{y.im}{x.im}}\\
\mathbf{elif}\;y.im \leq 3.4:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -5.9999999999999998e141 or 3.39999999999999991 < y.im Initial program 52.8%
Taylor expanded in y.re around 0 70.8%
if -5.9999999999999998e141 < y.im < -9.5999999999999996e88 or -3.89999999999999995e-108 < y.im < 3.39999999999999991Initial program 67.8%
Taylor expanded in y.re around inf 64.0%
if -9.5999999999999996e88 < y.im < -3.89999999999999995e-108Initial program 85.2%
Taylor expanded in x.re around 0 74.3%
associate-/l*68.7%
associate-/r/76.4%
unpow276.4%
unpow276.4%
fma-udef76.4%
Simplified76.4%
fma-def76.4%
Applied egg-rr76.4%
Taylor expanded in y.im around inf 54.7%
associate-*l/54.8%
*-un-lft-identity54.8%
clear-num54.8%
Applied egg-rr54.8%
Final simplification65.2%
(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.7%
Taylor expanded in y.re around 0 41.7%
Final simplification41.7%
herbie shell --seed 2023194
(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))))