
(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)
(*
(/ 1.0 (hypot y.re y.im))
(/ (fma x.re y.re (* x.im y.im)) (hypot 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 ((((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 = (1.0 / hypot(y_46_re, y_46_im)) * (fma(x_46_re, y_46_re, (x_46_im * y_46_im)) / hypot(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 (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(1.0 / hypot(y_46_re, y_46_im)) * Float64(fma(x_46_re, y_46_re, Float64(x_46_im * y_46_im)) / hypot(y_46_re, y_46_im))); else tmp = Float64(x_46_re / y_46_re); 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[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * 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]), $MachinePrecision], N[(x$46$re / y$46$re), $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{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\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 73.6%
*-un-lft-identity73.6%
associate-*r/73.6%
fma-def73.6%
add-sqr-sqrt73.6%
times-frac73.6%
fma-def73.6%
hypot-def73.6%
fma-def73.6%
fma-def73.6%
hypot-def88.9%
Applied egg-rr88.9%
if +inf.0 < (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 0.0%
Taylor expanded in y.re around inf 54.4%
Final simplification84.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re y.re) (* x.im y.im))))
(if (<= y.im -2.7e+36)
(* (/ -1.0 (hypot y.re y.im)) (+ x.im (* y.re (/ x.re y.im))))
(if (<= y.im -1e-171)
(/ t_0 (pow (hypot y.re y.im) 2.0))
(if (<= y.im 8.2e-294)
(+ (/ x.re y.re) (/ x.im (/ (pow y.re 2.0) y.im)))
(if (<= y.im 2.15e+64)
(/ t_0 (+ (* y.re y.re) (* y.im y.im)))
(* (/ 1.0 (hypot y.re y.im)) (+ x.im (/ (* x.re y.re) y.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double tmp;
if (y_46_im <= -2.7e+36) {
tmp = (-1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
} else if (y_46_im <= -1e-171) {
tmp = t_0 / pow(hypot(y_46_re, y_46_im), 2.0);
} else if (y_46_im <= 8.2e-294) {
tmp = (x_46_re / y_46_re) + (x_46_im / (pow(y_46_re, 2.0) / y_46_im));
} else if (y_46_im <= 2.15e+64) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double tmp;
if (y_46_im <= -2.7e+36) {
tmp = (-1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
} else if (y_46_im <= -1e-171) {
tmp = t_0 / Math.pow(Math.hypot(y_46_re, y_46_im), 2.0);
} else if (y_46_im <= 8.2e-294) {
tmp = (x_46_re / y_46_re) + (x_46_im / (Math.pow(y_46_re, 2.0) / y_46_im));
} else if (y_46_im <= 2.15e+64) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im) tmp = 0 if y_46_im <= -2.7e+36: tmp = (-1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_im + (y_46_re * (x_46_re / y_46_im))) elif y_46_im <= -1e-171: tmp = t_0 / math.pow(math.hypot(y_46_re, y_46_im), 2.0) elif y_46_im <= 8.2e-294: tmp = (x_46_re / y_46_re) + (x_46_im / (math.pow(y_46_re, 2.0) / y_46_im)) elif y_46_im <= 2.15e+64: tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) else: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) tmp = 0.0 if (y_46_im <= -2.7e+36) tmp = Float64(Float64(-1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im)))); elseif (y_46_im <= -1e-171) tmp = Float64(t_0 / (hypot(y_46_re, y_46_im) ^ 2.0)); elseif (y_46_im <= 8.2e-294) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64((y_46_re ^ 2.0) / y_46_im))); elseif (y_46_im <= 2.15e+64) tmp = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_im + Float64(Float64(x_46_re * y_46_re) / y_46_im))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im); tmp = 0.0; if (y_46_im <= -2.7e+36) tmp = (-1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + (y_46_re * (x_46_re / y_46_im))); elseif (y_46_im <= -1e-171) tmp = t_0 / (hypot(y_46_re, y_46_im) ^ 2.0); elseif (y_46_im <= 8.2e-294) tmp = (x_46_re / y_46_re) + (x_46_im / ((y_46_re ^ 2.0) / y_46_im)); elseif (y_46_im <= 2.15e+64) tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); else tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.7e+36], N[(N[(-1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1e-171], N[(t$95$0 / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.2e-294], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(N[Power[y$46$re, 2.0], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.15e+64], N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im + N[(N[(x$46$re * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot y.re + x.im \cdot y.im\\
\mathbf{if}\;y.im \leq -2.7 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.im + y.re \cdot \frac{x.re}{y.im}\right)\\
\mathbf{elif}\;y.im \leq -1 \cdot 10^{-171}:\\
\;\;\;\;\frac{t\_0}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\\
\mathbf{elif}\;y.im \leq 8.2 \cdot 10^{-294}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{\frac{{y.re}^{2}}{y.im}}\\
\mathbf{elif}\;y.im \leq 2.15 \cdot 10^{+64}:\\
\;\;\;\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.im + \frac{x.re \cdot y.re}{y.im}\right)\\
\end{array}
\end{array}
if y.im < -2.7000000000000001e36Initial program 48.1%
*-un-lft-identity48.1%
associate-*r/48.1%
fma-def48.1%
add-sqr-sqrt48.1%
times-frac48.1%
fma-def48.1%
hypot-def48.1%
fma-def48.1%
fma-def48.1%
hypot-def69.1%
Applied egg-rr69.1%
Taylor expanded in y.im around -inf 81.6%
mul-1-neg81.6%
unsub-neg81.6%
mul-1-neg81.6%
associate-/l*81.9%
associate-/r/83.4%
Simplified83.4%
if -2.7000000000000001e36 < y.im < -9.9999999999999998e-172Initial program 81.4%
expm1-log1p-u79.3%
expm1-udef45.7%
fma-def45.7%
add-sqr-sqrt45.7%
pow245.7%
fma-def45.7%
hypot-def45.7%
Applied egg-rr45.7%
expm1-def79.3%
expm1-log1p81.5%
Simplified81.5%
if -9.9999999999999998e-172 < y.im < 8.1999999999999998e-294Initial program 67.3%
Taylor expanded in y.re around inf 82.0%
associate-/l*82.2%
Simplified82.2%
if 8.1999999999999998e-294 < y.im < 2.1499999999999999e64Initial program 80.3%
if 2.1499999999999999e64 < y.im Initial program 35.1%
*-un-lft-identity35.1%
associate-*r/35.1%
fma-def35.1%
add-sqr-sqrt35.2%
times-frac35.3%
fma-def35.3%
hypot-def35.3%
fma-def35.3%
fma-def35.3%
hypot-def63.6%
Applied egg-rr63.6%
Taylor expanded in y.re around 0 78.6%
Final simplification81.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -4.3e+46)
(+ (/ x.im y.im) (/ x.re (/ (pow y.im 2.0) y.re)))
(if (<= y.im -5.4e-170)
t_0
(if (<= y.im 9e-294)
(+ (/ x.re y.re) (/ x.im (/ (pow y.re 2.0) y.im)))
(if (<= y.im 1.25e+66)
t_0
(* (/ 1.0 (hypot y.re y.im)) (+ x.im (/ (* x.re y.re) y.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -4.3e+46) {
tmp = (x_46_im / y_46_im) + (x_46_re / (pow(y_46_im, 2.0) / y_46_re));
} else if (y_46_im <= -5.4e-170) {
tmp = t_0;
} else if (y_46_im <= 9e-294) {
tmp = (x_46_re / y_46_re) + (x_46_im / (pow(y_46_re, 2.0) / y_46_im));
} else if (y_46_im <= 1.25e+66) {
tmp = t_0;
} else {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -4.3e+46) {
tmp = (x_46_im / y_46_im) + (x_46_re / (Math.pow(y_46_im, 2.0) / y_46_re));
} else if (y_46_im <= -5.4e-170) {
tmp = t_0;
} else if (y_46_im <= 9e-294) {
tmp = (x_46_re / y_46_re) + (x_46_im / (Math.pow(y_46_re, 2.0) / y_46_im));
} else if (y_46_im <= 1.25e+66) {
tmp = t_0;
} else {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -4.3e+46: tmp = (x_46_im / y_46_im) + (x_46_re / (math.pow(y_46_im, 2.0) / y_46_re)) elif y_46_im <= -5.4e-170: tmp = t_0 elif y_46_im <= 9e-294: tmp = (x_46_re / y_46_re) + (x_46_im / (math.pow(y_46_re, 2.0) / y_46_im)) elif y_46_im <= 1.25e+66: tmp = t_0 else: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(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_im <= -4.3e+46) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64((y_46_im ^ 2.0) / y_46_re))); elseif (y_46_im <= -5.4e-170) tmp = t_0; elseif (y_46_im <= 9e-294) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64((y_46_re ^ 2.0) / y_46_im))); elseif (y_46_im <= 1.25e+66) tmp = t_0; else tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_im + Float64(Float64(x_46_re * 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_im <= -4.3e+46) tmp = (x_46_im / y_46_im) + (x_46_re / ((y_46_im ^ 2.0) / y_46_re)); elseif (y_46_im <= -5.4e-170) tmp = t_0; elseif (y_46_im <= 9e-294) tmp = (x_46_re / y_46_re) + (x_46_im / ((y_46_re ^ 2.0) / y_46_im)); elseif (y_46_im <= 1.25e+66) tmp = t_0; else tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(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, -4.3e+46], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(N[Power[y$46$im, 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -5.4e-170], t$95$0, If[LessEqual[y$46$im, 9e-294], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(N[Power[y$46$re, 2.0], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.25e+66], t$95$0, N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im + N[(N[(x$46$re * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $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.im \leq -4.3 \cdot 10^{+46}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{\frac{{y.im}^{2}}{y.re}}\\
\mathbf{elif}\;y.im \leq -5.4 \cdot 10^{-170}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 9 \cdot 10^{-294}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{\frac{{y.re}^{2}}{y.im}}\\
\mathbf{elif}\;y.im \leq 1.25 \cdot 10^{+66}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.im + \frac{x.re \cdot y.re}{y.im}\right)\\
\end{array}
\end{array}
if y.im < -4.30000000000000005e46Initial program 46.4%
Taylor expanded in y.re around 0 75.0%
associate-/l*75.3%
Simplified75.3%
if -4.30000000000000005e46 < y.im < -5.3999999999999997e-170 or 8.99999999999999963e-294 < y.im < 1.24999999999999998e66Initial program 81.1%
if -5.3999999999999997e-170 < y.im < 8.99999999999999963e-294Initial program 67.3%
Taylor expanded in y.re around inf 82.0%
associate-/l*82.2%
Simplified82.2%
if 1.24999999999999998e66 < y.im Initial program 35.1%
*-un-lft-identity35.1%
associate-*r/35.1%
fma-def35.1%
add-sqr-sqrt35.2%
times-frac35.3%
fma-def35.3%
hypot-def35.3%
fma-def35.3%
fma-def35.3%
hypot-def63.6%
Applied egg-rr63.6%
Taylor expanded in y.re around 0 78.6%
Final simplification79.5%
(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.im -2.7e+36)
(* (/ -1.0 (hypot y.re y.im)) (+ x.im (* y.re (/ x.re y.im))))
(if (<= y.im -1.3e-170)
t_0
(if (<= y.im 8.2e-294)
(+ (/ x.re y.re) (/ x.im (/ (pow y.re 2.0) y.im)))
(if (<= y.im 1.1e+65)
t_0
(* (/ 1.0 (hypot y.re y.im)) (+ x.im (/ (* x.re y.re) y.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -2.7e+36) {
tmp = (-1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
} else if (y_46_im <= -1.3e-170) {
tmp = t_0;
} else if (y_46_im <= 8.2e-294) {
tmp = (x_46_re / y_46_re) + (x_46_im / (pow(y_46_re, 2.0) / y_46_im));
} else if (y_46_im <= 1.1e+65) {
tmp = t_0;
} else {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -2.7e+36) {
tmp = (-1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
} else if (y_46_im <= -1.3e-170) {
tmp = t_0;
} else if (y_46_im <= 8.2e-294) {
tmp = (x_46_re / y_46_re) + (x_46_im / (Math.pow(y_46_re, 2.0) / y_46_im));
} else if (y_46_im <= 1.1e+65) {
tmp = t_0;
} else {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -2.7e+36: tmp = (-1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_im + (y_46_re * (x_46_re / y_46_im))) elif y_46_im <= -1.3e-170: tmp = t_0 elif y_46_im <= 8.2e-294: tmp = (x_46_re / y_46_re) + (x_46_im / (math.pow(y_46_re, 2.0) / y_46_im)) elif y_46_im <= 1.1e+65: tmp = t_0 else: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(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_im <= -2.7e+36) tmp = Float64(Float64(-1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im)))); elseif (y_46_im <= -1.3e-170) tmp = t_0; elseif (y_46_im <= 8.2e-294) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64((y_46_re ^ 2.0) / y_46_im))); elseif (y_46_im <= 1.1e+65) tmp = t_0; else tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_im + Float64(Float64(x_46_re * 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_im <= -2.7e+36) tmp = (-1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + (y_46_re * (x_46_re / y_46_im))); elseif (y_46_im <= -1.3e-170) tmp = t_0; elseif (y_46_im <= 8.2e-294) tmp = (x_46_re / y_46_re) + (x_46_im / ((y_46_re ^ 2.0) / y_46_im)); elseif (y_46_im <= 1.1e+65) tmp = t_0; else tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + ((x_46_re * y_46_re) / y_46_im)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(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.7e+36], N[(N[(-1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.3e-170], t$95$0, If[LessEqual[y$46$im, 8.2e-294], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(N[Power[y$46$re, 2.0], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.1e+65], t$95$0, N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im + N[(N[(x$46$re * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $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.im \leq -2.7 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.im + y.re \cdot \frac{x.re}{y.im}\right)\\
\mathbf{elif}\;y.im \leq -1.3 \cdot 10^{-170}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 8.2 \cdot 10^{-294}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{\frac{{y.re}^{2}}{y.im}}\\
\mathbf{elif}\;y.im \leq 1.1 \cdot 10^{+65}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.im + \frac{x.re \cdot y.re}{y.im}\right)\\
\end{array}
\end{array}
if y.im < -2.7000000000000001e36Initial program 48.1%
*-un-lft-identity48.1%
associate-*r/48.1%
fma-def48.1%
add-sqr-sqrt48.1%
times-frac48.1%
fma-def48.1%
hypot-def48.1%
fma-def48.1%
fma-def48.1%
hypot-def69.1%
Applied egg-rr69.1%
Taylor expanded in y.im around -inf 81.6%
mul-1-neg81.6%
unsub-neg81.6%
mul-1-neg81.6%
associate-/l*81.9%
associate-/r/83.4%
Simplified83.4%
if -2.7000000000000001e36 < y.im < -1.3000000000000001e-170 or 8.1999999999999998e-294 < y.im < 1.0999999999999999e65Initial program 80.8%
if -1.3000000000000001e-170 < y.im < 8.1999999999999998e-294Initial program 67.3%
Taylor expanded in y.re around inf 82.0%
associate-/l*82.2%
Simplified82.2%
if 1.0999999999999999e65 < y.im Initial program 35.1%
*-un-lft-identity35.1%
associate-*r/35.1%
fma-def35.1%
add-sqr-sqrt35.2%
times-frac35.3%
fma-def35.3%
hypot-def35.3%
fma-def35.3%
fma-def35.3%
hypot-def63.6%
Applied egg-rr63.6%
Taylor expanded in y.re around 0 78.6%
Final simplification81.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (+ (/ x.im y.im) (/ x.re (/ (pow y.im 2.0) y.re)))))
(if (<= y.im -3.6e+46)
t_1
(if (<= y.im -3.6e-170)
t_0
(if (<= y.im 1e-293)
(+ (/ x.re y.re) (/ x.im (/ (pow y.re 2.0) y.im)))
(if (<= y.im 6e+66) 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_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_im) + (x_46_re / (pow(y_46_im, 2.0) / y_46_re));
double tmp;
if (y_46_im <= -3.6e+46) {
tmp = t_1;
} else if (y_46_im <= -3.6e-170) {
tmp = t_0;
} else if (y_46_im <= 1e-293) {
tmp = (x_46_re / y_46_re) + (x_46_im / (pow(y_46_re, 2.0) / y_46_im));
} else if (y_46_im <= 6e+66) {
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_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im / y_46im) + (x_46re / ((y_46im ** 2.0d0) / y_46re))
if (y_46im <= (-3.6d+46)) then
tmp = t_1
else if (y_46im <= (-3.6d-170)) then
tmp = t_0
else if (y_46im <= 1d-293) then
tmp = (x_46re / y_46re) + (x_46im / ((y_46re ** 2.0d0) / y_46im))
else if (y_46im <= 6d+66) 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_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_im) + (x_46_re / (Math.pow(y_46_im, 2.0) / y_46_re));
double tmp;
if (y_46_im <= -3.6e+46) {
tmp = t_1;
} else if (y_46_im <= -3.6e-170) {
tmp = t_0;
} else if (y_46_im <= 1e-293) {
tmp = (x_46_re / y_46_re) + (x_46_im / (Math.pow(y_46_re, 2.0) / y_46_im));
} else if (y_46_im <= 6e+66) {
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_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_im / y_46_im) + (x_46_re / (math.pow(y_46_im, 2.0) / y_46_re)) tmp = 0 if y_46_im <= -3.6e+46: tmp = t_1 elif y_46_im <= -3.6e-170: tmp = t_0 elif y_46_im <= 1e-293: tmp = (x_46_re / y_46_re) + (x_46_im / (math.pow(y_46_re, 2.0) / y_46_im)) elif y_46_im <= 6e+66: 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(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64((y_46_im ^ 2.0) / y_46_re))) tmp = 0.0 if (y_46_im <= -3.6e+46) tmp = t_1; elseif (y_46_im <= -3.6e-170) tmp = t_0; elseif (y_46_im <= 1e-293) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64((y_46_re ^ 2.0) / y_46_im))); elseif (y_46_im <= 6e+66) 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_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_im / y_46_im) + (x_46_re / ((y_46_im ^ 2.0) / y_46_re)); tmp = 0.0; if (y_46_im <= -3.6e+46) tmp = t_1; elseif (y_46_im <= -3.6e-170) tmp = t_0; elseif (y_46_im <= 1e-293) tmp = (x_46_re / y_46_re) + (x_46_im / ((y_46_re ^ 2.0) / y_46_im)); elseif (y_46_im <= 6e+66) 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[(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[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(N[Power[y$46$im, 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.6e+46], t$95$1, If[LessEqual[y$46$im, -3.6e-170], t$95$0, If[LessEqual[y$46$im, 1e-293], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(N[Power[y$46$re, 2.0], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6e+66], t$95$0, t$95$1]]]]]]
\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{x.im}{y.im} + \frac{x.re}{\frac{{y.im}^{2}}{y.re}}\\
\mathbf{if}\;y.im \leq -3.6 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -3.6 \cdot 10^{-170}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 10^{-293}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{\frac{{y.re}^{2}}{y.im}}\\
\mathbf{elif}\;y.im \leq 6 \cdot 10^{+66}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -3.5999999999999999e46 or 6.00000000000000005e66 < y.im Initial program 41.9%
Taylor expanded in y.re around 0 74.4%
associate-/l*75.7%
Simplified75.7%
if -3.5999999999999999e46 < y.im < -3.6000000000000003e-170 or 1.0000000000000001e-293 < y.im < 6.00000000000000005e66Initial program 81.1%
if -3.6000000000000003e-170 < y.im < 1.0000000000000001e-293Initial program 67.3%
Taylor expanded in y.re around inf 82.0%
associate-/l*82.2%
Simplified82.2%
Final simplification79.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4.3e+46) (not (<= y.im 6e+66))) (+ (/ x.im y.im) (/ x.re (/ (pow y.im 2.0) y.re))) (/ (+ (* 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) {
double tmp;
if ((y_46_im <= -4.3e+46) || !(y_46_im <= 6e+66)) {
tmp = (x_46_im / y_46_im) + (x_46_re / (pow(y_46_im, 2.0) / y_46_re));
} else {
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));
}
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+46)) .or. (.not. (y_46im <= 6d+66))) then
tmp = (x_46im / y_46im) + (x_46re / ((y_46im ** 2.0d0) / y_46re))
else
tmp = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_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_im <= -4.3e+46) || !(y_46_im <= 6e+66)) {
tmp = (x_46_im / y_46_im) + (x_46_re / (Math.pow(y_46_im, 2.0) / y_46_re));
} else {
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));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -4.3e+46) or not (y_46_im <= 6e+66): tmp = (x_46_im / y_46_im) + (x_46_re / (math.pow(y_46_im, 2.0) / y_46_re)) else: 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)) 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+46) || !(y_46_im <= 6e+66)) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64((y_46_im ^ 2.0) / y_46_re))); else 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))); 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+46) || ~((y_46_im <= 6e+66))) tmp = (x_46_im / y_46_im) + (x_46_re / ((y_46_im ^ 2.0) / y_46_re)); else 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 tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -4.3e+46], N[Not[LessEqual[y$46$im, 6e+66]], $MachinePrecision]], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(N[Power[y$46$im, 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.3 \cdot 10^{+46} \lor \neg \left(y.im \leq 6 \cdot 10^{+66}\right):\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{\frac{{y.im}^{2}}{y.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\end{array}
\end{array}
if y.im < -4.30000000000000005e46 or 6.00000000000000005e66 < y.im Initial program 41.9%
Taylor expanded in y.re around 0 74.4%
associate-/l*75.7%
Simplified75.7%
if -4.30000000000000005e46 < y.im < 6.00000000000000005e66Initial program 78.1%
Final simplification77.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.8e+115)
(/ x.im y.im)
(if (<= y.im 1.9e+81)
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
(* x.im (/ 1.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 tmp;
if (y_46_im <= -5.8e+115) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.9e+81) {
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 {
tmp = x_46_im * (1.0 / 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 tmp;
if (y_46_im <= -5.8e+115) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.9e+81) {
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 {
tmp = x_46_im * (1.0 / Math.hypot(y_46_re, y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -5.8e+115: tmp = x_46_im / y_46_im elif y_46_im <= 1.9e+81: 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: tmp = x_46_im * (1.0 / math.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 (y_46_im <= -5.8e+115) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 1.9e+81) 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))); else tmp = Float64(x_46_im * Float64(1.0 / 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) tmp = 0.0; if (y_46_im <= -5.8e+115) tmp = x_46_im / y_46_im; elseif (y_46_im <= 1.9e+81) 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 tmp = x_46_im * (1.0 / 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_] := If[LessEqual[y$46$im, -5.8e+115], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.9e+81], 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], N[(x$46$im * N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.8 \cdot 10^{+115}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 1.9 \cdot 10^{+81}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -5.80000000000000009e115Initial program 37.4%
Taylor expanded in y.re around 0 76.0%
if -5.80000000000000009e115 < y.im < 1.9e81Initial program 76.8%
if 1.9e81 < y.im Initial program 34.2%
*-un-lft-identity34.2%
associate-*r/34.2%
fma-def34.2%
add-sqr-sqrt34.3%
times-frac34.3%
fma-def34.3%
hypot-def34.3%
fma-def34.3%
fma-def34.3%
hypot-def64.2%
Applied egg-rr64.2%
Taylor expanded in y.re around 0 72.7%
Final simplification76.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.3e+128)
(* x.im (/ -1.0 (hypot y.re y.im)))
(if (<= y.im 2e+80)
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
(* x.im (/ 1.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 tmp;
if (y_46_im <= -5.3e+128) {
tmp = x_46_im * (-1.0 / hypot(y_46_re, y_46_im));
} else if (y_46_im <= 2e+80) {
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 {
tmp = x_46_im * (1.0 / 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 tmp;
if (y_46_im <= -5.3e+128) {
tmp = x_46_im * (-1.0 / Math.hypot(y_46_re, y_46_im));
} else if (y_46_im <= 2e+80) {
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 {
tmp = x_46_im * (1.0 / Math.hypot(y_46_re, y_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -5.3e+128: tmp = x_46_im * (-1.0 / math.hypot(y_46_re, y_46_im)) elif y_46_im <= 2e+80: 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: tmp = x_46_im * (1.0 / math.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 (y_46_im <= -5.3e+128) tmp = Float64(x_46_im * Float64(-1.0 / hypot(y_46_re, y_46_im))); elseif (y_46_im <= 2e+80) 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))); else tmp = Float64(x_46_im * Float64(1.0 / 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) tmp = 0.0; if (y_46_im <= -5.3e+128) tmp = x_46_im * (-1.0 / hypot(y_46_re, y_46_im)); elseif (y_46_im <= 2e+80) 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 tmp = x_46_im * (1.0 / 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_] := If[LessEqual[y$46$im, -5.3e+128], N[(x$46$im * N[(-1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2e+80], 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], N[(x$46$im * N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.3 \cdot 10^{+128}:\\
\;\;\;\;x.im \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{+80}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;x.im \cdot \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -5.3000000000000002e128Initial program 31.0%
*-un-lft-identity31.0%
associate-*r/31.0%
fma-def31.0%
add-sqr-sqrt31.0%
times-frac31.0%
fma-def31.0%
hypot-def31.0%
fma-def31.0%
fma-def31.0%
hypot-def62.5%
Applied egg-rr62.5%
Taylor expanded in y.im around -inf 75.7%
mul-1-neg75.7%
Simplified75.7%
if -5.3000000000000002e128 < y.im < 2e80Initial program 77.3%
if 2e80 < y.im Initial program 34.2%
*-un-lft-identity34.2%
associate-*r/34.2%
fma-def34.2%
add-sqr-sqrt34.3%
times-frac34.3%
fma-def34.3%
hypot-def34.3%
fma-def34.3%
fma-def34.3%
hypot-def64.2%
Applied egg-rr64.2%
Taylor expanded in y.re around 0 72.7%
Final simplification76.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* x.re y.re) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -1.55e+49)
(/ x.re y.re)
(if (<= y.re -8.8e-32)
(/ x.im y.im)
(if (<= y.re -6e-96)
t_0
(if (<= y.re 1.55e-66)
(/ x.im y.im)
(if (<= y.re 9.4e+39) t_0 (/ x.re y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.55e+49) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -8.8e-32) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= -6e-96) {
tmp = t_0;
} else if (y_46_re <= 1.55e-66) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 9.4e+39) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = (x_46re * y_46re) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46re <= (-1.55d+49)) then
tmp = x_46re / y_46re
else if (y_46re <= (-8.8d-32)) then
tmp = x_46im / y_46im
else if (y_46re <= (-6d-96)) then
tmp = t_0
else if (y_46re <= 1.55d-66) then
tmp = x_46im / y_46im
else if (y_46re <= 9.4d+39) then
tmp = t_0
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 t_0 = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.55e+49) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -8.8e-32) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= -6e-96) {
tmp = t_0;
} else if (y_46_re <= 1.55e-66) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 9.4e+39) {
tmp = t_0;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -1.55e+49: tmp = x_46_re / y_46_re elif y_46_re <= -8.8e-32: tmp = x_46_im / y_46_im elif y_46_re <= -6e-96: tmp = t_0 elif y_46_re <= 1.55e-66: tmp = x_46_im / y_46_im elif y_46_re <= 9.4e+39: tmp = t_0 else: tmp = x_46_re / y_46_re 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_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -1.55e+49) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= -8.8e-32) tmp = Float64(x_46_im / y_46_im); elseif (y_46_re <= -6e-96) tmp = t_0; elseif (y_46_re <= 1.55e-66) tmp = Float64(x_46_im / y_46_im); elseif (y_46_re <= 9.4e+39) tmp = t_0; 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) t_0 = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -1.55e+49) tmp = x_46_re / y_46_re; elseif (y_46_re <= -8.8e-32) tmp = x_46_im / y_46_im; elseif (y_46_re <= -6e-96) tmp = t_0; elseif (y_46_re <= 1.55e-66) tmp = x_46_im / y_46_im; elseif (y_46_re <= 9.4e+39) tmp = t_0; 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_] := Block[{t$95$0 = N[(N[(x$46$re * y$46$re), $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.55e+49], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -8.8e-32], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, -6e-96], t$95$0, If[LessEqual[y$46$re, 1.55e-66], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 9.4e+39], t$95$0, N[(x$46$re / y$46$re), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.55 \cdot 10^{+49}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq -8.8 \cdot 10^{-32}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.re \leq -6 \cdot 10^{-96}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.55 \cdot 10^{-66}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.re \leq 9.4 \cdot 10^{+39}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.re < -1.54999999999999996e49 or 9.3999999999999998e39 < y.re Initial program 52.6%
Taylor expanded in y.re around inf 67.3%
if -1.54999999999999996e49 < y.re < -8.7999999999999999e-32 or -6e-96 < y.re < 1.5499999999999999e-66Initial program 66.4%
Taylor expanded in y.re around 0 71.3%
if -8.7999999999999999e-32 < y.re < -6e-96 or 1.5499999999999999e-66 < y.re < 9.3999999999999998e39Initial program 84.6%
Taylor expanded in x.re around inf 65.9%
*-commutative65.9%
Simplified65.9%
Final simplification69.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.35e+114) (not (<= y.im 3.2e+114))) (/ x.im y.im) (/ (+ (* 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) {
double tmp;
if ((y_46_im <= -1.35e+114) || !(y_46_im <= 3.2e+114)) {
tmp = x_46_im / y_46_im;
} else {
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));
}
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.35d+114)) .or. (.not. (y_46im <= 3.2d+114))) then
tmp = x_46im / y_46im
else
tmp = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_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_im <= -1.35e+114) || !(y_46_im <= 3.2e+114)) {
tmp = x_46_im / y_46_im;
} else {
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));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.35e+114) or not (y_46_im <= 3.2e+114): tmp = x_46_im / y_46_im else: 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)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.35e+114) || !(y_46_im <= 3.2e+114)) tmp = Float64(x_46_im / y_46_im); else 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))); 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.35e+114) || ~((y_46_im <= 3.2e+114))) tmp = x_46_im / y_46_im; else 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 tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.35e+114], N[Not[LessEqual[y$46$im, 3.2e+114]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], 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}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.35 \cdot 10^{+114} \lor \neg \left(y.im \leq 3.2 \cdot 10^{+114}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\end{array}
\end{array}
if y.im < -1.35e114 or 3.2e114 < y.im Initial program 34.0%
Taylor expanded in y.re around 0 76.7%
if -1.35e114 < y.im < 3.2e114Initial program 75.7%
Final simplification76.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.9e+49) (not (<= y.re 1.02e-66))) (/ x.re y.re) (/ x.im y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.9e+49) || !(y_46_re <= 1.02e-66)) {
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_46re <= (-1.9d+49)) .or. (.not. (y_46re <= 1.02d-66))) 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_re <= -1.9e+49) || !(y_46_re <= 1.02e-66)) {
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_re <= -1.9e+49) or not (y_46_re <= 1.02e-66): 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_re <= -1.9e+49) || !(y_46_re <= 1.02e-66)) 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_re <= -1.9e+49) || ~((y_46_re <= 1.02e-66))) 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[Or[LessEqual[y$46$re, -1.9e+49], N[Not[LessEqual[y$46$re, 1.02e-66]], $MachinePrecision]], 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.re \leq -1.9 \cdot 10^{+49} \lor \neg \left(y.re \leq 1.02 \cdot 10^{-66}\right):\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.re < -1.8999999999999999e49 or 1.01999999999999996e-66 < y.re Initial program 58.1%
Taylor expanded in y.re around inf 62.2%
if -1.8999999999999999e49 < y.re < 1.01999999999999996e-66Initial program 68.9%
Taylor expanded in y.re around 0 66.9%
Final simplification64.7%
(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 63.8%
Taylor expanded in y.re around 0 44.8%
Final simplification44.8%
herbie shell --seed 2024040
(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))))