
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re y.re) (* x.im y.im))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 5e+256)
(/ (/ t_0 (hypot y.re y.im)) (hypot y.re y.im))
(+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+256) {
tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
} else {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+256) {
tmp = (t_0 / Math.hypot(y_46_re, y_46_im)) / Math.hypot(y_46_re, y_46_im);
} else {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+256: tmp = (t_0 / math.hypot(y_46_re, y_46_im)) / math.hypot(y_46_re, y_46_im) else: tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 5e+256) tmp = Float64(Float64(t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)); else tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+256) tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im); else tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+256], N[(N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot y.re + x.im \cdot y.im\\
\mathbf{if}\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 5 \cdot 10^{+256}:\\
\;\;\;\;\frac{\frac{t_0}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 5.00000000000000015e256Initial program 74.0%
*-un-lft-identity74.0%
+-commutative74.0%
fma-udef74.0%
add-sqr-sqrt74.0%
times-frac74.0%
fma-udef74.0%
+-commutative74.0%
hypot-def74.0%
fma-def74.1%
fma-udef74.1%
+-commutative74.1%
hypot-def95.2%
Applied egg-rr95.2%
associate-*l/95.3%
*-un-lft-identity95.3%
Applied egg-rr95.3%
fma-def95.3%
Applied egg-rr95.3%
if 5.00000000000000015e256 < (/.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 13.3%
Taylor expanded in y.re around inf 52.5%
associate-/l*56.4%
Simplified56.4%
pow256.4%
*-un-lft-identity56.4%
times-frac64.0%
Applied egg-rr64.0%
Final simplification87.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -3.15e+94)
(* (/ 1.0 y.re) (+ x.re (/ (* x.im y.im) y.re)))
(if (<= y.re -2.75e-36)
t_0
(if (<= y.re 1.15e-148)
(* (/ -1.0 y.im) (- (/ (- x.re) (/ y.im y.re)) x.im))
(if (<= y.re 3.5e+116)
t_0
(/ (+ x.re (* x.im (/ y.im y.re))) (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -3.15e+94) {
tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re));
} else if (y_46_re <= -2.75e-36) {
tmp = t_0;
} else if (y_46_re <= 1.15e-148) {
tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_re <= 3.5e+116) {
tmp = t_0;
} else {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / hypot(y_46_re, y_46_im);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -3.15e+94) {
tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re));
} else if (y_46_re <= -2.75e-36) {
tmp = t_0;
} else if (y_46_re <= 1.15e-148) {
tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_re <= 3.5e+116) {
tmp = t_0;
} else {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / Math.hypot(y_46_re, y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -3.15e+94: tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re)) elif y_46_re <= -2.75e-36: tmp = t_0 elif y_46_re <= 1.15e-148: tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im) elif y_46_re <= 3.5e+116: tmp = t_0 else: tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / math.hypot(y_46_re, y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -3.15e+94) tmp = Float64(Float64(1.0 / y_46_re) * Float64(x_46_re + Float64(Float64(x_46_im * y_46_im) / y_46_re))); elseif (y_46_re <= -2.75e-36) tmp = t_0; elseif (y_46_re <= 1.15e-148) tmp = Float64(Float64(-1.0 / y_46_im) * Float64(Float64(Float64(-x_46_re) / Float64(y_46_im / y_46_re)) - x_46_im)); elseif (y_46_re <= 3.5e+116) tmp = t_0; else tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / hypot(y_46_re, y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -3.15e+94) tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re)); elseif (y_46_re <= -2.75e-36) tmp = t_0; elseif (y_46_re <= 1.15e-148) tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im); elseif (y_46_re <= 3.5e+116) tmp = t_0; else tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / hypot(y_46_re, y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.15e+94], N[(N[(1.0 / y$46$re), $MachinePrecision] * N[(x$46$re + N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -2.75e-36], t$95$0, If[LessEqual[y$46$re, 1.15e-148], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(N[((-x$46$re) / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.5e+116], t$95$0, N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -3.15 \cdot 10^{+94}:\\
\;\;\;\;\frac{1}{y.re} \cdot \left(x.re + \frac{x.im \cdot y.im}{y.re}\right)\\
\mathbf{elif}\;y.re \leq -2.75 \cdot 10^{-36}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.15 \cdot 10^{-148}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(\frac{-x.re}{\frac{y.im}{y.re}} - x.im\right)\\
\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{+116}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -3.15e94Initial program 38.2%
*-un-lft-identity38.2%
+-commutative38.2%
fma-udef38.2%
add-sqr-sqrt38.2%
times-frac38.2%
fma-udef38.2%
+-commutative38.2%
hypot-def38.2%
fma-def38.3%
fma-udef38.3%
+-commutative38.3%
hypot-def72.7%
Applied egg-rr72.7%
Taylor expanded in y.re around inf 16.3%
Taylor expanded in y.re around inf 91.4%
if -3.15e94 < y.re < -2.74999999999999992e-36 or 1.14999999999999999e-148 < y.re < 3.49999999999999997e116Initial program 84.4%
if -2.74999999999999992e-36 < y.re < 1.14999999999999999e-148Initial program 63.1%
*-un-lft-identity63.1%
+-commutative63.1%
fma-udef63.2%
add-sqr-sqrt63.2%
times-frac63.1%
fma-udef63.1%
+-commutative63.1%
hypot-def63.2%
fma-def63.2%
fma-udef63.2%
+-commutative63.2%
hypot-def82.0%
Applied egg-rr82.0%
Taylor expanded in y.im around -inf 48.9%
neg-mul-148.9%
+-commutative48.9%
unsub-neg48.9%
mul-1-neg48.9%
associate-/l*47.6%
distribute-neg-frac47.6%
Simplified47.6%
Taylor expanded in y.im around -inf 83.4%
if 3.49999999999999997e116 < y.re Initial program 22.9%
*-un-lft-identity22.9%
+-commutative22.9%
fma-udef22.9%
add-sqr-sqrt22.9%
times-frac22.9%
fma-udef22.9%
+-commutative22.9%
hypot-def22.9%
fma-def22.9%
fma-udef22.9%
+-commutative22.9%
hypot-def46.4%
Applied egg-rr46.4%
Taylor expanded in y.re around inf 83.8%
expm1-log1p-u78.6%
expm1-udef32.3%
associate-*l/32.3%
*-un-lft-identity32.3%
associate-/l*34.5%
associate-/r/34.5%
Applied egg-rr34.5%
expm1-def86.6%
expm1-log1p93.9%
associate-*l/84.0%
associate-*r/94.0%
Simplified94.0%
Final simplification86.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -1.82e+90)
(/ (- (- x.re) (/ (* x.im y.im) y.re)) (hypot y.re y.im))
(if (<= y.re -3.6e-37)
t_0
(if (<= y.re 1e-148)
(* (/ -1.0 y.im) (- (/ (- x.re) (/ y.im y.re)) x.im))
(if (<= y.re 7e+117)
t_0
(/ (+ x.re (* x.im (/ y.im y.re))) (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.82e+90) {
tmp = (-x_46_re - ((x_46_im * y_46_im) / y_46_re)) / hypot(y_46_re, y_46_im);
} else if (y_46_re <= -3.6e-37) {
tmp = t_0;
} else if (y_46_re <= 1e-148) {
tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_re <= 7e+117) {
tmp = t_0;
} else {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / hypot(y_46_re, y_46_im);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.82e+90) {
tmp = (-x_46_re - ((x_46_im * y_46_im) / y_46_re)) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_re <= -3.6e-37) {
tmp = t_0;
} else if (y_46_re <= 1e-148) {
tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_re <= 7e+117) {
tmp = t_0;
} else {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / Math.hypot(y_46_re, y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -1.82e+90: tmp = (-x_46_re - ((x_46_im * y_46_im) / y_46_re)) / math.hypot(y_46_re, y_46_im) elif y_46_re <= -3.6e-37: tmp = t_0 elif y_46_re <= 1e-148: tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im) elif y_46_re <= 7e+117: tmp = t_0 else: tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / math.hypot(y_46_re, y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -1.82e+90) tmp = Float64(Float64(Float64(-x_46_re) - Float64(Float64(x_46_im * y_46_im) / y_46_re)) / hypot(y_46_re, y_46_im)); elseif (y_46_re <= -3.6e-37) tmp = t_0; elseif (y_46_re <= 1e-148) tmp = Float64(Float64(-1.0 / y_46_im) * Float64(Float64(Float64(-x_46_re) / Float64(y_46_im / y_46_re)) - x_46_im)); elseif (y_46_re <= 7e+117) tmp = t_0; else tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / hypot(y_46_re, y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -1.82e+90) tmp = (-x_46_re - ((x_46_im * y_46_im) / y_46_re)) / hypot(y_46_re, y_46_im); elseif (y_46_re <= -3.6e-37) tmp = t_0; elseif (y_46_re <= 1e-148) tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im); elseif (y_46_re <= 7e+117) tmp = t_0; else tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / hypot(y_46_re, y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.82e+90], N[(N[((-x$46$re) - N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -3.6e-37], t$95$0, If[LessEqual[y$46$re, 1e-148], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(N[((-x$46$re) / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7e+117], t$95$0, N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.82 \cdot 10^{+90}:\\
\;\;\;\;\frac{\left(-x.re\right) - \frac{x.im \cdot y.im}{y.re}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \leq -3.6 \cdot 10^{-37}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 10^{-148}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(\frac{-x.re}{\frac{y.im}{y.re}} - x.im\right)\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{+117}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.81999999999999994e90Initial program 38.2%
*-un-lft-identity38.2%
+-commutative38.2%
fma-udef38.2%
add-sqr-sqrt38.2%
times-frac38.2%
fma-udef38.2%
+-commutative38.2%
hypot-def38.2%
fma-def38.3%
fma-udef38.3%
+-commutative38.3%
hypot-def72.7%
Applied egg-rr72.7%
associate-*l/72.9%
*-un-lft-identity72.9%
Applied egg-rr72.9%
Taylor expanded in y.re around -inf 91.9%
neg-mul-191.9%
+-commutative91.9%
unsub-neg91.9%
associate-*r/91.9%
mul-1-neg91.9%
distribute-rgt-neg-out91.9%
Simplified91.9%
if -1.81999999999999994e90 < y.re < -3.60000000000000007e-37 or 9.99999999999999936e-149 < y.re < 6.99999999999999965e117Initial program 84.4%
if -3.60000000000000007e-37 < y.re < 9.99999999999999936e-149Initial program 63.1%
*-un-lft-identity63.1%
+-commutative63.1%
fma-udef63.2%
add-sqr-sqrt63.2%
times-frac63.1%
fma-udef63.1%
+-commutative63.1%
hypot-def63.2%
fma-def63.2%
fma-udef63.2%
+-commutative63.2%
hypot-def82.0%
Applied egg-rr82.0%
Taylor expanded in y.im around -inf 48.9%
neg-mul-148.9%
+-commutative48.9%
unsub-neg48.9%
mul-1-neg48.9%
associate-/l*47.6%
distribute-neg-frac47.6%
Simplified47.6%
Taylor expanded in y.im around -inf 83.4%
if 6.99999999999999965e117 < y.re Initial program 22.9%
*-un-lft-identity22.9%
+-commutative22.9%
fma-udef22.9%
add-sqr-sqrt22.9%
times-frac22.9%
fma-udef22.9%
+-commutative22.9%
hypot-def22.9%
fma-def22.9%
fma-udef22.9%
+-commutative22.9%
hypot-def46.4%
Applied egg-rr46.4%
Taylor expanded in y.re around inf 83.8%
expm1-log1p-u78.6%
expm1-udef32.3%
associate-*l/32.3%
*-un-lft-identity32.3%
associate-/l*34.5%
associate-/r/34.5%
Applied egg-rr34.5%
expm1-def86.6%
expm1-log1p93.9%
associate-*l/84.0%
associate-*r/94.0%
Simplified94.0%
Final simplification87.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -1.3e+94)
(* (/ 1.0 y.re) (+ x.re (/ (* x.im y.im) y.re)))
(if (<= y.re -3.6e-37)
t_0
(if (<= y.re 3.3e-149)
(* (/ -1.0 y.im) (- (/ (- x.re) (/ y.im y.re)) x.im))
(if (<= y.re 3.1e+114)
t_0
(+ (/ x.re y.re) (/ x.im (* y.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_re <= -1.3e+94) {
tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re));
} else if (y_46_re <= -3.6e-37) {
tmp = t_0;
} else if (y_46_re <= 3.3e-149) {
tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_re <= 3.1e+114) {
tmp = t_0;
} else {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46re <= (-1.3d+94)) then
tmp = (1.0d0 / y_46re) * (x_46re + ((x_46im * y_46im) / y_46re))
else if (y_46re <= (-3.6d-37)) then
tmp = t_0
else if (y_46re <= 3.3d-149) then
tmp = ((-1.0d0) / y_46im) * ((-x_46re / (y_46im / y_46re)) - x_46im)
else if (y_46re <= 3.1d+114) then
tmp = t_0
else
tmp = (x_46re / y_46re) + (x_46im / (y_46re * (y_46re / y_46im)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.3e+94) {
tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re));
} else if (y_46_re <= -3.6e-37) {
tmp = t_0;
} else if (y_46_re <= 3.3e-149) {
tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_re <= 3.1e+114) {
tmp = t_0;
} else {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_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_re <= -1.3e+94: tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re)) elif y_46_re <= -3.6e-37: tmp = t_0 elif y_46_re <= 3.3e-149: tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im) elif y_46_re <= 3.1e+114: tmp = t_0 else: tmp = (x_46_re / y_46_re) + (x_46_im / (y_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_re <= -1.3e+94) tmp = Float64(Float64(1.0 / y_46_re) * Float64(x_46_re + Float64(Float64(x_46_im * y_46_im) / y_46_re))); elseif (y_46_re <= -3.6e-37) tmp = t_0; elseif (y_46_re <= 3.3e-149) tmp = Float64(Float64(-1.0 / y_46_im) * Float64(Float64(Float64(-x_46_re) / Float64(y_46_im / y_46_re)) - x_46_im)); elseif (y_46_re <= 3.1e+114) tmp = t_0; else tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -1.3e+94) tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re)); elseif (y_46_re <= -3.6e-37) tmp = t_0; elseif (y_46_re <= 3.3e-149) tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_46_im); elseif (y_46_re <= 3.1e+114) tmp = t_0; else tmp = (x_46_re / y_46_re) + (x_46_im / (y_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$re, -1.3e+94], N[(N[(1.0 / y$46$re), $MachinePrecision] * N[(x$46$re + N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -3.6e-37], t$95$0, If[LessEqual[y$46$re, 3.3e-149], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(N[((-x$46$re) / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 3.1e+114], t$95$0, N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.3 \cdot 10^{+94}:\\
\;\;\;\;\frac{1}{y.re} \cdot \left(x.re + \frac{x.im \cdot y.im}{y.re}\right)\\
\mathbf{elif}\;y.re \leq -3.6 \cdot 10^{-37}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 3.3 \cdot 10^{-149}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(\frac{-x.re}{\frac{y.im}{y.re}} - x.im\right)\\
\mathbf{elif}\;y.re \leq 3.1 \cdot 10^{+114}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\end{array}
\end{array}
if y.re < -1.3e94Initial program 38.2%
*-un-lft-identity38.2%
+-commutative38.2%
fma-udef38.2%
add-sqr-sqrt38.2%
times-frac38.2%
fma-udef38.2%
+-commutative38.2%
hypot-def38.2%
fma-def38.3%
fma-udef38.3%
+-commutative38.3%
hypot-def72.7%
Applied egg-rr72.7%
Taylor expanded in y.re around inf 16.3%
Taylor expanded in y.re around inf 91.4%
if -1.3e94 < y.re < -3.60000000000000007e-37 or 3.30000000000000017e-149 < y.re < 3.1e114Initial program 84.4%
if -3.60000000000000007e-37 < y.re < 3.30000000000000017e-149Initial program 63.1%
*-un-lft-identity63.1%
+-commutative63.1%
fma-udef63.2%
add-sqr-sqrt63.2%
times-frac63.1%
fma-udef63.1%
+-commutative63.1%
hypot-def63.2%
fma-def63.2%
fma-udef63.2%
+-commutative63.2%
hypot-def82.0%
Applied egg-rr82.0%
Taylor expanded in y.im around -inf 48.9%
neg-mul-148.9%
+-commutative48.9%
unsub-neg48.9%
mul-1-neg48.9%
associate-/l*47.6%
distribute-neg-frac47.6%
Simplified47.6%
Taylor expanded in y.im around -inf 83.4%
if 3.1e114 < y.re Initial program 22.9%
Taylor expanded in y.re around inf 74.8%
associate-/l*77.3%
Simplified77.3%
pow277.3%
*-un-lft-identity77.3%
times-frac83.1%
Applied egg-rr83.1%
Final simplification84.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.9e-15) (not (<= y.re 3300000000.0))) (* (/ 1.0 y.re) (+ x.re (/ (* x.im y.im) y.re))) (* (/ -1.0 y.im) (- (/ (- x.re) (/ y.im y.re)) x.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-15) || !(y_46_re <= 3300000000.0)) {
tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re));
} else {
tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_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-15)) .or. (.not. (y_46re <= 3300000000.0d0))) then
tmp = (1.0d0 / y_46re) * (x_46re + ((x_46im * y_46im) / y_46re))
else
tmp = ((-1.0d0) / y_46im) * ((-x_46re / (y_46im / y_46re)) - x_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-15) || !(y_46_re <= 3300000000.0)) {
tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re));
} else {
tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_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-15) or not (y_46_re <= 3300000000.0): tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re)) else: tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_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-15) || !(y_46_re <= 3300000000.0)) tmp = Float64(Float64(1.0 / y_46_re) * Float64(x_46_re + Float64(Float64(x_46_im * y_46_im) / y_46_re))); else tmp = Float64(Float64(-1.0 / y_46_im) * Float64(Float64(Float64(-x_46_re) / Float64(y_46_im / y_46_re)) - x_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-15) || ~((y_46_re <= 3300000000.0))) tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re)); else tmp = (-1.0 / y_46_im) * ((-x_46_re / (y_46_im / y_46_re)) - x_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-15], N[Not[LessEqual[y$46$re, 3300000000.0]], $MachinePrecision]], N[(N[(1.0 / y$46$re), $MachinePrecision] * N[(x$46$re + N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(N[((-x$46$re) / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.9 \cdot 10^{-15} \lor \neg \left(y.re \leq 3300000000\right):\\
\;\;\;\;\frac{1}{y.re} \cdot \left(x.re + \frac{x.im \cdot y.im}{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(\frac{-x.re}{\frac{y.im}{y.re}} - x.im\right)\\
\end{array}
\end{array}
if y.re < -1.9000000000000001e-15 or 3.3e9 < y.re Initial program 49.3%
*-un-lft-identity49.3%
+-commutative49.3%
fma-udef49.3%
add-sqr-sqrt49.3%
times-frac49.4%
fma-udef49.4%
+-commutative49.4%
hypot-def49.4%
fma-def49.4%
fma-udef49.4%
+-commutative49.4%
hypot-def69.7%
Applied egg-rr69.7%
Taylor expanded in y.re around inf 45.7%
Taylor expanded in y.re around inf 78.5%
if -1.9000000000000001e-15 < y.re < 3.3e9Initial program 70.6%
*-un-lft-identity70.6%
+-commutative70.6%
fma-udef70.7%
add-sqr-sqrt70.6%
times-frac70.6%
fma-udef70.6%
+-commutative70.6%
hypot-def70.7%
fma-def70.7%
fma-udef70.7%
+-commutative70.7%
hypot-def85.2%
Applied egg-rr85.2%
Taylor expanded in y.im around -inf 51.2%
neg-mul-151.2%
+-commutative51.2%
unsub-neg51.2%
mul-1-neg51.2%
associate-/l*50.3%
distribute-neg-frac50.3%
Simplified50.3%
Taylor expanded in y.im around -inf 79.9%
Final simplification79.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -185000000.0) (not (<= y.im 1.16e+88))) (/ x.im y.im) (* (/ 1.0 y.re) (+ x.re (/ (* x.im y.im) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -185000000.0) || !(y_46_im <= 1.16e+88)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-185000000.0d0)) .or. (.not. (y_46im <= 1.16d+88))) then
tmp = x_46im / y_46im
else
tmp = (1.0d0 / y_46re) * (x_46re + ((x_46im * y_46im) / y_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -185000000.0) || !(y_46_im <= 1.16e+88)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -185000000.0) or not (y_46_im <= 1.16e+88): tmp = x_46_im / y_46_im else: tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -185000000.0) || !(y_46_im <= 1.16e+88)) tmp = Float64(x_46_im / y_46_im); else tmp = Float64(Float64(1.0 / y_46_re) * Float64(x_46_re + Float64(Float64(x_46_im * y_46_im) / y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -185000000.0) || ~((y_46_im <= 1.16e+88))) tmp = x_46_im / y_46_im; else tmp = (1.0 / y_46_re) * (x_46_re + ((x_46_im * y_46_im) / y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -185000000.0], N[Not[LessEqual[y$46$im, 1.16e+88]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], N[(N[(1.0 / y$46$re), $MachinePrecision] * N[(x$46$re + N[(N[(x$46$im * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -185000000 \lor \neg \left(y.im \leq 1.16 \cdot 10^{+88}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y.re} \cdot \left(x.re + \frac{x.im \cdot y.im}{y.re}\right)\\
\end{array}
\end{array}
if y.im < -1.85e8 or 1.1599999999999999e88 < y.im Initial program 44.3%
Taylor expanded in y.re around 0 62.0%
if -1.85e8 < y.im < 1.1599999999999999e88Initial program 69.6%
*-un-lft-identity69.6%
+-commutative69.6%
fma-udef69.6%
add-sqr-sqrt69.6%
times-frac69.6%
fma-udef69.6%
+-commutative69.6%
hypot-def69.6%
fma-def69.7%
fma-udef69.7%
+-commutative69.7%
hypot-def84.4%
Applied egg-rr84.4%
Taylor expanded in y.re around inf 47.1%
Taylor expanded in y.re around inf 80.8%
Final simplification73.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -95000.0) (not (<= y.re 4200000.0))) (/ x.re y.re) (/ x.im y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -95000.0) || !(y_46_re <= 4200000.0)) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-95000.0d0)) .or. (.not. (y_46re <= 4200000.0d0))) then
tmp = x_46re / y_46re
else
tmp = x_46im / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -95000.0) || !(y_46_re <= 4200000.0)) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -95000.0) or not (y_46_re <= 4200000.0): tmp = x_46_re / y_46_re else: tmp = x_46_im / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -95000.0) || !(y_46_re <= 4200000.0)) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(x_46_im / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -95000.0) || ~((y_46_re <= 4200000.0))) tmp = x_46_re / y_46_re; else tmp = x_46_im / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -95000.0], N[Not[LessEqual[y$46$re, 4200000.0]], $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 -95000 \lor \neg \left(y.re \leq 4200000\right):\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.re < -95000 or 4.2e6 < y.re Initial program 48.6%
Taylor expanded in y.re around inf 67.1%
if -95000 < y.re < 4.2e6Initial program 70.8%
Taylor expanded in y.re around 0 61.8%
Final simplification64.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 3.4e+171) (/ x.im y.im) (/ x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 3.4e+171) {
tmp = x_46_im / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= 3.4d+171) then
tmp = x_46im / y_46im
else
tmp = x_46im / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= 3.4e+171) {
tmp = x_46_im / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= 3.4e+171: tmp = x_46_im / y_46_im else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= 3.4e+171) tmp = Float64(x_46_im / y_46_im); else tmp = Float64(x_46_im / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= 3.4e+171) tmp = x_46_im / y_46_im; else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, 3.4e+171], N[(x$46$im / y$46$im), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq 3.4 \cdot 10^{+171}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < 3.4000000000000001e171Initial program 65.9%
Taylor expanded in y.re around 0 42.6%
if 3.4000000000000001e171 < y.re Initial program 21.3%
*-un-lft-identity21.3%
+-commutative21.3%
fma-udef21.3%
add-sqr-sqrt21.3%
times-frac21.3%
fma-udef21.3%
+-commutative21.3%
hypot-def21.3%
fma-def21.3%
fma-udef21.3%
+-commutative21.3%
hypot-def51.2%
Applied egg-rr51.2%
Taylor expanded in y.re around inf 84.2%
Taylor expanded in y.re around 0 18.5%
Final simplification39.0%
(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 59.3%
Taylor expanded in y.re around 0 37.3%
Final simplification37.3%
herbie shell --seed 2023321
(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))))