
(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 11 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
(let* ((t_0
(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))))))
(if (<= y.im -2.2e+125)
(/ (- (* (/ x.im y.im) y.re) x.re) y.im)
(if (<= y.im -4.2e-115)
t_0
(if (<= y.im 2.7e-136)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 1.75e+145)
t_0
(* (- (/ y.re (/ y.im x.im)) x.re) (/ 1.0 y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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))));
double tmp;
if (y_46_im <= -2.2e+125) {
tmp = (((x_46_im / y_46_im) * y_46_re) - x_46_re) / y_46_im;
} else if (y_46_im <= -4.2e-115) {
tmp = t_0;
} else if (y_46_im <= 2.7e-136) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1.75e+145) {
tmp = t_0;
} else {
tmp = ((y_46_re / (y_46_im / x_46_im)) - x_46_re) * (1.0 / y_46_im);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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_re, y_46_im) ^ 2.0)))) tmp = 0.0 if (y_46_im <= -2.2e+125) tmp = Float64(Float64(Float64(Float64(x_46_im / y_46_im) * y_46_re) - x_46_re) / y_46_im); elseif (y_46_im <= -4.2e-115) tmp = t_0; elseif (y_46_im <= 2.7e-136) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 1.75e+145) tmp = t_0; else tmp = Float64(Float64(Float64(y_46_re / Float64(y_46_im / x_46_im)) - x_46_re) * Float64(1.0 / y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re / 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]}, If[LessEqual[y$46$im, -2.2e+125], N[(N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * y$46$re), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -4.2e-115], t$95$0, If[LessEqual[y$46$im, 2.7e-136], 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, 1.75e+145], t$95$0, N[(N[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] * N[(1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
\mathbf{if}\;y.im \leq -2.2 \cdot 10^{+125}:\\
\;\;\;\;\frac{\frac{x.im}{y.im} \cdot y.re - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -4.2 \cdot 10^{-115}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{-136}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.75 \cdot 10^{+145}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y.re}{\frac{y.im}{x.im}} - x.re\right) \cdot \frac{1}{y.im}\\
\end{array}
\end{array}
if y.im < -2.19999999999999991e125Initial program 39.2%
Taylor expanded in y.re around 0 75.9%
+-commutative75.9%
mul-1-neg75.9%
unsub-neg75.9%
unpow275.9%
associate-/r*85.5%
div-sub85.5%
associate-/l*95.2%
Simplified95.2%
clear-num95.2%
un-div-inv95.2%
Applied egg-rr95.2%
associate-/r/95.2%
Simplified95.2%
if -2.19999999999999991e125 < y.im < -4.20000000000000003e-115 or 2.6999999999999998e-136 < y.im < 1.7500000000000001e145Initial program 70.2%
div-sub70.2%
*-commutative70.2%
fma-define70.2%
add-sqr-sqrt70.2%
times-frac72.2%
fma-neg72.2%
fma-define72.1%
hypot-define72.2%
fma-define72.2%
hypot-define90.8%
associate-/l*95.1%
fma-define95.1%
add-sqr-sqrt95.0%
pow295.0%
Applied egg-rr95.0%
if -4.20000000000000003e-115 < y.im < 2.6999999999999998e-136Initial program 75.1%
Taylor expanded in y.re around inf 92.7%
remove-double-neg92.7%
mul-1-neg92.7%
neg-mul-192.7%
distribute-lft-in92.7%
mul-1-neg92.7%
distribute-neg-in92.7%
mul-1-neg92.7%
remove-double-neg92.7%
unsub-neg92.7%
associate-/l*93.2%
Simplified93.2%
if 1.7500000000000001e145 < y.im Initial program 37.8%
Taylor expanded in y.re around 0 79.1%
+-commutative79.1%
mul-1-neg79.1%
unsub-neg79.1%
unpow279.1%
associate-/r*81.7%
div-sub81.7%
associate-/l*86.4%
Simplified86.4%
div-inv86.5%
fma-neg86.5%
Applied egg-rr86.5%
Taylor expanded in x.im around 0 81.7%
associate-*r/86.5%
*-commutative86.5%
associate-/r/88.7%
Simplified88.7%
Final simplification93.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.1e+58)
(/ (- x.im (/ x.re (/ y.re y.im))) y.re)
(if (<= y.re -7.2e-151)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.im y.im (* y.re y.re)))
(if (<= y.re 8.2e-55)
(/ (- (/ (* x.im y.re) y.im) x.re) y.im)
(if (<= y.re 5.5e+131)
(/ (- (* x.im y.re) (* y.im x.re)) (fma y.re y.re (* y.im y.im)))
(/ (- x.im (* y.im (/ x.re 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_re <= -1.1e+58) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_re <= -7.2e-151) {
tmp = fma(x_46_im, y_46_re, (y_46_im * -x_46_re)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
} else if (y_46_re <= 8.2e-55) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 5.5e+131) {
tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
} else {
tmp = (x_46_im - (y_46_im * (x_46_re / 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_re <= -1.1e+58) tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re); elseif (y_46_re <= -7.2e-151) tmp = Float64(fma(x_46_im, y_46_re, Float64(y_46_im * Float64(-x_46_re))) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))); elseif (y_46_re <= 8.2e-55) tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 5.5e+131) tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / y_46_re); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.1e+58], N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -7.2e-151], N[(N[(x$46$im * y$46$re + N[(y$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.2e-55], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 5.5e+131], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.1 \cdot 10^{+58}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\mathbf{elif}\;y.re \leq -7.2 \cdot 10^{-151}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, y.re, y.im \cdot \left(-x.re\right)\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{-55}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{+131}:\\
\;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -1.1e58Initial program 34.4%
Taylor expanded in y.re around inf 78.4%
remove-double-neg78.4%
mul-1-neg78.4%
neg-mul-178.4%
distribute-lft-in78.4%
mul-1-neg78.4%
distribute-neg-in78.4%
mul-1-neg78.4%
remove-double-neg78.4%
unsub-neg78.4%
associate-/l*83.3%
Simplified83.3%
clear-num83.3%
un-div-inv83.3%
Applied egg-rr83.3%
if -1.1e58 < y.re < -7.20000000000000064e-151Initial program 84.5%
fma-neg84.5%
distribute-rgt-neg-out84.5%
+-commutative84.5%
fma-define84.5%
Simplified84.5%
if -7.20000000000000064e-151 < y.re < 8.1999999999999996e-55Initial program 66.3%
div-sub62.2%
*-commutative62.2%
fma-define62.2%
add-sqr-sqrt62.2%
times-frac60.8%
fma-neg60.8%
fma-define60.8%
hypot-define60.8%
fma-define60.8%
hypot-define62.1%
associate-/l*68.6%
fma-define68.6%
add-sqr-sqrt68.6%
pow268.6%
Applied egg-rr68.6%
Taylor expanded in y.im around inf 96.0%
if 8.1999999999999996e-55 < y.re < 5.49999999999999971e131Initial program 80.9%
fma-define80.9%
Simplified80.9%
if 5.49999999999999971e131 < y.re Initial program 29.3%
Taylor expanded in y.re around inf 79.5%
remove-double-neg79.5%
mul-1-neg79.5%
neg-mul-179.5%
distribute-lft-in79.5%
mul-1-neg79.5%
distribute-neg-in79.5%
mul-1-neg79.5%
remove-double-neg79.5%
unsub-neg79.5%
associate-/l*84.6%
Simplified84.6%
clear-num82.6%
un-div-inv82.5%
Applied egg-rr82.5%
associate-/r/85.5%
Simplified85.5%
Final simplification87.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* x.im y.re) (* y.im x.re))))
(if (<= y.re -2.3e+58)
(/ (- x.im (/ x.re (/ y.re y.im))) y.re)
(if (<= y.re -8.8e-147)
(/ t_0 (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 3.8e-55)
(/ (- (/ (* x.im y.re) y.im) x.re) y.im)
(if (<= y.re 2.3e+131)
(/ t_0 (fma y.re y.re (* y.im y.im)))
(/ (- x.im (* y.im (/ x.re y.re))) y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * y_46_re) - (y_46_im * x_46_re);
double tmp;
if (y_46_re <= -2.3e+58) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_re <= -8.8e-147) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 3.8e-55) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 2.3e+131) {
tmp = t_0 / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
} else {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (y_46_re <= -2.3e+58) tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re); elseif (y_46_re <= -8.8e-147) tmp = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_re <= 3.8e-55) tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 2.3e+131) tmp = Float64(t_0 / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / y_46_re); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.3e+58], N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -8.8e-147], N[(t$95$0 / 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.8e-55], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.3e+131], N[(t$95$0 / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot y.re - y.im \cdot x.re\\
\mathbf{if}\;y.re \leq -2.3 \cdot 10^{+58}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\mathbf{elif}\;y.re \leq -8.8 \cdot 10^{-147}:\\
\;\;\;\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 3.8 \cdot 10^{-55}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 2.3 \cdot 10^{+131}:\\
\;\;\;\;\frac{t\_0}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -2.30000000000000002e58Initial program 34.4%
Taylor expanded in y.re around inf 78.4%
remove-double-neg78.4%
mul-1-neg78.4%
neg-mul-178.4%
distribute-lft-in78.4%
mul-1-neg78.4%
distribute-neg-in78.4%
mul-1-neg78.4%
remove-double-neg78.4%
unsub-neg78.4%
associate-/l*83.3%
Simplified83.3%
clear-num83.3%
un-div-inv83.3%
Applied egg-rr83.3%
if -2.30000000000000002e58 < y.re < -8.8000000000000004e-147Initial program 84.5%
if -8.8000000000000004e-147 < y.re < 3.7999999999999997e-55Initial program 66.3%
div-sub62.2%
*-commutative62.2%
fma-define62.2%
add-sqr-sqrt62.2%
times-frac60.8%
fma-neg60.8%
fma-define60.8%
hypot-define60.8%
fma-define60.8%
hypot-define62.1%
associate-/l*68.6%
fma-define68.6%
add-sqr-sqrt68.6%
pow268.6%
Applied egg-rr68.6%
Taylor expanded in y.im around inf 96.0%
if 3.7999999999999997e-55 < y.re < 2.29999999999999992e131Initial program 80.9%
fma-define80.9%
Simplified80.9%
if 2.29999999999999992e131 < y.re Initial program 29.3%
Taylor expanded in y.re around inf 79.5%
remove-double-neg79.5%
mul-1-neg79.5%
neg-mul-179.5%
distribute-lft-in79.5%
mul-1-neg79.5%
distribute-neg-in79.5%
mul-1-neg79.5%
remove-double-neg79.5%
unsub-neg79.5%
associate-/l*84.6%
Simplified84.6%
clear-num82.6%
un-div-inv82.5%
Applied egg-rr82.5%
associate-/r/85.5%
Simplified85.5%
Final simplification87.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -4.2e+57)
(/ (- x.im (/ x.re (/ y.re y.im))) y.re)
(if (<= y.re -3.1e-145)
t_0
(if (<= y.re 2.15e-55)
(/ (- (/ (* x.im y.re) y.im) x.re) y.im)
(if (<= y.re 9.2e+131)
t_0
(/ (- x.im (* y.im (/ x.re y.re))) y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -4.2e+57) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_re <= -3.1e-145) {
tmp = t_0;
} else if (y_46_re <= 2.15e-55) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 9.2e+131) {
tmp = t_0;
} else {
tmp = (x_46_im - (y_46_im * (x_46_re / 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) :: t_0
real(8) :: tmp
t_0 = ((x_46im * y_46re) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46re <= (-4.2d+57)) then
tmp = (x_46im - (x_46re / (y_46re / y_46im))) / y_46re
else if (y_46re <= (-3.1d-145)) then
tmp = t_0
else if (y_46re <= 2.15d-55) then
tmp = (((x_46im * y_46re) / y_46im) - x_46re) / y_46im
else if (y_46re <= 9.2d+131) then
tmp = t_0
else
tmp = (x_46im - (y_46im * (x_46re / 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 t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -4.2e+57) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_re <= -3.1e-145) {
tmp = t_0;
} else if (y_46_re <= 2.15e-55) {
tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 9.2e+131) {
tmp = t_0;
} else {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -4.2e+57: tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re elif y_46_re <= -3.1e-145: tmp = t_0 elif y_46_re <= 2.15e-55: tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im elif y_46_re <= 9.2e+131: tmp = t_0 else: tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -4.2e+57) tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re); elseif (y_46_re <= -3.1e-145) tmp = t_0; elseif (y_46_re <= 2.15e-55) tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 9.2e+131) tmp = t_0; else tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / 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) t_0 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -4.2e+57) tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re; elseif (y_46_re <= -3.1e-145) tmp = t_0; elseif (y_46_re <= 2.15e-55) tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im; elseif (y_46_re <= 9.2e+131) tmp = t_0; else tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$im * y$46$re), $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]}, If[LessEqual[y$46$re, -4.2e+57], N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -3.1e-145], t$95$0, If[LessEqual[y$46$re, 2.15e-55], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 9.2e+131], t$95$0, N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -4.2 \cdot 10^{+57}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\mathbf{elif}\;y.re \leq -3.1 \cdot 10^{-145}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.15 \cdot 10^{-55}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 9.2 \cdot 10^{+131}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -4.19999999999999982e57Initial program 34.4%
Taylor expanded in y.re around inf 78.4%
remove-double-neg78.4%
mul-1-neg78.4%
neg-mul-178.4%
distribute-lft-in78.4%
mul-1-neg78.4%
distribute-neg-in78.4%
mul-1-neg78.4%
remove-double-neg78.4%
unsub-neg78.4%
associate-/l*83.3%
Simplified83.3%
clear-num83.3%
un-div-inv83.3%
Applied egg-rr83.3%
if -4.19999999999999982e57 < y.re < -3.1e-145 or 2.15000000000000005e-55 < y.re < 9.19999999999999966e131Initial program 82.9%
if -3.1e-145 < y.re < 2.15000000000000005e-55Initial program 66.3%
div-sub62.2%
*-commutative62.2%
fma-define62.2%
add-sqr-sqrt62.2%
times-frac60.8%
fma-neg60.8%
fma-define60.8%
hypot-define60.8%
fma-define60.8%
hypot-define62.1%
associate-/l*68.6%
fma-define68.6%
add-sqr-sqrt68.6%
pow268.6%
Applied egg-rr68.6%
Taylor expanded in y.im around inf 96.0%
if 9.19999999999999966e131 < y.re Initial program 29.3%
Taylor expanded in y.re around inf 79.5%
remove-double-neg79.5%
mul-1-neg79.5%
neg-mul-179.5%
distribute-lft-in79.5%
mul-1-neg79.5%
distribute-neg-in79.5%
mul-1-neg79.5%
remove-double-neg79.5%
unsub-neg79.5%
associate-/l*84.6%
Simplified84.6%
clear-num82.6%
un-div-inv82.5%
Applied egg-rr82.5%
associate-/r/85.5%
Simplified85.5%
Final simplification87.5%
(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.im) y.re) x.re) y.im)))
(if (<= y.im -7.8e+121)
t_1
(if (<= y.im -1.36e+100)
t_0
(if (<= y.im -3e-55)
t_1
(if (<= y.im 2.8e+55)
t_0
(* (- (/ y.re (/ y.im x.im)) x.re) (/ 1.0 y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double t_1 = (((x_46_im / y_46_im) * y_46_re) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -7.8e+121) {
tmp = t_1;
} else if (y_46_im <= -1.36e+100) {
tmp = t_0;
} else if (y_46_im <= -3e-55) {
tmp = t_1;
} else if (y_46_im <= 2.8e+55) {
tmp = t_0;
} else {
tmp = ((y_46_re / (y_46_im / x_46_im)) - x_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) :: 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_46im) * y_46re) - x_46re) / y_46im
if (y_46im <= (-7.8d+121)) then
tmp = t_1
else if (y_46im <= (-1.36d+100)) then
tmp = t_0
else if (y_46im <= (-3d-55)) then
tmp = t_1
else if (y_46im <= 2.8d+55) then
tmp = t_0
else
tmp = ((y_46re / (y_46im / x_46im)) - x_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 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_im) * y_46_re) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -7.8e+121) {
tmp = t_1;
} else if (y_46_im <= -1.36e+100) {
tmp = t_0;
} else if (y_46_im <= -3e-55) {
tmp = t_1;
} else if (y_46_im <= 2.8e+55) {
tmp = t_0;
} else {
tmp = ((y_46_re / (y_46_im / x_46_im)) - x_46_re) * (1.0 / y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re t_1 = (((x_46_im / y_46_im) * y_46_re) - x_46_re) / y_46_im tmp = 0 if y_46_im <= -7.8e+121: tmp = t_1 elif y_46_im <= -1.36e+100: tmp = t_0 elif y_46_im <= -3e-55: tmp = t_1 elif y_46_im <= 2.8e+55: tmp = t_0 else: tmp = ((y_46_re / (y_46_im / x_46_im)) - x_46_re) * (1.0 / y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re) t_1 = Float64(Float64(Float64(Float64(x_46_im / y_46_im) * y_46_re) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -7.8e+121) tmp = t_1; elseif (y_46_im <= -1.36e+100) tmp = t_0; elseif (y_46_im <= -3e-55) tmp = t_1; elseif (y_46_im <= 2.8e+55) tmp = t_0; else tmp = Float64(Float64(Float64(y_46_re / Float64(y_46_im / x_46_im)) - x_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) t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; t_1 = (((x_46_im / y_46_im) * y_46_re) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_im <= -7.8e+121) tmp = t_1; elseif (y_46_im <= -1.36e+100) tmp = t_0; elseif (y_46_im <= -3e-55) tmp = t_1; elseif (y_46_im <= 2.8e+55) tmp = t_0; else tmp = ((y_46_re / (y_46_im / x_46_im)) - x_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_] := 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[(N[(x$46$im / y$46$im), $MachinePrecision] * y$46$re), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -7.8e+121], t$95$1, If[LessEqual[y$46$im, -1.36e+100], t$95$0, If[LessEqual[y$46$im, -3e-55], t$95$1, If[LessEqual[y$46$im, 2.8e+55], t$95$0, N[(N[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] * N[(1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
t_1 := \frac{\frac{x.im}{y.im} \cdot y.re - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -7.8 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -1.36 \cdot 10^{+100}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -3 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 2.8 \cdot 10^{+55}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y.re}{\frac{y.im}{x.im}} - x.re\right) \cdot \frac{1}{y.im}\\
\end{array}
\end{array}
if y.im < -7.79999999999999967e121 or -1.35999999999999994e100 < y.im < -3.00000000000000016e-55Initial program 57.3%
Taylor expanded in y.re around 0 69.7%
+-commutative69.7%
mul-1-neg69.7%
unsub-neg69.7%
unpow269.7%
associate-/r*74.8%
div-sub74.9%
associate-/l*79.9%
Simplified79.9%
clear-num79.9%
un-div-inv79.9%
Applied egg-rr79.9%
associate-/r/80.0%
Simplified80.0%
if -7.79999999999999967e121 < y.im < -1.35999999999999994e100 or -3.00000000000000016e-55 < y.im < 2.8000000000000001e55Initial program 73.2%
Taylor expanded in y.re around inf 86.4%
remove-double-neg86.4%
mul-1-neg86.4%
neg-mul-186.4%
distribute-lft-in86.4%
mul-1-neg86.4%
distribute-neg-in86.4%
mul-1-neg86.4%
remove-double-neg86.4%
unsub-neg86.4%
associate-/l*86.7%
Simplified86.7%
if 2.8000000000000001e55 < y.im Initial program 44.4%
Taylor expanded in y.re around 0 73.1%
+-commutative73.1%
mul-1-neg73.1%
unsub-neg73.1%
unpow273.1%
associate-/r*74.7%
div-sub74.7%
associate-/l*76.5%
Simplified76.5%
div-inv76.4%
fma-neg76.4%
Applied egg-rr76.4%
Taylor expanded in x.im around 0 74.7%
associate-*r/76.4%
*-commutative76.4%
associate-/r/79.4%
Simplified79.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -2.15e+122)
(and (not (<= y.im -1.4e+100))
(or (<= y.im -4e-55) (not (<= y.im 3e+55)))))
(/ (- (* (/ x.im y.im) y.re) 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.15e+122) || (!(y_46_im <= -1.4e+100) && ((y_46_im <= -4e-55) || !(y_46_im <= 3e+55)))) {
tmp = (((x_46_im / y_46_im) * y_46_re) - 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.15d+122)) .or. (.not. (y_46im <= (-1.4d+100))) .and. (y_46im <= (-4d-55)) .or. (.not. (y_46im <= 3d+55))) then
tmp = (((x_46im / y_46im) * y_46re) - 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.15e+122) || (!(y_46_im <= -1.4e+100) && ((y_46_im <= -4e-55) || !(y_46_im <= 3e+55)))) {
tmp = (((x_46_im / y_46_im) * y_46_re) - 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.15e+122) or (not (y_46_im <= -1.4e+100) and ((y_46_im <= -4e-55) or not (y_46_im <= 3e+55))): tmp = (((x_46_im / y_46_im) * y_46_re) - 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.15e+122) || (!(y_46_im <= -1.4e+100) && ((y_46_im <= -4e-55) || !(y_46_im <= 3e+55)))) tmp = Float64(Float64(Float64(Float64(x_46_im / y_46_im) * y_46_re) - 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.15e+122) || (~((y_46_im <= -1.4e+100)) && ((y_46_im <= -4e-55) || ~((y_46_im <= 3e+55))))) tmp = (((x_46_im / y_46_im) * y_46_re) - 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.15e+122], And[N[Not[LessEqual[y$46$im, -1.4e+100]], $MachinePrecision], Or[LessEqual[y$46$im, -4e-55], N[Not[LessEqual[y$46$im, 3e+55]], $MachinePrecision]]]], N[(N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * y$46$re), $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.15 \cdot 10^{+122} \lor \neg \left(y.im \leq -1.4 \cdot 10^{+100}\right) \land \left(y.im \leq -4 \cdot 10^{-55} \lor \neg \left(y.im \leq 3 \cdot 10^{+55}\right)\right):\\
\;\;\;\;\frac{\frac{x.im}{y.im} \cdot y.re - 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.14999999999999986e122 or -1.3999999999999999e100 < y.im < -3.99999999999999998e-55 or 3.00000000000000017e55 < y.im Initial program 51.5%
Taylor expanded in y.re around 0 71.3%
+-commutative71.3%
mul-1-neg71.3%
unsub-neg71.3%
unpow271.3%
associate-/r*74.8%
div-sub74.8%
associate-/l*78.3%
Simplified78.3%
clear-num78.3%
un-div-inv78.3%
Applied egg-rr78.3%
associate-/r/79.7%
Simplified79.7%
if -2.14999999999999986e122 < y.im < -1.3999999999999999e100 or -3.99999999999999998e-55 < y.im < 3.00000000000000017e55Initial program 73.2%
Taylor expanded in y.re around inf 86.4%
remove-double-neg86.4%
mul-1-neg86.4%
neg-mul-186.4%
distribute-lft-in86.4%
mul-1-neg86.4%
distribute-neg-in86.4%
mul-1-neg86.4%
remove-double-neg86.4%
unsub-neg86.4%
associate-/l*86.7%
Simplified86.7%
Final simplification82.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -7.8e+121)
(and (not (<= y.im -1.32e+100))
(or (<= y.im -4.5e-55) (not (<= y.im 4.6e+55)))))
(/ (- (* 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 <= -7.8e+121) || (!(y_46_im <= -1.32e+100) && ((y_46_im <= -4.5e-55) || !(y_46_im <= 4.6e+55)))) {
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 <= (-7.8d+121)) .or. (.not. (y_46im <= (-1.32d+100))) .and. (y_46im <= (-4.5d-55)) .or. (.not. (y_46im <= 4.6d+55))) 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 <= -7.8e+121) || (!(y_46_im <= -1.32e+100) && ((y_46_im <= -4.5e-55) || !(y_46_im <= 4.6e+55)))) {
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 <= -7.8e+121) or (not (y_46_im <= -1.32e+100) and ((y_46_im <= -4.5e-55) or not (y_46_im <= 4.6e+55))): 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 <= -7.8e+121) || (!(y_46_im <= -1.32e+100) && ((y_46_im <= -4.5e-55) || !(y_46_im <= 4.6e+55)))) 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 <= -7.8e+121) || (~((y_46_im <= -1.32e+100)) && ((y_46_im <= -4.5e-55) || ~((y_46_im <= 4.6e+55))))) 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, -7.8e+121], And[N[Not[LessEqual[y$46$im, -1.32e+100]], $MachinePrecision], Or[LessEqual[y$46$im, -4.5e-55], N[Not[LessEqual[y$46$im, 4.6e+55]], $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 -7.8 \cdot 10^{+121} \lor \neg \left(y.im \leq -1.32 \cdot 10^{+100}\right) \land \left(y.im \leq -4.5 \cdot 10^{-55} \lor \neg \left(y.im \leq 4.6 \cdot 10^{+55}\right)\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 < -7.79999999999999967e121 or -1.32e100 < y.im < -4.4999999999999997e-55 or 4.59999999999999975e55 < y.im Initial program 51.5%
Taylor expanded in y.re around 0 71.3%
+-commutative71.3%
mul-1-neg71.3%
unsub-neg71.3%
unpow271.3%
associate-/r*74.8%
div-sub74.8%
associate-/l*78.3%
Simplified78.3%
if -7.79999999999999967e121 < y.im < -1.32e100 or -4.4999999999999997e-55 < y.im < 4.59999999999999975e55Initial program 73.2%
Taylor expanded in y.re around inf 86.4%
remove-double-neg86.4%
mul-1-neg86.4%
neg-mul-186.4%
distribute-lft-in86.4%
mul-1-neg86.4%
distribute-neg-in86.4%
mul-1-neg86.4%
remove-double-neg86.4%
unsub-neg86.4%
associate-/l*86.7%
Simplified86.7%
Final simplification82.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -8.1e+121)
(not
(or (<= y.im -1.42e+100)
(and (not (<= y.im -1.2e+45)) (<= y.im 6.2e+118)))))
(/ 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 <= -8.1e+121) || !((y_46_im <= -1.42e+100) || (!(y_46_im <= -1.2e+45) && (y_46_im <= 6.2e+118)))) {
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 <= (-8.1d+121)) .or. (.not. (y_46im <= (-1.42d+100)) .or. (.not. (y_46im <= (-1.2d+45))) .and. (y_46im <= 6.2d+118))) 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 <= -8.1e+121) || !((y_46_im <= -1.42e+100) || (!(y_46_im <= -1.2e+45) && (y_46_im <= 6.2e+118)))) {
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 <= -8.1e+121) or not ((y_46_im <= -1.42e+100) or (not (y_46_im <= -1.2e+45) and (y_46_im <= 6.2e+118))): 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 <= -8.1e+121) || !((y_46_im <= -1.42e+100) || (!(y_46_im <= -1.2e+45) && (y_46_im <= 6.2e+118)))) 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 <= -8.1e+121) || ~(((y_46_im <= -1.42e+100) || (~((y_46_im <= -1.2e+45)) && (y_46_im <= 6.2e+118))))) 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, -8.1e+121], N[Not[Or[LessEqual[y$46$im, -1.42e+100], And[N[Not[LessEqual[y$46$im, -1.2e+45]], $MachinePrecision], LessEqual[y$46$im, 6.2e+118]]]], $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 -8.1 \cdot 10^{+121} \lor \neg \left(y.im \leq -1.42 \cdot 10^{+100} \lor \neg \left(y.im \leq -1.2 \cdot 10^{+45}\right) \land y.im \leq 6.2 \cdot 10^{+118}\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 < -8.09999999999999969e121 or -1.41999999999999999e100 < y.im < -1.19999999999999995e45 or 6.19999999999999973e118 < y.im Initial program 45.9%
Taylor expanded in y.re around 0 77.9%
associate-*r/77.9%
neg-mul-177.9%
Simplified77.9%
if -8.09999999999999969e121 < y.im < -1.41999999999999999e100 or -1.19999999999999995e45 < y.im < 6.19999999999999973e118Initial program 70.8%
Taylor expanded in y.re around inf 75.0%
remove-double-neg75.0%
mul-1-neg75.0%
neg-mul-175.0%
distribute-lft-in75.0%
mul-1-neg75.0%
distribute-neg-in75.0%
mul-1-neg75.0%
remove-double-neg75.0%
unsub-neg75.0%
associate-/l*76.0%
Simplified76.0%
Final simplification76.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.2e+46) (not (<= y.re 3.9e-54))) (/ x.im y.re) (/ x.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_re <= -1.2e+46) || !(y_46_re <= 3.9e-54)) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_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_46re <= (-1.2d+46)) .or. (.not. (y_46re <= 3.9d-54))) then
tmp = x_46im / y_46re
else
tmp = x_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_re <= -1.2e+46) || !(y_46_re <= 3.9e-54)) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_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_re <= -1.2e+46) or not (y_46_re <= 3.9e-54): tmp = x_46_im / y_46_re else: tmp = x_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_re <= -1.2e+46) || !(y_46_re <= 3.9e-54)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(x_46_re / Float64(-y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.2e+46) || ~((y_46_re <= 3.9e-54))) tmp = x_46_im / y_46_re; else tmp = x_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$re, -1.2e+46], N[Not[LessEqual[y$46$re, 3.9e-54]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(x$46$re / (-y$46$im)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.2 \cdot 10^{+46} \lor \neg \left(y.re \leq 3.9 \cdot 10^{-54}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -1.20000000000000004e46 or 3.9e-54 < y.re Initial program 48.9%
Taylor expanded in y.re around inf 63.9%
if -1.20000000000000004e46 < y.re < 3.9e-54Initial program 73.1%
Taylor expanded in y.re around 0 67.0%
associate-*r/67.0%
neg-mul-167.0%
Simplified67.0%
Final simplification65.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.05e+124) (not (<= y.im 6.4e+121))) (/ 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 <= -1.05e+124) || !(y_46_im <= 6.4e+121)) {
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 <= (-1.05d+124)) .or. (.not. (y_46im <= 6.4d+121))) 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 <= -1.05e+124) || !(y_46_im <= 6.4e+121)) {
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 <= -1.05e+124) or not (y_46_im <= 6.4e+121): 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 <= -1.05e+124) || !(y_46_im <= 6.4e+121)) tmp = Float64(x_46_re / 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 <= -1.05e+124) || ~((y_46_im <= 6.4e+121))) 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, -1.05e+124], N[Not[LessEqual[y$46$im, 6.4e+121]], $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 -1.05 \cdot 10^{+124} \lor \neg \left(y.im \leq 6.4 \cdot 10^{+121}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.05000000000000006e124 or 6.3999999999999999e121 < y.im Initial program 41.3%
Taylor expanded in x.im around inf 35.0%
mul-1-neg35.0%
unsub-neg35.0%
associate-/l*25.6%
Simplified25.6%
*-commutative25.6%
add-sqr-sqrt25.6%
hypot-undefine25.6%
hypot-undefine25.6%
times-frac58.2%
cancel-sign-sub-inv58.2%
clear-num58.3%
un-div-inv58.2%
add-sqr-sqrt37.1%
sqrt-unprod44.8%
sqr-neg44.8%
sqrt-unprod13.2%
add-sqr-sqrt35.8%
Applied egg-rr35.8%
Taylor expanded in y.re around 0 34.1%
if -1.05000000000000006e124 < y.im < 6.3999999999999999e121Initial program 71.5%
Taylor expanded in y.re around inf 51.5%
Final simplification45.6%
(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 61.4%
Taylor expanded in y.re around inf 38.0%
herbie shell --seed 2024111
(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))))