
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re 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_im * y_46_re) - (x_46_re * 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_46im * y_46re) - (x_46re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - Float64(x_46_re * 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_im * y_46_re) - (x_46_re * 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$im * y$46$re), $MachinePrecision] - N[(x$46$re * 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.im \cdot y.re - x.re \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.im y.re) (* x.re 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_im * y_46_re) - (x_46_re * 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_46im * y_46re) - (x_46re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - Float64(x_46_re * 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_im * y_46_re) - (x_46_re * 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$im * y$46$re), $MachinePrecision] - N[(x$46$re * 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.im \cdot y.re - x.re \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 (fma (/ y.re (hypot y.re y.im)) (/ x.im (hypot y.re y.im)) (* x.re (* (/ y.im (hypot y.im y.re)) (/ -1.0 (hypot y.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), (x_46_re * ((y_46_im / hypot(y_46_im, y_46_re)) * (-1.0 / hypot(y_46_im, y_46_re)))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(x_46_re * Float64(Float64(y_46_im / hypot(y_46_im, y_46_re)) * Float64(-1.0 / hypot(y_46_im, y_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(y$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, x.re \cdot \left(\frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{-1}{\mathsf{hypot}\left(y.im, y.re\right)}\right)\right)
\end{array}
Initial program 63.4%
div-sub62.1%
*-commutative62.1%
add-sqr-sqrt62.1%
times-frac64.6%
fma-neg64.6%
hypot-define64.6%
hypot-define73.7%
associate-/l*80.1%
add-sqr-sqrt80.1%
pow280.1%
hypot-define80.1%
Applied egg-rr80.1%
*-un-lft-identity80.1%
unpow280.1%
times-frac97.6%
hypot-undefine80.2%
+-commutative80.2%
hypot-define97.6%
hypot-undefine80.2%
+-commutative80.2%
hypot-define97.6%
Applied egg-rr97.6%
Final simplification97.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= x.re -4.4e-94) (not (<= x.re 1.6e+40)))
(*
(/ (- (/ x.im (/ x.re y.re)) y.im) (hypot y.im y.re))
(/ x.re (hypot y.im y.re)))
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(* x.re (/ y.im (- (pow (hypot y.re y.im) 2.0)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((x_46_re <= -4.4e-94) || !(x_46_re <= 1.6e+40)) {
tmp = (((x_46_im / (x_46_re / y_46_re)) - y_46_im) / hypot(y_46_im, y_46_re)) * (x_46_re / hypot(y_46_im, y_46_re));
} else {
tmp = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), (x_46_re * (y_46_im / -pow(hypot(y_46_re, y_46_im), 2.0))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((x_46_re <= -4.4e-94) || !(x_46_re <= 1.6e+40)) tmp = Float64(Float64(Float64(Float64(x_46_im / Float64(x_46_re / y_46_re)) - y_46_im) / hypot(y_46_im, y_46_re)) * Float64(x_46_re / hypot(y_46_im, y_46_re))); else tmp = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(x_46_re * Float64(y_46_im / Float64(-(hypot(y_46_re, y_46_im) ^ 2.0))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[x$46$re, -4.4e-94], N[Not[LessEqual[x$46$re, 1.6e+40]], $MachinePrecision]], N[(N[(N[(N[(x$46$im / N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision] - y$46$im), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(y$46$im / (-N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -4.4 \cdot 10^{-94} \lor \neg \left(x.re \leq 1.6 \cdot 10^{+40}\right):\\
\;\;\;\;\frac{\frac{x.im}{\frac{x.re}{y.re}} - y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, x.re \cdot \frac{y.im}{-{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)\\
\end{array}
\end{array}
if x.re < -4.40000000000000002e-94 or 1.5999999999999999e40 < x.re Initial program 54.7%
Taylor expanded in x.re around inf 54.7%
associate-/l*54.0%
Simplified54.0%
*-commutative54.0%
+-commutative54.0%
add-sqr-sqrt54.0%
hypot-undefine54.0%
hypot-undefine54.0%
times-frac94.9%
clear-num94.9%
un-div-inv94.9%
Applied egg-rr94.9%
if -4.40000000000000002e-94 < x.re < 1.5999999999999999e40Initial program 73.1%
div-sub72.1%
*-commutative72.1%
add-sqr-sqrt72.1%
times-frac74.1%
fma-neg74.1%
hypot-define74.1%
hypot-define89.3%
associate-/l*91.9%
add-sqr-sqrt91.9%
pow291.9%
hypot-define91.9%
Applied egg-rr91.9%
Final simplification93.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= x.re -2.5e-103) (not (<= x.re 3e-105)))
(*
(/ (- (/ x.im (/ x.re y.re)) y.im) (hypot y.im y.re))
(/ x.re (hypot y.im y.re)))
(/ (* x.im (/ y.re (hypot y.im y.re))) (hypot 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 ((x_46_re <= -2.5e-103) || !(x_46_re <= 3e-105)) {
tmp = (((x_46_im / (x_46_re / y_46_re)) - y_46_im) / hypot(y_46_im, y_46_re)) * (x_46_re / hypot(y_46_im, y_46_re));
} else {
tmp = (x_46_im * (y_46_re / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_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 tmp;
if ((x_46_re <= -2.5e-103) || !(x_46_re <= 3e-105)) {
tmp = (((x_46_im / (x_46_re / y_46_re)) - y_46_im) / Math.hypot(y_46_im, y_46_re)) * (x_46_re / Math.hypot(y_46_im, y_46_re));
} else {
tmp = (x_46_im * (y_46_re / Math.hypot(y_46_im, y_46_re))) / Math.hypot(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 (x_46_re <= -2.5e-103) or not (x_46_re <= 3e-105): tmp = (((x_46_im / (x_46_re / y_46_re)) - y_46_im) / math.hypot(y_46_im, y_46_re)) * (x_46_re / math.hypot(y_46_im, y_46_re)) else: tmp = (x_46_im * (y_46_re / math.hypot(y_46_im, y_46_re))) / math.hypot(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 ((x_46_re <= -2.5e-103) || !(x_46_re <= 3e-105)) tmp = Float64(Float64(Float64(Float64(x_46_im / Float64(x_46_re / y_46_re)) - y_46_im) / hypot(y_46_im, y_46_re)) * Float64(x_46_re / hypot(y_46_im, y_46_re))); else tmp = Float64(Float64(x_46_im * Float64(y_46_re / hypot(y_46_im, y_46_re))) / hypot(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 ((x_46_re <= -2.5e-103) || ~((x_46_re <= 3e-105))) tmp = (((x_46_im / (x_46_re / y_46_re)) - y_46_im) / hypot(y_46_im, y_46_re)) * (x_46_re / hypot(y_46_im, y_46_re)); else tmp = (x_46_im * (y_46_re / hypot(y_46_im, y_46_re))) / hypot(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[x$46$re, -2.5e-103], N[Not[LessEqual[x$46$re, 3e-105]], $MachinePrecision]], N[(N[(N[(N[(x$46$im / N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision] - y$46$im), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x.re \leq -2.5 \cdot 10^{-103} \lor \neg \left(x.re \leq 3 \cdot 10^{-105}\right):\\
\;\;\;\;\frac{\frac{x.im}{\frac{x.re}{y.re}} - y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\end{array}
\end{array}
if x.re < -2.49999999999999983e-103 or 3.0000000000000001e-105 < x.re Initial program 57.1%
Taylor expanded in x.re around inf 57.1%
associate-/l*55.9%
Simplified55.9%
*-commutative55.9%
+-commutative55.9%
add-sqr-sqrt55.9%
hypot-undefine55.9%
hypot-undefine55.9%
times-frac93.3%
clear-num93.3%
un-div-inv93.3%
Applied egg-rr93.3%
if -2.49999999999999983e-103 < x.re < 3.0000000000000001e-105Initial program 74.7%
Taylor expanded in x.im around inf 68.1%
*-commutative68.1%
Simplified68.1%
*-un-lft-identity68.1%
+-commutative68.1%
add-sqr-sqrt68.1%
hypot-undefine68.1%
hypot-undefine68.1%
times-frac79.6%
hypot-undefine68.2%
+-commutative68.2%
hypot-define79.6%
*-commutative79.6%
hypot-undefine68.2%
+-commutative68.2%
hypot-define79.6%
Applied egg-rr79.6%
associate-*l/79.7%
*-lft-identity79.7%
associate-/l*92.2%
hypot-undefine71.7%
unpow271.7%
unpow271.7%
+-commutative71.7%
unpow271.7%
unpow271.7%
hypot-define92.2%
hypot-undefine71.7%
unpow271.7%
unpow271.7%
+-commutative71.7%
unpow271.7%
unpow271.7%
hypot-define92.2%
Simplified92.2%
Final simplification92.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* x.re (/ y.im y.re))) y.re))
(t_1 (/ (- (* x.im (/ y.re y.im)) x.re) y.im))
(t_2 (/ (- (/ (* y.re x.im) y.im) x.re) y.im)))
(if (<= y.im -1.46e+23)
t_1
(if (<= y.im -8e-40)
(/ (* x.re (- y.im)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im -8.6e-49)
t_2
(if (<= y.im 1.35e-76)
t_0
(if (<= y.im 1.5e-25) t_2 (if (<= y.im 2e+36) 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_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double t_2 = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -1.46e+23) {
tmp = t_1;
} else if (y_46_im <= -8e-40) {
tmp = (x_46_re * -y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= -8.6e-49) {
tmp = t_2;
} else if (y_46_im <= 1.35e-76) {
tmp = t_0;
} else if (y_46_im <= 1.5e-25) {
tmp = t_2;
} else if (y_46_im <= 2e+36) {
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) :: t_2
real(8) :: tmp
t_0 = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
t_1 = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
t_2 = (((y_46re * x_46im) / y_46im) - x_46re) / y_46im
if (y_46im <= (-1.46d+23)) then
tmp = t_1
else if (y_46im <= (-8d-40)) then
tmp = (x_46re * -y_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46im <= (-8.6d-49)) then
tmp = t_2
else if (y_46im <= 1.35d-76) then
tmp = t_0
else if (y_46im <= 1.5d-25) then
tmp = t_2
else if (y_46im <= 2d+36) 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_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double t_2 = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -1.46e+23) {
tmp = t_1;
} else if (y_46_im <= -8e-40) {
tmp = (x_46_re * -y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= -8.6e-49) {
tmp = t_2;
} else if (y_46_im <= 1.35e-76) {
tmp = t_0;
} else if (y_46_im <= 1.5e-25) {
tmp = t_2;
} else if (y_46_im <= 2e+36) {
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_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im t_2 = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im tmp = 0 if y_46_im <= -1.46e+23: tmp = t_1 elif y_46_im <= -8e-40: tmp = (x_46_re * -y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_im <= -8.6e-49: tmp = t_2 elif y_46_im <= 1.35e-76: tmp = t_0 elif y_46_im <= 1.5e-25: tmp = t_2 elif y_46_im <= 2e+36: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re) t_1 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) t_2 = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -1.46e+23) tmp = t_1; elseif (y_46_im <= -8e-40) tmp = Float64(Float64(x_46_re * Float64(-y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= -8.6e-49) tmp = t_2; elseif (y_46_im <= 1.35e-76) tmp = t_0; elseif (y_46_im <= 1.5e-25) tmp = t_2; elseif (y_46_im <= 2e+36) 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_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; t_2 = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_im <= -1.46e+23) tmp = t_1; elseif (y_46_im <= -8e-40) tmp = (x_46_re * -y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_im <= -8.6e-49) tmp = t_2; elseif (y_46_im <= 1.35e-76) tmp = t_0; elseif (y_46_im <= 1.5e-25) tmp = t_2; elseif (y_46_im <= 2e+36) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1.46e+23], t$95$1, If[LessEqual[y$46$im, -8e-40], N[(N[(x$46$re * (-y$46$im)), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -8.6e-49], t$95$2, If[LessEqual[y$46$im, 1.35e-76], t$95$0, If[LessEqual[y$46$im, 1.5e-25], t$95$2, If[LessEqual[y$46$im, 2e+36], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
t_1 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
t_2 := \frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.46 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -8 \cdot 10^{-40}:\\
\;\;\;\;\frac{x.re \cdot \left(-y.im\right)}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq -8.6 \cdot 10^{-49}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 1.35 \cdot 10^{-76}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.5 \cdot 10^{-25}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{+36}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.45999999999999996e23 or 2.00000000000000008e36 < y.im Initial program 44.6%
Taylor expanded in y.re around 0 77.4%
+-commutative77.4%
mul-1-neg77.4%
unsub-neg77.4%
unpow277.4%
associate-/r*79.2%
div-sub79.2%
associate-/l*85.1%
fma-neg85.1%
Simplified85.1%
fma-undefine85.1%
unsub-neg85.1%
Applied egg-rr85.1%
if -1.45999999999999996e23 < y.im < -7.9999999999999994e-40Initial program 91.5%
Taylor expanded in x.im around 0 76.1%
mul-1-neg76.1%
*-commutative76.1%
distribute-rgt-neg-in76.1%
Simplified76.1%
if -7.9999999999999994e-40 < y.im < -8.60000000000000033e-49 or 1.35e-76 < y.im < 1.4999999999999999e-25Initial program 93.7%
Taylor expanded in y.im around inf 82.1%
if -8.60000000000000033e-49 < y.im < 1.35e-76 or 1.4999999999999999e-25 < y.im < 2.00000000000000008e36Initial program 74.6%
Taylor expanded in y.re around inf 84.6%
mul-1-neg84.6%
unsub-neg84.6%
associate-/l*85.4%
Simplified85.4%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.im -2e+44)
t_1
(if (<= y.im -4.5e-91)
t_0
(if (<= y.im 8.2e-122)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 3.4e+38) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -2e+44) {
tmp = t_1;
} else if (y_46_im <= -4.5e-91) {
tmp = t_0;
} else if (y_46_im <= 8.2e-122) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 3.4e+38) {
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 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
if (y_46im <= (-2d+44)) then
tmp = t_1
else if (y_46im <= (-4.5d-91)) then
tmp = t_0
else if (y_46im <= 8.2d-122) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else if (y_46im <= 3.4d+38) 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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -2e+44) {
tmp = t_1;
} else if (y_46_im <= -4.5e-91) {
tmp = t_0;
} else if (y_46_im <= 8.2e-122) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 3.4e+38) {
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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im tmp = 0 if y_46_im <= -2e+44: tmp = t_1 elif y_46_im <= -4.5e-91: tmp = t_0 elif y_46_im <= 8.2e-122: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 3.4e+38: 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(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -2e+44) tmp = t_1; elseif (y_46_im <= -4.5e-91) tmp = t_0; elseif (y_46_im <= 8.2e-122) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 3.4e+38) 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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_im <= -2e+44) tmp = t_1; elseif (y_46_im <= -4.5e-91) tmp = t_0; elseif (y_46_im <= 8.2e-122) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 3.4e+38) 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[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $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[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2e+44], t$95$1, If[LessEqual[y$46$im, -4.5e-91], t$95$0, If[LessEqual[y$46$im, 8.2e-122], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 3.4e+38], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -2 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -4.5 \cdot 10^{-91}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 8.2 \cdot 10^{-122}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 3.4 \cdot 10^{+38}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -2.0000000000000002e44 or 3.39999999999999996e38 < y.im Initial program 44.6%
Taylor expanded in y.re around 0 77.4%
+-commutative77.4%
mul-1-neg77.4%
unsub-neg77.4%
unpow277.4%
associate-/r*79.2%
div-sub79.2%
associate-/l*85.1%
fma-neg85.1%
Simplified85.1%
fma-undefine85.1%
unsub-neg85.1%
Applied egg-rr85.1%
if -2.0000000000000002e44 < y.im < -4.49999999999999976e-91 or 8.2000000000000001e-122 < y.im < 3.39999999999999996e38Initial program 92.0%
if -4.49999999999999976e-91 < y.im < 8.2000000000000001e-122Initial program 67.7%
Taylor expanded in y.re around inf 92.1%
mul-1-neg92.1%
unsub-neg92.1%
associate-/l*93.2%
Simplified93.2%
Final simplification89.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -2.7e+33)
(not
(or (<= y.im 1.35e-76)
(and (not (<= y.im 7.6e-26)) (<= y.im 1.45e+36)))))
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.7e+33) || !((y_46_im <= 1.35e-76) || (!(y_46_im <= 7.6e-26) && (y_46_im <= 1.45e+36)))) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-2.7d+33)) .or. (.not. (y_46im <= 1.35d-76) .or. (.not. (y_46im <= 7.6d-26)) .and. (y_46im <= 1.45d+36))) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.7e+33) || !((y_46_im <= 1.35e-76) || (!(y_46_im <= 7.6e-26) && (y_46_im <= 1.45e+36)))) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -2.7e+33) or not ((y_46_im <= 1.35e-76) or (not (y_46_im <= 7.6e-26) and (y_46_im <= 1.45e+36))): tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -2.7e+33) || !((y_46_im <= 1.35e-76) || (!(y_46_im <= 7.6e-26) && (y_46_im <= 1.45e+36)))) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -2.7e+33) || ~(((y_46_im <= 1.35e-76) || (~((y_46_im <= 7.6e-26)) && (y_46_im <= 1.45e+36))))) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -2.7e+33], N[Not[Or[LessEqual[y$46$im, 1.35e-76], And[N[Not[LessEqual[y$46$im, 7.6e-26]], $MachinePrecision], LessEqual[y$46$im, 1.45e+36]]]], $MachinePrecision]], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.7 \cdot 10^{+33} \lor \neg \left(y.im \leq 1.35 \cdot 10^{-76} \lor \neg \left(y.im \leq 7.6 \cdot 10^{-26}\right) \land y.im \leq 1.45 \cdot 10^{+36}\right):\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -2.69999999999999991e33 or 1.35e-76 < y.im < 7.60000000000000029e-26 or 1.45e36 < y.im Initial program 49.6%
Taylor expanded in y.re around 0 77.5%
+-commutative77.5%
mul-1-neg77.5%
unsub-neg77.5%
unpow277.5%
associate-/r*79.1%
div-sub79.1%
associate-/l*84.4%
fma-neg84.4%
Simplified84.4%
fma-undefine84.4%
unsub-neg84.4%
Applied egg-rr84.4%
if -2.69999999999999991e33 < y.im < 1.35e-76 or 7.60000000000000029e-26 < y.im < 1.45e36Initial program 76.6%
Taylor expanded in y.re around inf 81.1%
mul-1-neg81.1%
unsub-neg81.1%
associate-/l*81.8%
Simplified81.8%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* x.re (/ y.im y.re))) y.re))
(t_1 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.im -1.9e+28)
t_1
(if (<= y.im 1.05e-76)
t_0
(if (<= y.im 7.6e-26)
(/ (- (/ (* y.re x.im) y.im) x.re) y.im)
(if (<= y.im 2.3e+37) 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_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -1.9e+28) {
tmp = t_1;
} else if (y_46_im <= 1.05e-76) {
tmp = t_0;
} else if (y_46_im <= 7.6e-26) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_im <= 2.3e+37) {
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_46im - (x_46re * (y_46im / y_46re))) / y_46re
t_1 = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
if (y_46im <= (-1.9d+28)) then
tmp = t_1
else if (y_46im <= 1.05d-76) then
tmp = t_0
else if (y_46im <= 7.6d-26) then
tmp = (((y_46re * x_46im) / y_46im) - x_46re) / y_46im
else if (y_46im <= 2.3d+37) 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_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -1.9e+28) {
tmp = t_1;
} else if (y_46_im <= 1.05e-76) {
tmp = t_0;
} else if (y_46_im <= 7.6e-26) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_im <= 2.3e+37) {
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_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im tmp = 0 if y_46_im <= -1.9e+28: tmp = t_1 elif y_46_im <= 1.05e-76: tmp = t_0 elif y_46_im <= 7.6e-26: tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im elif y_46_im <= 2.3e+37: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re) t_1 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -1.9e+28) tmp = t_1; elseif (y_46_im <= 1.05e-76) tmp = t_0; elseif (y_46_im <= 7.6e-26) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_im <= 2.3e+37) 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_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_im <= -1.9e+28) tmp = t_1; elseif (y_46_im <= 1.05e-76) tmp = t_0; elseif (y_46_im <= 7.6e-26) tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im; elseif (y_46_im <= 2.3e+37) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1.9e+28], t$95$1, If[LessEqual[y$46$im, 1.05e-76], t$95$0, If[LessEqual[y$46$im, 7.6e-26], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 2.3e+37], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
t_1 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.9 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 1.05 \cdot 10^{-76}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 7.6 \cdot 10^{-26}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 2.3 \cdot 10^{+37}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.8999999999999999e28 or 2.30000000000000002e37 < y.im Initial program 44.6%
Taylor expanded in y.re around 0 77.4%
+-commutative77.4%
mul-1-neg77.4%
unsub-neg77.4%
unpow277.4%
associate-/r*79.2%
div-sub79.2%
associate-/l*85.1%
fma-neg85.1%
Simplified85.1%
fma-undefine85.1%
unsub-neg85.1%
Applied egg-rr85.1%
if -1.8999999999999999e28 < y.im < 1.04999999999999996e-76 or 7.60000000000000029e-26 < y.im < 2.30000000000000002e37Initial program 76.6%
Taylor expanded in y.re around inf 81.1%
mul-1-neg81.1%
unsub-neg81.1%
associate-/l*81.8%
Simplified81.8%
if 1.04999999999999996e-76 < y.im < 7.60000000000000029e-26Initial program 92.3%
Taylor expanded in y.im around inf 78.0%
Final simplification83.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.22e+27) (not (<= y.im 1e+38))) (/ x.re (- y.im)) (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.22e+27) || !(y_46_im <= 1e+38)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-2.22d+27)) .or. (.not. (y_46im <= 1d+38))) then
tmp = x_46re / -y_46im
else
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.22e+27) || !(y_46_im <= 1e+38)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -2.22e+27) or not (y_46_im <= 1e+38): tmp = x_46_re / -y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -2.22e+27) || !(y_46_im <= 1e+38)) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -2.22e+27) || ~((y_46_im <= 1e+38))) tmp = x_46_re / -y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -2.22e+27], N[Not[LessEqual[y$46$im, 1e+38]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.22 \cdot 10^{+27} \lor \neg \left(y.im \leq 10^{+38}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -2.22000000000000007e27 or 9.99999999999999977e37 < y.im Initial program 44.6%
Taylor expanded in y.re around 0 66.6%
associate-*r/66.6%
neg-mul-166.6%
Simplified66.6%
if -2.22000000000000007e27 < y.im < 9.99999999999999977e37Initial program 78.0%
Taylor expanded in y.re around inf 76.2%
mul-1-neg76.2%
unsub-neg76.2%
associate-/l*76.9%
Simplified76.9%
Final simplification72.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -5.5e-80) (not (<= y.im 3.2e-74))) (/ x.re (- 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_im <= -5.5e-80) || !(y_46_im <= 3.2e-74)) {
tmp = x_46_re / -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_46im <= (-5.5d-80)) .or. (.not. (y_46im <= 3.2d-74))) then
tmp = x_46re / -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_im <= -5.5e-80) || !(y_46_im <= 3.2e-74)) {
tmp = x_46_re / -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_im <= -5.5e-80) or not (y_46_im <= 3.2e-74): tmp = x_46_re / -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_im <= -5.5e-80) || !(y_46_im <= 3.2e-74)) tmp = Float64(x_46_re / Float64(-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_im <= -5.5e-80) || ~((y_46_im <= 3.2e-74))) tmp = x_46_re / -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[Or[LessEqual[y$46$im, -5.5e-80], N[Not[LessEqual[y$46$im, 3.2e-74]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.5 \cdot 10^{-80} \lor \neg \left(y.im \leq 3.2 \cdot 10^{-74}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -5.4999999999999997e-80 or 3.1999999999999999e-74 < y.im Initial program 58.2%
Taylor expanded in y.re around 0 58.1%
associate-*r/58.1%
neg-mul-158.1%
Simplified58.1%
if -5.4999999999999997e-80 < y.im < 3.1999999999999999e-74Initial program 72.0%
Taylor expanded in y.re around inf 74.5%
Final simplification64.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
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_46re
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_re;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.re}
\end{array}
Initial program 63.4%
Taylor expanded in y.re around inf 40.4%
herbie shell --seed 2024103
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
:precision binary64
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))