
(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 14 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 (fma x.re (/ y.re y.im) x.im)) (t_1 (/ y.im (hypot y.re y.im))))
(if (<= y.im -1.3e-67)
(/ (* t_0 t_1) (hypot y.re y.im))
(if (<= y.im 1.95e-42)
(/ (+ x.re (* x.im (/ y.im y.re))) y.re)
(* t_1 (/ t_0 (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 = fma(x_46_re, (y_46_re / y_46_im), x_46_im);
double t_1 = y_46_im / hypot(y_46_re, y_46_im);
double tmp;
if (y_46_im <= -1.3e-67) {
tmp = (t_0 * t_1) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= 1.95e-42) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = t_1 * (t_0 / 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 = fma(x_46_re, Float64(y_46_re / y_46_im), x_46_im) t_1 = Float64(y_46_im / hypot(y_46_re, y_46_im)) tmp = 0.0 if (y_46_im <= -1.3e-67) tmp = Float64(Float64(t_0 * t_1) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= 1.95e-42) tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = Float64(t_1 * Float64(t_0 / hypot(y_46_re, y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision] + x$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.3e-67], N[(N[(t$95$0 * t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.95e-42], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(t$95$1 * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x.re, \frac{y.re}{y.im}, x.im\right)\\
t_1 := \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{if}\;y.im \leq -1.3 \cdot 10^{-67}:\\
\;\;\;\;\frac{t\_0 \cdot t\_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq 1.95 \cdot 10^{-42}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -1.2999999999999999e-67Initial program 56.1%
Taylor expanded in y.im around inf 56.1%
associate-/l*56.0%
Simplified56.0%
*-commutative56.0%
add-sqr-sqrt56.0%
hypot-undefine56.0%
hypot-undefine56.0%
times-frac94.0%
+-commutative94.0%
fma-define94.0%
Applied egg-rr94.0%
associate-*l/94.1%
Applied egg-rr94.1%
if -1.2999999999999999e-67 < y.im < 1.9500000000000001e-42Initial program 68.9%
Taylor expanded in y.re around inf 88.4%
associate-/l*88.5%
Simplified88.5%
if 1.9500000000000001e-42 < y.im Initial program 52.1%
Taylor expanded in y.im around inf 52.1%
associate-/l*52.1%
Simplified52.1%
*-commutative52.1%
add-sqr-sqrt52.1%
hypot-undefine52.1%
hypot-undefine52.1%
times-frac96.8%
+-commutative96.8%
fma-define96.8%
Applied egg-rr96.8%
Final simplification92.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -1.65e-66) (not (<= y.im 1.95e-41)))
(*
(/ y.im (hypot y.re y.im))
(/ (fma x.re (/ y.re y.im) x.im) (hypot y.re y.im)))
(/ (+ x.re (* x.im (/ y.im y.re))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.65e-66) || !(y_46_im <= 1.95e-41)) {
tmp = (y_46_im / hypot(y_46_re, y_46_im)) * (fma(x_46_re, (y_46_re / y_46_im), x_46_im) / hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.65e-66) || !(y_46_im <= 1.95e-41)) tmp = Float64(Float64(y_46_im / hypot(y_46_re, y_46_im)) * Float64(fma(x_46_re, Float64(y_46_re / y_46_im), x_46_im) / hypot(y_46_re, y_46_im))); else tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.65e-66], N[Not[LessEqual[y$46$im, 1.95e-41]], $MachinePrecision]], N[(N[(y$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision] + x$46$im), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.65 \cdot 10^{-66} \lor \neg \left(y.im \leq 1.95 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.re, \frac{y.re}{y.im}, x.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -1.6499999999999999e-66 or 1.94999999999999995e-41 < y.im Initial program 54.3%
Taylor expanded in y.im around inf 54.3%
associate-/l*54.3%
Simplified54.3%
*-commutative54.3%
add-sqr-sqrt54.3%
hypot-undefine54.3%
hypot-undefine54.3%
times-frac95.2%
+-commutative95.2%
fma-define95.2%
Applied egg-rr95.2%
if -1.6499999999999999e-66 < y.im < 1.94999999999999995e-41Initial program 68.9%
Taylor expanded in y.re around inf 88.4%
associate-/l*88.5%
Simplified88.5%
Final simplification92.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re y.re) (* y.im x.im))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) INFINITY)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(/ (+ x.im (* x.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) {
double t_0 = (x_46_re * y_46_re) + (y_46_im * x_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= ((double) INFINITY)) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * y_46_re) + (y_46_im * x_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= Double.POSITIVE_INFINITY) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (t_0 / Math.hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re * y_46_re) + (y_46_im * x_46_im) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= math.inf: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (t_0 / math.hypot(y_46_re, y_46_im)) else: tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * y_46_re) + Float64(y_46_im * x_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(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); else tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_re * y_46_re) + (y_46_im * x_46_im); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= Inf) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im)); else tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * x$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[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot y.re + y.im \cdot x.im\\
\mathbf{if}\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im} \leq \infty:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{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 75.5%
*-un-lft-identity75.5%
associate-*r/75.5%
fma-define75.5%
add-sqr-sqrt75.5%
times-frac75.4%
fma-define75.4%
hypot-define75.4%
fma-define75.4%
fma-define75.5%
hypot-define94.5%
Applied egg-rr94.5%
fma-define94.5%
Applied egg-rr94.5%
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.im around inf 44.6%
associate-/l*64.0%
Simplified64.0%
Final simplification88.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.im -9.5e+103)
(/ (+ x.im (* x.re (/ y.re y.im))) y.im)
(if (<= y.im -7.2e-67)
(/ (+ (* x.re y.re) (* y.im x.im)) t_0)
(if (<= y.im 1.05e-45)
(/ (+ x.re (* x.im (/ y.im y.re))) y.re)
(if (<= y.im 4.1e+148)
(/ (* y.im (+ x.im (* y.re (/ x.re y.im)))) t_0)
(/ (fma y.re (/ x.re y.im) 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 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_im <= -9.5e+103) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
} else if (y_46_im <= -7.2e-67) {
tmp = ((x_46_re * y_46_re) + (y_46_im * x_46_im)) / t_0;
} else if (y_46_im <= 1.05e-45) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 4.1e+148) {
tmp = (y_46_im * (x_46_im + (y_46_re * (x_46_re / y_46_im)))) / t_0;
} else {
tmp = fma(y_46_re, (x_46_re / y_46_im), x_46_im) / hypot(y_46_re, y_46_im);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) tmp = 0.0 if (y_46_im <= -9.5e+103) tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im); elseif (y_46_im <= -7.2e-67) tmp = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(y_46_im * x_46_im)) / t_0); elseif (y_46_im <= 1.05e-45) tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 4.1e+148) tmp = Float64(Float64(y_46_im * Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im)))) / t_0); else tmp = Float64(fma(y_46_re, Float64(x_46_re / y_46_im), x_46_im) / hypot(y_46_re, y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -9.5e+103], N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -7.2e-67], N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 1.05e-45], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 4.1e+148], N[(N[(y$46$im * N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision] + x$46$im), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
\mathbf{if}\;y.im \leq -9.5 \cdot 10^{+103}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\mathbf{elif}\;y.im \leq -7.2 \cdot 10^{-67}:\\
\;\;\;\;\frac{x.re \cdot y.re + y.im \cdot x.im}{t\_0}\\
\mathbf{elif}\;y.im \leq 1.05 \cdot 10^{-45}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 4.1 \cdot 10^{+148}:\\
\;\;\;\;\frac{y.im \cdot \left(x.im + y.re \cdot \frac{x.re}{y.im}\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y.re, \frac{x.re}{y.im}, x.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -9.49999999999999922e103Initial program 35.2%
Taylor expanded in y.im around inf 82.7%
associate-/l*91.4%
Simplified91.4%
if -9.49999999999999922e103 < y.im < -7.19999999999999998e-67Initial program 80.1%
if -7.19999999999999998e-67 < y.im < 1.04999999999999998e-45Initial program 68.6%
Taylor expanded in y.re around inf 88.3%
associate-/l*88.4%
Simplified88.4%
if 1.04999999999999998e-45 < y.im < 4.0999999999999998e148Initial program 78.0%
Taylor expanded in y.im around inf 78.0%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in x.re around 0 78.0%
*-commutative78.0%
associate-*r/78.1%
Simplified78.1%
if 4.0999999999999998e148 < y.im Initial program 24.3%
Taylor expanded in y.im around inf 24.3%
associate-/l*24.3%
Simplified24.3%
*-commutative24.3%
add-sqr-sqrt24.3%
hypot-undefine24.3%
hypot-undefine24.3%
times-frac99.7%
+-commutative99.7%
fma-define99.7%
Applied egg-rr99.7%
associate-*l/99.8%
Applied egg-rr99.8%
Taylor expanded in y.re around 0 73.0%
+-commutative73.0%
*-commutative73.0%
associate-*r/86.1%
fma-define86.1%
Simplified86.1%
Final simplification86.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im))) (t_1 (* y.re (/ x.re y.im))))
(if (<= y.im -1.3e+106)
(/ (+ x.im (* x.re (/ y.re y.im))) y.im)
(if (<= y.im -7.5e-67)
(/ (+ (* x.re y.re) (* y.im x.im)) t_0)
(if (<= y.im 1.6e-45)
(/ (+ x.re (* x.im (/ y.im y.re))) y.re)
(if (<= y.im 3.1e+146)
(/ (* y.im (+ x.im t_1)) t_0)
(/
(+ x.im (- t_1 (* x.im (* (/ y.re y.im) (/ y.re y.im)))))
y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double t_1 = y_46_re * (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -1.3e+106) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
} else if (y_46_im <= -7.5e-67) {
tmp = ((x_46_re * y_46_re) + (y_46_im * x_46_im)) / t_0;
} else if (y_46_im <= 1.6e-45) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 3.1e+146) {
tmp = (y_46_im * (x_46_im + t_1)) / t_0;
} else {
tmp = (x_46_im + (t_1 - (x_46_im * ((y_46_re / y_46_im) * (y_46_re / y_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (y_46re * y_46re) + (y_46im * y_46im)
t_1 = y_46re * (x_46re / y_46im)
if (y_46im <= (-1.3d+106)) then
tmp = (x_46im + (x_46re * (y_46re / y_46im))) / y_46im
else if (y_46im <= (-7.5d-67)) then
tmp = ((x_46re * y_46re) + (y_46im * x_46im)) / t_0
else if (y_46im <= 1.6d-45) then
tmp = (x_46re + (x_46im * (y_46im / y_46re))) / y_46re
else if (y_46im <= 3.1d+146) then
tmp = (y_46im * (x_46im + t_1)) / t_0
else
tmp = (x_46im + (t_1 - (x_46im * ((y_46re / y_46im) * (y_46re / y_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 t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double t_1 = y_46_re * (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -1.3e+106) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
} else if (y_46_im <= -7.5e-67) {
tmp = ((x_46_re * y_46_re) + (y_46_im * x_46_im)) / t_0;
} else if (y_46_im <= 1.6e-45) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 3.1e+146) {
tmp = (y_46_im * (x_46_im + t_1)) / t_0;
} else {
tmp = (x_46_im + (t_1 - (x_46_im * ((y_46_re / y_46_im) * (y_46_re / y_46_im))))) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im) t_1 = y_46_re * (x_46_re / y_46_im) tmp = 0 if y_46_im <= -1.3e+106: tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im elif y_46_im <= -7.5e-67: tmp = ((x_46_re * y_46_re) + (y_46_im * x_46_im)) / t_0 elif y_46_im <= 1.6e-45: tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 3.1e+146: tmp = (y_46_im * (x_46_im + t_1)) / t_0 else: tmp = (x_46_im + (t_1 - (x_46_im * ((y_46_re / y_46_im) * (y_46_re / y_46_im))))) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) t_1 = Float64(y_46_re * Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -1.3e+106) tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im); elseif (y_46_im <= -7.5e-67) tmp = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(y_46_im * x_46_im)) / t_0); elseif (y_46_im <= 1.6e-45) tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 3.1e+146) tmp = Float64(Float64(y_46_im * Float64(x_46_im + t_1)) / t_0); else tmp = Float64(Float64(x_46_im + Float64(t_1 - Float64(x_46_im * Float64(Float64(y_46_re / y_46_im) * Float64(y_46_re / y_46_im))))) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im); t_1 = y_46_re * (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -1.3e+106) tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im; elseif (y_46_im <= -7.5e-67) tmp = ((x_46_re * y_46_re) + (y_46_im * x_46_im)) / t_0; elseif (y_46_im <= 1.6e-45) tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 3.1e+146) tmp = (y_46_im * (x_46_im + t_1)) / t_0; else tmp = (x_46_im + (t_1 - (x_46_im * ((y_46_re / y_46_im) * (y_46_re / y_46_im))))) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.3e+106], N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -7.5e-67], N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 1.6e-45], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 3.1e+146], N[(N[(y$46$im * N[(x$46$im + t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(x$46$im + N[(t$95$1 - N[(x$46$im * N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
t_1 := y.re \cdot \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.3 \cdot 10^{+106}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\mathbf{elif}\;y.im \leq -7.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{x.re \cdot y.re + y.im \cdot x.im}{t\_0}\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{-45}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 3.1 \cdot 10^{+146}:\\
\;\;\;\;\frac{y.im \cdot \left(x.im + t\_1\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + \left(t\_1 - x.im \cdot \left(\frac{y.re}{y.im} \cdot \frac{y.re}{y.im}\right)\right)}{y.im}\\
\end{array}
\end{array}
if y.im < -1.3000000000000001e106Initial program 35.2%
Taylor expanded in y.im around inf 82.7%
associate-/l*91.4%
Simplified91.4%
if -1.3000000000000001e106 < y.im < -7.5000000000000005e-67Initial program 80.1%
if -7.5000000000000005e-67 < y.im < 1.60000000000000004e-45Initial program 68.6%
Taylor expanded in y.re around inf 88.3%
associate-/l*88.4%
Simplified88.4%
if 1.60000000000000004e-45 < y.im < 3.1000000000000002e146Initial program 78.0%
Taylor expanded in y.im around inf 78.0%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in x.re around 0 78.0%
*-commutative78.0%
associate-*r/78.1%
Simplified78.1%
if 3.1000000000000002e146 < y.im Initial program 24.3%
Taylor expanded in y.im around inf 58.1%
+-commutative58.1%
mul-1-neg58.1%
unsub-neg58.1%
*-commutative58.1%
associate-/l*61.2%
associate-/l*70.9%
Simplified70.9%
pow270.9%
pow270.9%
frac-times86.0%
Applied egg-rr86.0%
Final simplification86.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im)))
(t_1 (/ (+ x.im (* x.re (/ y.re y.im))) y.im)))
(if (<= y.im -2.1e+105)
t_1
(if (<= y.im -9.6e-68)
(/ (+ (* x.re y.re) (* y.im x.im)) t_0)
(if (<= y.im 2.05e-44)
(/ (+ x.re (* x.im (/ y.im y.re))) y.re)
(if (<= y.im 9.7e+145)
(/ (* y.im (+ x.im (* y.re (/ x.re y.im)))) t_0)
t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double t_1 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -2.1e+105) {
tmp = t_1;
} else if (y_46_im <= -9.6e-68) {
tmp = ((x_46_re * y_46_re) + (y_46_im * x_46_im)) / t_0;
} else if (y_46_im <= 2.05e-44) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 9.7e+145) {
tmp = (y_46_im * (x_46_im + (y_46_re * (x_46_re / y_46_im)))) / t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (y_46re * y_46re) + (y_46im * y_46im)
t_1 = (x_46im + (x_46re * (y_46re / y_46im))) / y_46im
if (y_46im <= (-2.1d+105)) then
tmp = t_1
else if (y_46im <= (-9.6d-68)) then
tmp = ((x_46re * y_46re) + (y_46im * x_46im)) / t_0
else if (y_46im <= 2.05d-44) then
tmp = (x_46re + (x_46im * (y_46im / y_46re))) / y_46re
else if (y_46im <= 9.7d+145) then
tmp = (y_46im * (x_46im + (y_46re * (x_46re / y_46im)))) / t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double t_1 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -2.1e+105) {
tmp = t_1;
} else if (y_46_im <= -9.6e-68) {
tmp = ((x_46_re * y_46_re) + (y_46_im * x_46_im)) / t_0;
} else if (y_46_im <= 2.05e-44) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 9.7e+145) {
tmp = (y_46_im * (x_46_im + (y_46_re * (x_46_re / y_46_im)))) / t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im) t_1 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im tmp = 0 if y_46_im <= -2.1e+105: tmp = t_1 elif y_46_im <= -9.6e-68: tmp = ((x_46_re * y_46_re) + (y_46_im * x_46_im)) / t_0 elif y_46_im <= 2.05e-44: tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 9.7e+145: tmp = (y_46_im * (x_46_im + (y_46_re * (x_46_re / y_46_im)))) / t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) t_1 = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im) tmp = 0.0 if (y_46_im <= -2.1e+105) tmp = t_1; elseif (y_46_im <= -9.6e-68) tmp = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(y_46_im * x_46_im)) / t_0); elseif (y_46_im <= 2.05e-44) tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 9.7e+145) tmp = Float64(Float64(y_46_im * Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im)))) / t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im); t_1 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im; tmp = 0.0; if (y_46_im <= -2.1e+105) tmp = t_1; elseif (y_46_im <= -9.6e-68) tmp = ((x_46_re * y_46_re) + (y_46_im * x_46_im)) / t_0; elseif (y_46_im <= 2.05e-44) tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 9.7e+145) tmp = (y_46_im * (x_46_im + (y_46_re * (x_46_re / y_46_im)))) / t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2.1e+105], t$95$1, If[LessEqual[y$46$im, -9.6e-68], N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 2.05e-44], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 9.7e+145], N[(N[(y$46$im * N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
t_1 := \frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\mathbf{if}\;y.im \leq -2.1 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -9.6 \cdot 10^{-68}:\\
\;\;\;\;\frac{x.re \cdot y.re + y.im \cdot x.im}{t\_0}\\
\mathbf{elif}\;y.im \leq 2.05 \cdot 10^{-44}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 9.7 \cdot 10^{+145}:\\
\;\;\;\;\frac{y.im \cdot \left(x.im + y.re \cdot \frac{x.re}{y.im}\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -2.1000000000000001e105 or 9.69999999999999987e145 < y.im Initial program 30.8%
Taylor expanded in y.im around inf 78.7%
associate-/l*89.1%
Simplified89.1%
if -2.1000000000000001e105 < y.im < -9.59999999999999965e-68Initial program 80.1%
if -9.59999999999999965e-68 < y.im < 2.04999999999999996e-44Initial program 68.6%
Taylor expanded in y.re around inf 88.3%
associate-/l*88.4%
Simplified88.4%
if 2.04999999999999996e-44 < y.im < 9.69999999999999987e145Initial program 78.0%
Taylor expanded in y.im around inf 78.0%
associate-/l*78.0%
Simplified78.0%
Taylor expanded in x.re around 0 78.0%
*-commutative78.0%
associate-*r/78.1%
Simplified78.1%
Final simplification85.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* y.im x.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ (+ x.im (* x.re (/ y.re y.im))) y.im)))
(if (<= y.im -1.05e+104)
t_1
(if (<= y.im -2.5e-68)
t_0
(if (<= y.im 3.1e-44)
(/ (+ x.re (* x.im (/ y.im y.re))) y.re)
(if (<= y.im 9.5e+145) 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 * x_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -1.05e+104) {
tmp = t_1;
} else if (y_46_im <= -2.5e-68) {
tmp = t_0;
} else if (y_46_im <= 3.1e-44) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 9.5e+145) {
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 * x_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im + (x_46re * (y_46re / y_46im))) / y_46im
if (y_46im <= (-1.05d+104)) then
tmp = t_1
else if (y_46im <= (-2.5d-68)) then
tmp = t_0
else if (y_46im <= 3.1d-44) then
tmp = (x_46re + (x_46im * (y_46im / y_46re))) / y_46re
else if (y_46im <= 9.5d+145) 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 * x_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -1.05e+104) {
tmp = t_1;
} else if (y_46_im <= -2.5e-68) {
tmp = t_0;
} else if (y_46_im <= 3.1e-44) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 9.5e+145) {
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 * x_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im tmp = 0 if y_46_im <= -1.05e+104: tmp = t_1 elif y_46_im <= -2.5e-68: tmp = t_0 elif y_46_im <= 3.1e-44: tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 9.5e+145: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(y_46_im * x_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im) tmp = 0.0 if (y_46_im <= -1.05e+104) tmp = t_1; elseif (y_46_im <= -2.5e-68) tmp = t_0; elseif (y_46_im <= 3.1e-44) tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 9.5e+145) 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 * x_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im; tmp = 0.0; if (y_46_im <= -1.05e+104) tmp = t_1; elseif (y_46_im <= -2.5e-68) tmp = t_0; elseif (y_46_im <= 3.1e-44) tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 9.5e+145) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * x$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[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1.05e+104], t$95$1, If[LessEqual[y$46$im, -2.5e-68], t$95$0, If[LessEqual[y$46$im, 3.1e-44], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 9.5e+145], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\mathbf{if}\;y.im \leq -1.05 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -2.5 \cdot 10^{-68}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 3.1 \cdot 10^{-44}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 9.5 \cdot 10^{+145}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.0499999999999999e104 or 9.49999999999999948e145 < y.im Initial program 30.8%
Taylor expanded in y.im around inf 78.7%
associate-/l*89.1%
Simplified89.1%
if -1.0499999999999999e104 < y.im < -2.49999999999999986e-68 or 3.09999999999999984e-44 < y.im < 9.49999999999999948e145Initial program 79.1%
if -2.49999999999999986e-68 < y.im < 3.09999999999999984e-44Initial program 68.6%
Taylor expanded in y.re around inf 88.3%
associate-/l*88.4%
Simplified88.4%
Final simplification85.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (+ x.im (* x.re (/ y.re y.im))) y.im)))
(if (<= y.im -2.8e+85)
t_0
(if (<= y.im -1.62e+22)
(/ (* y.im x.im) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im -2.85e-20)
t_0
(if (<= y.im 2.6e-31)
(/ (+ x.re (* x.im (/ y.im y.re))) y.re)
(/ (+ x.im (* y.re (/ x.re y.im))) y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -2.8e+85) {
tmp = t_0;
} else if (y_46_im <= -1.62e+22) {
tmp = (y_46_im * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= -2.85e-20) {
tmp = t_0;
} else if (y_46_im <= 2.6e-31) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_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) :: t_0
real(8) :: tmp
t_0 = (x_46im + (x_46re * (y_46re / y_46im))) / y_46im
if (y_46im <= (-2.8d+85)) then
tmp = t_0
else if (y_46im <= (-1.62d+22)) then
tmp = (y_46im * x_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46im <= (-2.85d-20)) then
tmp = t_0
else if (y_46im <= 2.6d-31) then
tmp = (x_46re + (x_46im * (y_46im / y_46re))) / y_46re
else
tmp = (x_46im + (y_46re * (x_46re / y_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 t_0 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
double tmp;
if (y_46_im <= -2.8e+85) {
tmp = t_0;
} else if (y_46_im <= -1.62e+22) {
tmp = (y_46_im * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= -2.85e-20) {
tmp = t_0;
} else if (y_46_im <= 2.6e-31) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im tmp = 0 if y_46_im <= -2.8e+85: tmp = t_0 elif y_46_im <= -1.62e+22: tmp = (y_46_im * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_im <= -2.85e-20: tmp = t_0 elif y_46_im <= 2.6e-31: tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re else: tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im) tmp = 0.0 if (y_46_im <= -2.8e+85) tmp = t_0; elseif (y_46_im <= -1.62e+22) tmp = Float64(Float64(y_46_im * x_46_im) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= -2.85e-20) tmp = t_0; elseif (y_46_im <= 2.6e-31) tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im; tmp = 0.0; if (y_46_im <= -2.8e+85) tmp = t_0; elseif (y_46_im <= -1.62e+22) tmp = (y_46_im * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_im <= -2.85e-20) tmp = t_0; elseif (y_46_im <= 2.6e-31) tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re; else tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2.8e+85], t$95$0, If[LessEqual[y$46$im, -1.62e+22], N[(N[(y$46$im * x$46$im), $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.85e-20], t$95$0, If[LessEqual[y$46$im, 2.6e-31], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\mathbf{if}\;y.im \leq -2.8 \cdot 10^{+85}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -1.62 \cdot 10^{+22}:\\
\;\;\;\;\frac{y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq -2.85 \cdot 10^{-20}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.6 \cdot 10^{-31}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.im < -2.7999999999999999e85 or -1.62e22 < y.im < -2.85000000000000012e-20Initial program 45.9%
Taylor expanded in y.im around inf 77.7%
associate-/l*84.2%
Simplified84.2%
if -2.7999999999999999e85 < y.im < -1.62e22Initial program 88.7%
Taylor expanded in x.re around 0 83.1%
if -2.85000000000000012e-20 < y.im < 2.59999999999999995e-31Initial program 69.1%
Taylor expanded in y.re around inf 86.1%
associate-/l*86.1%
Simplified86.1%
if 2.59999999999999995e-31 < y.im Initial program 51.4%
Taylor expanded in y.im around inf 56.7%
+-commutative56.7%
mul-1-neg56.7%
unsub-neg56.7%
*-commutative56.7%
associate-/l*58.2%
associate-/l*62.9%
Simplified62.9%
pow262.9%
pow262.9%
frac-times70.3%
Applied egg-rr70.3%
Taylor expanded in y.re around 0 64.4%
*-commutative64.4%
associate-*r/70.7%
Simplified70.7%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.im -1.32e+85)
(/ (+ x.im (* x.re (/ y.re y.im))) y.im)
(if (<= y.im -4.6e-7)
(/ (* y.im x.im) t_0)
(if (<= y.im -4.2e-20)
(/ (* x.re y.re) t_0)
(if (<= y.im 2.7e-30)
(/ (+ x.re (* x.im (/ y.im y.re))) y.re)
(/ (+ x.im (* y.re (/ x.re y.im))) y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_im <= -1.32e+85) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
} else if (y_46_im <= -4.6e-7) {
tmp = (y_46_im * x_46_im) / t_0;
} else if (y_46_im <= -4.2e-20) {
tmp = (x_46_re * y_46_re) / t_0;
} else if (y_46_im <= 2.7e-30) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_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) :: t_0
real(8) :: tmp
t_0 = (y_46re * y_46re) + (y_46im * y_46im)
if (y_46im <= (-1.32d+85)) then
tmp = (x_46im + (x_46re * (y_46re / y_46im))) / y_46im
else if (y_46im <= (-4.6d-7)) then
tmp = (y_46im * x_46im) / t_0
else if (y_46im <= (-4.2d-20)) then
tmp = (x_46re * y_46re) / t_0
else if (y_46im <= 2.7d-30) then
tmp = (x_46re + (x_46im * (y_46im / y_46re))) / y_46re
else
tmp = (x_46im + (y_46re * (x_46re / y_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 t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_im <= -1.32e+85) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
} else if (y_46_im <= -4.6e-7) {
tmp = (y_46_im * x_46_im) / t_0;
} else if (y_46_im <= -4.2e-20) {
tmp = (x_46_re * y_46_re) / t_0;
} else if (y_46_im <= 2.7e-30) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im) tmp = 0 if y_46_im <= -1.32e+85: tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im elif y_46_im <= -4.6e-7: tmp = (y_46_im * x_46_im) / t_0 elif y_46_im <= -4.2e-20: tmp = (x_46_re * y_46_re) / t_0 elif y_46_im <= 2.7e-30: tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re else: tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) tmp = 0.0 if (y_46_im <= -1.32e+85) tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im); elseif (y_46_im <= -4.6e-7) tmp = Float64(Float64(y_46_im * x_46_im) / t_0); elseif (y_46_im <= -4.2e-20) tmp = Float64(Float64(x_46_re * y_46_re) / t_0); elseif (y_46_im <= 2.7e-30) tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im); tmp = 0.0; if (y_46_im <= -1.32e+85) tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im; elseif (y_46_im <= -4.6e-7) tmp = (y_46_im * x_46_im) / t_0; elseif (y_46_im <= -4.2e-20) tmp = (x_46_re * y_46_re) / t_0; elseif (y_46_im <= 2.7e-30) tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re; else tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.32e+85], N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -4.6e-7], N[(N[(y$46$im * x$46$im), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$im, -4.2e-20], N[(N[(x$46$re * y$46$re), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 2.7e-30], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
\mathbf{if}\;y.im \leq -1.32 \cdot 10^{+85}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\mathbf{elif}\;y.im \leq -4.6 \cdot 10^{-7}:\\
\;\;\;\;\frac{y.im \cdot x.im}{t\_0}\\
\mathbf{elif}\;y.im \leq -4.2 \cdot 10^{-20}:\\
\;\;\;\;\frac{x.re \cdot y.re}{t\_0}\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{-30}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.im < -1.32000000000000007e85Initial program 36.6%
Taylor expanded in y.im around inf 80.2%
associate-/l*88.2%
Simplified88.2%
if -1.32000000000000007e85 < y.im < -4.5999999999999999e-7Initial program 87.8%
Taylor expanded in x.re around 0 75.8%
if -4.5999999999999999e-7 < y.im < -4.1999999999999998e-20Initial program 81.6%
Taylor expanded in x.re around inf 81.6%
*-commutative81.6%
Simplified81.6%
if -4.1999999999999998e-20 < y.im < 2.69999999999999987e-30Initial program 69.1%
Taylor expanded in y.re around inf 86.1%
associate-/l*86.1%
Simplified86.1%
if 2.69999999999999987e-30 < y.im Initial program 51.4%
Taylor expanded in y.im around inf 56.7%
+-commutative56.7%
mul-1-neg56.7%
unsub-neg56.7%
*-commutative56.7%
associate-/l*58.2%
associate-/l*62.9%
Simplified62.9%
pow262.9%
pow262.9%
frac-times70.3%
Applied egg-rr70.3%
Taylor expanded in y.re around 0 64.4%
*-commutative64.4%
associate-*r/70.7%
Simplified70.7%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -4.3e+17)
(/ x.im y.im)
(if (<= y.im 1.4e-206)
(/ x.re y.re)
(if (<= y.im 6.3e-183)
(/ (* x.im (/ y.im y.re)) y.re)
(if (<= y.im 1.7e-41) (/ 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 <= -4.3e+17) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.4e-206) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 6.3e-183) {
tmp = (x_46_im * (y_46_im / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.7e-41) {
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 <= (-4.3d+17)) then
tmp = x_46im / y_46im
else if (y_46im <= 1.4d-206) then
tmp = x_46re / y_46re
else if (y_46im <= 6.3d-183) then
tmp = (x_46im * (y_46im / y_46re)) / y_46re
else if (y_46im <= 1.7d-41) 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 <= -4.3e+17) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.4e-206) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 6.3e-183) {
tmp = (x_46_im * (y_46_im / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.7e-41) {
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 <= -4.3e+17: tmp = x_46_im / y_46_im elif y_46_im <= 1.4e-206: tmp = x_46_re / y_46_re elif y_46_im <= 6.3e-183: tmp = (x_46_im * (y_46_im / y_46_re)) / y_46_re elif y_46_im <= 1.7e-41: 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 <= -4.3e+17) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 1.4e-206) tmp = Float64(x_46_re / y_46_re); elseif (y_46_im <= 6.3e-183) tmp = Float64(Float64(x_46_im * Float64(y_46_im / y_46_re)) / y_46_re); elseif (y_46_im <= 1.7e-41) 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 <= -4.3e+17) tmp = x_46_im / y_46_im; elseif (y_46_im <= 1.4e-206) tmp = x_46_re / y_46_re; elseif (y_46_im <= 6.3e-183) tmp = (x_46_im * (y_46_im / y_46_re)) / y_46_re; elseif (y_46_im <= 1.7e-41) 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, -4.3e+17], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.4e-206], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 6.3e-183], N[(N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.7e-41], 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 -4.3 \cdot 10^{+17}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{-206}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.im \leq 6.3 \cdot 10^{-183}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{-41}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -4.3e17 or 1.6999999999999999e-41 < y.im Initial program 51.4%
Taylor expanded in y.re around 0 68.3%
if -4.3e17 < y.im < 1.4000000000000001e-206 or 6.2999999999999998e-183 < y.im < 1.6999999999999999e-41Initial program 69.1%
Taylor expanded in y.re around inf 68.1%
if 1.4000000000000001e-206 < y.im < 6.2999999999999998e-183Initial program 80.4%
Taylor expanded in y.re around inf 81.1%
associate-/l*81.1%
Simplified81.1%
Taylor expanded in y.im around inf 81.0%
+-commutative81.0%
Simplified81.0%
Taylor expanded in y.im around inf 80.0%
associate-/l*80.0%
Simplified80.0%
Final simplification68.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.7e+68) (not (<= y.re 3.95e+68))) (/ x.re y.re) (/ (+ x.im (* x.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) {
double tmp;
if ((y_46_re <= -2.7e+68) || !(y_46_re <= 3.95e+68)) {
tmp = x_46_re / y_46_re;
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-2.7d+68)) .or. (.not. (y_46re <= 3.95d+68))) then
tmp = x_46re / y_46re
else
tmp = (x_46im + (x_46re * (y_46re / y_46im))) / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.7e+68) || !(y_46_re <= 3.95e+68)) {
tmp = x_46_re / y_46_re;
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2.7e+68) or not (y_46_re <= 3.95e+68): tmp = x_46_re / y_46_re else: tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -2.7e+68) || !(y_46_re <= 3.95e+68)) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -2.7e+68) || ~((y_46_re <= 3.95e+68))) tmp = x_46_re / y_46_re; else tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.7e+68], N[Not[LessEqual[y$46$re, 3.95e+68]], $MachinePrecision]], N[(x$46$re / y$46$re), $MachinePrecision], N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.7 \cdot 10^{+68} \lor \neg \left(y.re \leq 3.95 \cdot 10^{+68}\right):\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.re < -2.69999999999999991e68 or 3.95e68 < y.re Initial program 43.0%
Taylor expanded in y.re around inf 75.3%
if -2.69999999999999991e68 < y.re < 3.95e68Initial program 71.4%
Taylor expanded in y.im around inf 70.3%
associate-/l*72.7%
Simplified72.7%
Final simplification73.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -4.1e-20)
(/ (+ x.im (* x.re (/ y.re y.im))) y.im)
(if (<= y.im 2.1e-30)
(/ (+ x.re (* x.im (/ y.im y.re))) y.re)
(/ (+ x.im (* y.re (/ x.re y.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 <= -4.1e-20) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
} else if (y_46_im <= 2.1e-30) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_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 <= (-4.1d-20)) then
tmp = (x_46im + (x_46re * (y_46re / y_46im))) / y_46im
else if (y_46im <= 2.1d-30) then
tmp = (x_46re + (x_46im * (y_46im / y_46re))) / y_46re
else
tmp = (x_46im + (y_46re * (x_46re / y_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 <= -4.1e-20) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
} else if (y_46_im <= 2.1e-30) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_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 <= -4.1e-20: tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im elif y_46_im <= 2.1e-30: tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re else: tmp = (x_46_im + (y_46_re * (x_46_re / y_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 <= -4.1e-20) tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im); elseif (y_46_im <= 2.1e-30) tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -4.1e-20) tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im; elseif (y_46_im <= 2.1e-30) tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re; else tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -4.1e-20], N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 2.1e-30], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.1 \cdot 10^{-20}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\mathbf{elif}\;y.im \leq 2.1 \cdot 10^{-30}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.im < -4.1000000000000001e-20Initial program 55.3%
Taylor expanded in y.im around inf 73.5%
associate-/l*78.5%
Simplified78.5%
if -4.1000000000000001e-20 < y.im < 2.1000000000000002e-30Initial program 69.1%
Taylor expanded in y.re around inf 86.1%
associate-/l*86.1%
Simplified86.1%
if 2.1000000000000002e-30 < y.im Initial program 51.4%
Taylor expanded in y.im around inf 56.7%
+-commutative56.7%
mul-1-neg56.7%
unsub-neg56.7%
*-commutative56.7%
associate-/l*58.2%
associate-/l*62.9%
Simplified62.9%
pow262.9%
pow262.9%
frac-times70.3%
Applied egg-rr70.3%
Taylor expanded in y.re around 0 64.4%
*-commutative64.4%
associate-*r/70.7%
Simplified70.7%
Final simplification80.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.5e+15) (not (<= y.im 2.26e-38))) (/ x.im 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_im <= -2.5e+15) || !(y_46_im <= 2.26e-38)) {
tmp = x_46_im / 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_46im <= (-2.5d+15)) .or. (.not. (y_46im <= 2.26d-38))) then
tmp = x_46im / 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_im <= -2.5e+15) || !(y_46_im <= 2.26e-38)) {
tmp = x_46_im / 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_im <= -2.5e+15) or not (y_46_im <= 2.26e-38): tmp = x_46_im / 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_im <= -2.5e+15) || !(y_46_im <= 2.26e-38)) tmp = Float64(x_46_im / 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_im <= -2.5e+15) || ~((y_46_im <= 2.26e-38))) tmp = x_46_im / 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[Or[LessEqual[y$46$im, -2.5e+15], N[Not[LessEqual[y$46$im, 2.26e-38]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.5 \cdot 10^{+15} \lor \neg \left(y.im \leq 2.26 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -2.5e15 or 2.26e-38 < y.im Initial program 51.4%
Taylor expanded in y.re around 0 68.3%
if -2.5e15 < y.im < 2.26e-38Initial program 70.0%
Taylor expanded in y.re around inf 65.3%
Final simplification66.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.im))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46im
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_im) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 60.4%
Taylor expanded in y.re around 0 42.5%
Final simplification42.5%
herbie shell --seed 2024055
(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))))