
(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 10 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)))
1e+287)
(*
(/ 1.0 (hypot y.re y.im))
(/ (fma x.re y.re (* x.im y.im)) (hypot y.re y.im)))
(* (/ -1.0 y.re) (- (- x.re) (/ x.im (/ y.re y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+287) {
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 = (-1.0 / y_46_re) * (-x_46_re - (x_46_im / (y_46_re / y_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 1e+287) 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(Float64(-1.0 / y_46_re) * Float64(Float64(-x_46_re) - Float64(x_46_im / Float64(y_46_re / y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+287], 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[(N[(-1.0 / y$46$re), $MachinePrecision] * N[((-x$46$re) - N[(x$46$im / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leq 10^{+287}:\\
\;\;\;\;\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{-1}{y.re} \cdot \left(\left(-x.re\right) - \frac{x.im}{\frac{y.re}{y.im}}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 1.0000000000000001e287Initial program 79.7%
*-un-lft-identity79.7%
add-sqr-sqrt79.7%
times-frac79.7%
hypot-def79.7%
fma-def79.7%
hypot-def98.1%
Applied egg-rr98.1%
if 1.0000000000000001e287 < (/.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 15.2%
*-un-lft-identity15.2%
add-sqr-sqrt15.2%
times-frac15.2%
hypot-def15.2%
fma-def15.2%
hypot-def22.1%
Applied egg-rr22.1%
Taylor expanded in y.re around -inf 33.3%
neg-mul-133.3%
+-commutative33.3%
unsub-neg33.3%
mul-1-neg33.3%
associate-/l*35.1%
distribute-neg-frac35.1%
Simplified35.1%
Taylor expanded in y.re around -inf 71.5%
Final simplification92.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 (* (/ -1.0 y.re) (- (* y.im (/ (- x.im) y.re)) x.re))))
(if (<= y.re -7.5e+82)
t_1
(if (<= y.re -1.15e-146)
t_0
(if (<= y.re 3.35e-87)
(+ (/ x.im y.im) (* y.re (/ x.re (pow y.im 2.0))))
(if (<= y.re 7.2e+47) 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 = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re);
double tmp;
if (y_46_re <= -7.5e+82) {
tmp = t_1;
} else if (y_46_re <= -1.15e-146) {
tmp = t_0;
} else if (y_46_re <= 3.35e-87) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / pow(y_46_im, 2.0)));
} else if (y_46_re <= 7.2e+47) {
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 = ((-1.0d0) / y_46re) * ((y_46im * (-x_46im / y_46re)) - x_46re)
if (y_46re <= (-7.5d+82)) then
tmp = t_1
else if (y_46re <= (-1.15d-146)) then
tmp = t_0
else if (y_46re <= 3.35d-87) then
tmp = (x_46im / y_46im) + (y_46re * (x_46re / (y_46im ** 2.0d0)))
else if (y_46re <= 7.2d+47) 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 = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re);
double tmp;
if (y_46_re <= -7.5e+82) {
tmp = t_1;
} else if (y_46_re <= -1.15e-146) {
tmp = t_0;
} else if (y_46_re <= 3.35e-87) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / Math.pow(y_46_im, 2.0)));
} else if (y_46_re <= 7.2e+47) {
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 = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re) tmp = 0 if y_46_re <= -7.5e+82: tmp = t_1 elif y_46_re <= -1.15e-146: tmp = t_0 elif y_46_re <= 3.35e-87: tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / math.pow(y_46_im, 2.0))) elif y_46_re <= 7.2e+47: 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(-1.0 / y_46_re) * Float64(Float64(y_46_im * Float64(Float64(-x_46_im) / y_46_re)) - x_46_re)) tmp = 0.0 if (y_46_re <= -7.5e+82) tmp = t_1; elseif (y_46_re <= -1.15e-146) tmp = t_0; elseif (y_46_re <= 3.35e-87) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(y_46_re * Float64(x_46_re / (y_46_im ^ 2.0)))); elseif (y_46_re <= 7.2e+47) 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 = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re); tmp = 0.0; if (y_46_re <= -7.5e+82) tmp = t_1; elseif (y_46_re <= -1.15e-146) tmp = t_0; elseif (y_46_re <= 3.35e-87) tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / (y_46_im ^ 2.0))); elseif (y_46_re <= 7.2e+47) 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[(-1.0 / y$46$re), $MachinePrecision] * N[(N[(y$46$im * N[((-x$46$im) / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.5e+82], t$95$1, If[LessEqual[y$46$re, -1.15e-146], t$95$0, If[LessEqual[y$46$re, 3.35e-87], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(y$46$re * N[(x$46$re / N[Power[y$46$im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.2e+47], 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{-1}{y.re} \cdot \left(y.im \cdot \frac{-x.im}{y.re} - x.re\right)\\
\mathbf{if}\;y.re \leq -7.5 \cdot 10^{+82}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq -1.15 \cdot 10^{-146}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 3.35 \cdot 10^{-87}:\\
\;\;\;\;\frac{x.im}{y.im} + y.re \cdot \frac{x.re}{{y.im}^{2}}\\
\mathbf{elif}\;y.re \leq 7.2 \cdot 10^{+47}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.re < -7.4999999999999999e82 or 7.20000000000000015e47 < y.re Initial program 45.0%
*-un-lft-identity45.0%
add-sqr-sqrt45.0%
times-frac44.9%
hypot-def44.9%
fma-def44.9%
hypot-def69.3%
Applied egg-rr69.3%
Taylor expanded in y.re around -inf 48.8%
neg-mul-148.8%
+-commutative48.8%
unsub-neg48.8%
mul-1-neg48.8%
associate-/l*48.9%
distribute-neg-frac48.9%
Simplified48.9%
Taylor expanded in y.re around -inf 90.5%
Taylor expanded in x.im around 0 88.9%
mul-1-neg88.9%
associate-*l/92.2%
distribute-rgt-neg-out92.2%
Simplified92.2%
if -7.4999999999999999e82 < y.re < -1.15e-146 or 3.35e-87 < y.re < 7.20000000000000015e47Initial program 86.7%
if -1.15e-146 < y.re < 3.35e-87Initial program 73.5%
Taylor expanded in y.re around 0 88.7%
associate-/l*86.4%
associate-/r/86.4%
Simplified86.4%
Final simplification88.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.25e+66)
(* (+ x.re (* y.im (/ x.im y.re))) (/ -1.0 (hypot y.re y.im)))
(if (<= y.re -8.8e-147)
t_0
(if (<= y.re 3.8e-86)
(+ (/ x.im y.im) (* y.re (/ x.re (pow y.im 2.0))))
(if (<= y.re 7.2e+47)
t_0
(* (/ -1.0 y.re) (- (* y.im (/ (- x.im) y.re)) x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.25e+66) {
tmp = (x_46_re + (y_46_im * (x_46_im / y_46_re))) * (-1.0 / hypot(y_46_re, y_46_im));
} else if (y_46_re <= -8.8e-147) {
tmp = t_0;
} else if (y_46_re <= 3.8e-86) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / pow(y_46_im, 2.0)));
} else if (y_46_re <= 7.2e+47) {
tmp = t_0;
} else {
tmp = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.25e+66) {
tmp = (x_46_re + (y_46_im * (x_46_im / y_46_re))) * (-1.0 / Math.hypot(y_46_re, y_46_im));
} else if (y_46_re <= -8.8e-147) {
tmp = t_0;
} else if (y_46_re <= 3.8e-86) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / Math.pow(y_46_im, 2.0)));
} else if (y_46_re <= 7.2e+47) {
tmp = t_0;
} else {
tmp = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -1.25e+66: tmp = (x_46_re + (y_46_im * (x_46_im / y_46_re))) * (-1.0 / math.hypot(y_46_re, y_46_im)) elif y_46_re <= -8.8e-147: tmp = t_0 elif y_46_re <= 3.8e-86: tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / math.pow(y_46_im, 2.0))) elif y_46_re <= 7.2e+47: tmp = t_0 else: tmp = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -1.25e+66) tmp = Float64(Float64(x_46_re + Float64(y_46_im * Float64(x_46_im / y_46_re))) * Float64(-1.0 / hypot(y_46_re, y_46_im))); elseif (y_46_re <= -8.8e-147) tmp = t_0; elseif (y_46_re <= 3.8e-86) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(y_46_re * Float64(x_46_re / (y_46_im ^ 2.0)))); elseif (y_46_re <= 7.2e+47) tmp = t_0; else tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(y_46_im * Float64(Float64(-x_46_im) / y_46_re)) - x_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -1.25e+66) tmp = (x_46_re + (y_46_im * (x_46_im / y_46_re))) * (-1.0 / hypot(y_46_re, y_46_im)); elseif (y_46_re <= -8.8e-147) tmp = t_0; elseif (y_46_re <= 3.8e-86) tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / (y_46_im ^ 2.0))); elseif (y_46_re <= 7.2e+47) tmp = t_0; else tmp = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.25e+66], N[(N[(x$46$re + N[(y$46$im * N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -8.8e-147], t$95$0, If[LessEqual[y$46$re, 3.8e-86], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(y$46$re * N[(x$46$re / N[Power[y$46$im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.2e+47], t$95$0, N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[(N[(y$46$im * N[((-x$46$im) / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{+66}:\\
\;\;\;\;\left(x.re + y.im \cdot \frac{x.im}{y.re}\right) \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \leq -8.8 \cdot 10^{-147}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 3.8 \cdot 10^{-86}:\\
\;\;\;\;\frac{x.im}{y.im} + y.re \cdot \frac{x.re}{{y.im}^{2}}\\
\mathbf{elif}\;y.re \leq 7.2 \cdot 10^{+47}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(y.im \cdot \frac{-x.im}{y.re} - x.re\right)\\
\end{array}
\end{array}
if y.re < -1.24999999999999998e66Initial program 43.4%
*-un-lft-identity43.4%
add-sqr-sqrt43.4%
times-frac43.4%
hypot-def43.4%
fma-def43.4%
hypot-def65.5%
Applied egg-rr65.5%
Taylor expanded in y.re around -inf 86.3%
neg-mul-186.3%
+-commutative86.3%
unsub-neg86.3%
mul-1-neg86.3%
associate-/l*86.4%
distribute-neg-frac86.4%
Simplified86.4%
Taylor expanded in x.im around 0 86.3%
mul-1-neg86.1%
associate-*l/88.1%
distribute-rgt-neg-out88.1%
Simplified88.3%
if -1.24999999999999998e66 < y.re < -8.8000000000000004e-147 or 3.8e-86 < y.re < 7.20000000000000015e47Initial program 87.3%
if -8.8000000000000004e-147 < y.re < 3.8e-86Initial program 73.5%
Taylor expanded in y.re around 0 88.7%
associate-/l*86.4%
associate-/r/86.4%
Simplified86.4%
if 7.20000000000000015e47 < y.re Initial program 48.3%
*-un-lft-identity48.3%
add-sqr-sqrt48.3%
times-frac48.2%
hypot-def48.2%
fma-def48.2%
hypot-def72.7%
Applied egg-rr72.7%
Taylor expanded in y.re around -inf 21.1%
neg-mul-121.1%
+-commutative21.1%
unsub-neg21.1%
mul-1-neg21.1%
associate-/l*21.2%
distribute-neg-frac21.2%
Simplified21.2%
Taylor expanded in y.re around -inf 92.8%
Taylor expanded in x.im around 0 90.2%
mul-1-neg90.2%
associate-*l/94.3%
distribute-rgt-neg-out94.3%
Simplified94.3%
Final simplification88.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))))
(t_1 (* (/ -1.0 y.re) (- (* y.im (/ (- x.im) y.re)) x.re))))
(if (<= y.re -7.2e+81)
t_1
(if (<= y.re -3e-257)
t_0
(if (<= y.re 7e-105)
(/ x.im (+ y.im (* y.re (* y.re (/ 1.0 y.im)))))
(if (<= y.re 7.2e+47) 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 = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re);
double tmp;
if (y_46_re <= -7.2e+81) {
tmp = t_1;
} else if (y_46_re <= -3e-257) {
tmp = t_0;
} else if (y_46_re <= 7e-105) {
tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im))));
} else if (y_46_re <= 7.2e+47) {
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 = ((-1.0d0) / y_46re) * ((y_46im * (-x_46im / y_46re)) - x_46re)
if (y_46re <= (-7.2d+81)) then
tmp = t_1
else if (y_46re <= (-3d-257)) then
tmp = t_0
else if (y_46re <= 7d-105) then
tmp = x_46im / (y_46im + (y_46re * (y_46re * (1.0d0 / y_46im))))
else if (y_46re <= 7.2d+47) 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 = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re);
double tmp;
if (y_46_re <= -7.2e+81) {
tmp = t_1;
} else if (y_46_re <= -3e-257) {
tmp = t_0;
} else if (y_46_re <= 7e-105) {
tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im))));
} else if (y_46_re <= 7.2e+47) {
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 = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re) tmp = 0 if y_46_re <= -7.2e+81: tmp = t_1 elif y_46_re <= -3e-257: tmp = t_0 elif y_46_re <= 7e-105: tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im)))) elif y_46_re <= 7.2e+47: 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(-1.0 / y_46_re) * Float64(Float64(y_46_im * Float64(Float64(-x_46_im) / y_46_re)) - x_46_re)) tmp = 0.0 if (y_46_re <= -7.2e+81) tmp = t_1; elseif (y_46_re <= -3e-257) tmp = t_0; elseif (y_46_re <= 7e-105) tmp = Float64(x_46_im / Float64(y_46_im + Float64(y_46_re * Float64(y_46_re * Float64(1.0 / y_46_im))))); elseif (y_46_re <= 7.2e+47) 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 = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re); tmp = 0.0; if (y_46_re <= -7.2e+81) tmp = t_1; elseif (y_46_re <= -3e-257) tmp = t_0; elseif (y_46_re <= 7e-105) tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im)))); elseif (y_46_re <= 7.2e+47) 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[(-1.0 / y$46$re), $MachinePrecision] * N[(N[(y$46$im * N[((-x$46$im) / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.2e+81], t$95$1, If[LessEqual[y$46$re, -3e-257], t$95$0, If[LessEqual[y$46$re, 7e-105], N[(x$46$im / N[(y$46$im + N[(y$46$re * N[(y$46$re * N[(1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.2e+47], 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{-1}{y.re} \cdot \left(y.im \cdot \frac{-x.im}{y.re} - x.re\right)\\
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{+81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq -3 \cdot 10^{-257}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 7 \cdot 10^{-105}:\\
\;\;\;\;\frac{x.im}{y.im + y.re \cdot \left(y.re \cdot \frac{1}{y.im}\right)}\\
\mathbf{elif}\;y.re \leq 7.2 \cdot 10^{+47}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.re < -7.20000000000000011e81 or 7.20000000000000015e47 < y.re Initial program 45.0%
*-un-lft-identity45.0%
add-sqr-sqrt45.0%
times-frac44.9%
hypot-def44.9%
fma-def44.9%
hypot-def69.3%
Applied egg-rr69.3%
Taylor expanded in y.re around -inf 48.8%
neg-mul-148.8%
+-commutative48.8%
unsub-neg48.8%
mul-1-neg48.8%
associate-/l*48.9%
distribute-neg-frac48.9%
Simplified48.9%
Taylor expanded in y.re around -inf 90.5%
Taylor expanded in x.im around 0 88.9%
mul-1-neg88.9%
associate-*l/92.2%
distribute-rgt-neg-out92.2%
Simplified92.2%
if -7.20000000000000011e81 < y.re < -2.9999999999999999e-257 or 7e-105 < y.re < 7.20000000000000015e47Initial program 85.3%
if -2.9999999999999999e-257 < y.re < 7e-105Initial program 69.7%
*-un-lft-identity69.7%
add-sqr-sqrt69.7%
times-frac69.8%
hypot-def69.8%
fma-def69.8%
hypot-def86.6%
Applied egg-rr86.6%
Taylor expanded in x.re around 0 60.1%
associate-/l*60.8%
+-commutative60.8%
unpow260.8%
fma-def60.8%
Simplified60.8%
Taylor expanded in y.re around 0 82.7%
pow282.7%
div-inv82.7%
associate-*l*84.9%
Applied egg-rr84.9%
Final simplification88.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -7.6e+28) (not (<= y.im 4.3e+30))) (/ x.im (+ y.im (* y.re (* y.re (/ 1.0 y.im))))) (* (/ -1.0 y.re) (- (* y.im (/ (- x.im) y.re)) x.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 <= -7.6e+28) || !(y_46_im <= 4.3e+30)) {
tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im))));
} else {
tmp = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_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 <= (-7.6d+28)) .or. (.not. (y_46im <= 4.3d+30))) then
tmp = x_46im / (y_46im + (y_46re * (y_46re * (1.0d0 / y_46im))))
else
tmp = ((-1.0d0) / y_46re) * ((y_46im * (-x_46im / y_46re)) - x_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 <= -7.6e+28) || !(y_46_im <= 4.3e+30)) {
tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im))));
} else {
tmp = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -7.6e+28) or not (y_46_im <= 4.3e+30): tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im)))) else: tmp = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_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 <= -7.6e+28) || !(y_46_im <= 4.3e+30)) tmp = Float64(x_46_im / Float64(y_46_im + Float64(y_46_re * Float64(y_46_re * Float64(1.0 / y_46_im))))); else tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(y_46_im * Float64(Float64(-x_46_im) / y_46_re)) - x_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 <= -7.6e+28) || ~((y_46_im <= 4.3e+30))) tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im)))); else tmp = (-1.0 / y_46_re) * ((y_46_im * (-x_46_im / y_46_re)) - x_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, -7.6e+28], N[Not[LessEqual[y$46$im, 4.3e+30]], $MachinePrecision]], N[(x$46$im / N[(y$46$im + N[(y$46$re * N[(y$46$re * N[(1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[(N[(y$46$im * N[((-x$46$im) / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -7.6 \cdot 10^{+28} \lor \neg \left(y.im \leq 4.3 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{x.im}{y.im + y.re \cdot \left(y.re \cdot \frac{1}{y.im}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(y.im \cdot \frac{-x.im}{y.re} - x.re\right)\\
\end{array}
\end{array}
if y.im < -7.5999999999999998e28 or 4.3e30 < y.im Initial program 58.2%
*-un-lft-identity58.2%
add-sqr-sqrt58.2%
times-frac58.2%
hypot-def58.2%
fma-def58.2%
hypot-def77.8%
Applied egg-rr77.8%
Taylor expanded in x.re around 0 50.0%
associate-/l*52.4%
+-commutative52.4%
unpow252.4%
fma-def52.4%
Simplified52.4%
Taylor expanded in y.re around 0 75.2%
pow275.2%
div-inv75.2%
associate-*l*77.8%
Applied egg-rr77.8%
if -7.5999999999999998e28 < y.im < 4.3e30Initial program 71.2%
*-un-lft-identity71.2%
add-sqr-sqrt71.2%
times-frac71.2%
hypot-def71.2%
fma-def71.2%
hypot-def84.3%
Applied egg-rr84.3%
Taylor expanded in y.re around -inf 47.6%
neg-mul-147.6%
+-commutative47.6%
unsub-neg47.6%
mul-1-neg47.6%
associate-/l*46.9%
distribute-neg-frac46.9%
Simplified46.9%
Taylor expanded in y.re around -inf 86.4%
Taylor expanded in x.im around 0 87.6%
mul-1-neg87.6%
associate-*l/84.4%
distribute-rgt-neg-out84.4%
Simplified84.4%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.8e+27) (not (<= y.im 6.5e+28))) (/ x.im (+ y.im (* y.re (* y.re (/ 1.0 y.im))))) (* (/ -1.0 y.re) (- (- x.re) (/ x.im (/ 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 <= -3.8e+27) || !(y_46_im <= 6.5e+28)) {
tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im))));
} else {
tmp = (-1.0 / y_46_re) * (-x_46_re - (x_46_im / (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) :: tmp
if ((y_46im <= (-3.8d+27)) .or. (.not. (y_46im <= 6.5d+28))) then
tmp = x_46im / (y_46im + (y_46re * (y_46re * (1.0d0 / y_46im))))
else
tmp = ((-1.0d0) / y_46re) * (-x_46re - (x_46im / (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 tmp;
if ((y_46_im <= -3.8e+27) || !(y_46_im <= 6.5e+28)) {
tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im))));
} else {
tmp = (-1.0 / y_46_re) * (-x_46_re - (x_46_im / (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 <= -3.8e+27) or not (y_46_im <= 6.5e+28): tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im)))) else: tmp = (-1.0 / y_46_re) * (-x_46_re - (x_46_im / (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 <= -3.8e+27) || !(y_46_im <= 6.5e+28)) tmp = Float64(x_46_im / Float64(y_46_im + Float64(y_46_re * Float64(y_46_re * Float64(1.0 / y_46_im))))); else tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(-x_46_re) - Float64(x_46_im / 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) tmp = 0.0; if ((y_46_im <= -3.8e+27) || ~((y_46_im <= 6.5e+28))) tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / y_46_im)))); else tmp = (-1.0 / y_46_re) * (-x_46_re - (x_46_im / (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[Or[LessEqual[y$46$im, -3.8e+27], N[Not[LessEqual[y$46$im, 6.5e+28]], $MachinePrecision]], N[(x$46$im / N[(y$46$im + N[(y$46$re * N[(y$46$re * N[(1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[((-x$46$re) - N[(x$46$im / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.8 \cdot 10^{+27} \lor \neg \left(y.im \leq 6.5 \cdot 10^{+28}\right):\\
\;\;\;\;\frac{x.im}{y.im + y.re \cdot \left(y.re \cdot \frac{1}{y.im}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(\left(-x.re\right) - \frac{x.im}{\frac{y.re}{y.im}}\right)\\
\end{array}
\end{array}
if y.im < -3.80000000000000022e27 or 6.5000000000000001e28 < y.im Initial program 58.2%
*-un-lft-identity58.2%
add-sqr-sqrt58.2%
times-frac58.2%
hypot-def58.2%
fma-def58.2%
hypot-def77.8%
Applied egg-rr77.8%
Taylor expanded in x.re around 0 50.0%
associate-/l*52.4%
+-commutative52.4%
unpow252.4%
fma-def52.4%
Simplified52.4%
Taylor expanded in y.re around 0 75.2%
pow275.2%
div-inv75.2%
associate-*l*77.8%
Applied egg-rr77.8%
if -3.80000000000000022e27 < y.im < 6.5000000000000001e28Initial program 71.2%
*-un-lft-identity71.2%
add-sqr-sqrt71.2%
times-frac71.2%
hypot-def71.2%
fma-def71.2%
hypot-def84.3%
Applied egg-rr84.3%
Taylor expanded in y.re around -inf 47.6%
neg-mul-147.6%
+-commutative47.6%
unsub-neg47.6%
mul-1-neg47.6%
associate-/l*46.9%
distribute-neg-frac46.9%
Simplified46.9%
Taylor expanded in y.re around -inf 86.4%
Final simplification82.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1e-9) (not (<= y.re 75000000.0))) (/ x.re y.re) (/ x.im (+ y.im (* y.re (* y.re (/ 1.0 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 <= -1e-9) || !(y_46_re <= 75000000.0)) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / 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 <= (-1d-9)) .or. (.not. (y_46re <= 75000000.0d0))) then
tmp = x_46re / y_46re
else
tmp = x_46im / (y_46im + (y_46re * (y_46re * (1.0d0 / 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 <= -1e-9) || !(y_46_re <= 75000000.0)) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / 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 <= -1e-9) or not (y_46_re <= 75000000.0): tmp = x_46_re / y_46_re else: tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / 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 <= -1e-9) || !(y_46_re <= 75000000.0)) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(x_46_im / Float64(y_46_im + Float64(y_46_re * Float64(y_46_re * Float64(1.0 / 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 <= -1e-9) || ~((y_46_re <= 75000000.0))) tmp = x_46_re / y_46_re; else tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re * (1.0 / 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, -1e-9], N[Not[LessEqual[y$46$re, 75000000.0]], $MachinePrecision]], N[(x$46$re / y$46$re), $MachinePrecision], N[(x$46$im / N[(y$46$im + N[(y$46$re * N[(y$46$re * N[(1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1 \cdot 10^{-9} \lor \neg \left(y.re \leq 75000000\right):\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im + y.re \cdot \left(y.re \cdot \frac{1}{y.im}\right)}\\
\end{array}
\end{array}
if y.re < -1.00000000000000006e-9 or 7.5e7 < y.re Initial program 53.2%
Taylor expanded in y.re around inf 74.1%
if -1.00000000000000006e-9 < y.re < 7.5e7Initial program 79.2%
*-un-lft-identity79.2%
add-sqr-sqrt79.2%
times-frac79.2%
hypot-def79.2%
fma-def79.2%
hypot-def90.1%
Applied egg-rr90.1%
Taylor expanded in x.re around 0 57.8%
associate-/l*59.9%
+-commutative59.9%
unpow259.9%
fma-def59.9%
Simplified59.9%
Taylor expanded in y.re around 0 74.5%
pow274.5%
div-inv74.5%
associate-*l*75.4%
Applied egg-rr75.4%
Final simplification74.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.08e+89) (not (<= y.im 6.2e+31))) (/ 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 <= -1.08e+89) || !(y_46_im <= 6.2e+31)) {
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 <= (-1.08d+89)) .or. (.not. (y_46im <= 6.2d+31))) 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 <= -1.08e+89) || !(y_46_im <= 6.2e+31)) {
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 <= -1.08e+89) or not (y_46_im <= 6.2e+31): 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 <= -1.08e+89) || !(y_46_im <= 6.2e+31)) 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 <= -1.08e+89) || ~((y_46_im <= 6.2e+31))) 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, -1.08e+89], N[Not[LessEqual[y$46$im, 6.2e+31]], $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 -1.08 \cdot 10^{+89} \lor \neg \left(y.im \leq 6.2 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -1.08000000000000006e89 or 6.2000000000000004e31 < y.im Initial program 56.3%
Taylor expanded in y.re around 0 76.0%
if -1.08000000000000006e89 < y.im < 6.2000000000000004e31Initial program 71.1%
Taylor expanded in y.re around inf 67.3%
Final simplification70.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re 2.5e+143) (/ 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 <= 2.5e+143) {
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 <= 2.5d+143) 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 <= 2.5e+143) {
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 <= 2.5e+143: 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 <= 2.5e+143) 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 <= 2.5e+143) 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, 2.5e+143], 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 2.5 \cdot 10^{+143}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < 2.50000000000000006e143Initial program 71.7%
Taylor expanded in y.re around 0 44.7%
if 2.50000000000000006e143 < y.re Initial program 31.4%
*-un-lft-identity31.4%
add-sqr-sqrt31.4%
times-frac31.4%
hypot-def31.4%
fma-def31.4%
hypot-def67.4%
Applied egg-rr67.4%
Taylor expanded in y.im around -inf 19.2%
neg-mul-119.2%
Simplified19.2%
Taylor expanded in y.re around -inf 19.2%
Final simplification40.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 65.6%
Taylor expanded in y.re around 0 39.1%
Final simplification39.1%
herbie shell --seed 2023334
(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))))