
(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)) (- (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)) / -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(-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[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $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 \frac{\frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)}}{-\mathsf{hypot}\left(y.im, y.re\right)}\right)
\end{array}
Initial program 56.8%
div-sub54.7%
*-commutative54.7%
add-sqr-sqrt54.7%
times-frac58.3%
fma-neg58.3%
hypot-define58.3%
hypot-define71.9%
associate-/l*74.4%
add-sqr-sqrt74.4%
pow274.4%
hypot-define74.4%
Applied egg-rr74.4%
*-un-lft-identity74.4%
unpow274.4%
times-frac95.7%
Applied egg-rr95.7%
associate-*l/95.7%
*-lft-identity95.7%
hypot-undefine74.4%
unpow274.4%
unpow274.4%
+-commutative74.4%
unpow274.4%
unpow274.4%
hypot-define95.7%
hypot-undefine74.4%
unpow274.4%
unpow274.4%
+-commutative74.4%
unpow274.4%
unpow274.4%
hypot-define95.7%
Simplified95.7%
Final simplification95.7%
(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)))))
(t_1 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.im -3.3e+160)
t_1
(if (<= y.im -7.5e-124)
t_0
(if (<= y.im 9.5e-168)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1.02e+155) 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 = 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 t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -3.3e+160) {
tmp = t_1;
} else if (y_46_im <= -7.5e-124) {
tmp = t_0;
} else if (y_46_im <= 9.5e-168) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.02e+155) {
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 = 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)))) 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 <= -3.3e+160) tmp = t_1; elseif (y_46_im <= -7.5e-124) tmp = t_0; elseif (y_46_im <= 9.5e-168) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 1.02e+155) tmp = t_0; else tmp = t_1; 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]}, 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, -3.3e+160], t$95$1, If[LessEqual[y$46$im, -7.5e-124], t$95$0, If[LessEqual[y$46$im, 9.5e-168], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.02e+155], t$95$0, t$95$1]]]]]]
\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)\\
t_1 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -3.3 \cdot 10^{+160}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -7.5 \cdot 10^{-124}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 9.5 \cdot 10^{-168}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.02 \cdot 10^{+155}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -3.2999999999999997e160 or 1.02e155 < y.im Initial program 22.5%
div-sub22.5%
*-commutative22.5%
add-sqr-sqrt22.5%
times-frac22.8%
fma-neg22.8%
hypot-define22.8%
hypot-define31.9%
associate-/l*36.7%
add-sqr-sqrt36.7%
pow236.7%
hypot-define36.7%
Applied egg-rr36.7%
Taylor expanded in y.im around inf 86.4%
associate-/l*94.9%
Simplified94.9%
if -3.2999999999999997e160 < y.im < -7.4999999999999996e-124 or 9.49999999999999918e-168 < y.im < 1.02e155Initial program 73.5%
div-sub73.5%
*-commutative73.5%
add-sqr-sqrt73.5%
times-frac77.5%
fma-neg77.5%
hypot-define77.5%
hypot-define90.9%
associate-/l*95.7%
add-sqr-sqrt95.7%
pow295.7%
hypot-define95.7%
Applied egg-rr95.7%
if -7.4999999999999996e-124 < y.im < 9.49999999999999918e-168Initial program 61.4%
div-sub53.6%
*-commutative53.6%
add-sqr-sqrt53.6%
times-frac59.7%
fma-neg59.7%
hypot-define59.7%
hypot-define78.3%
associate-/l*74.5%
add-sqr-sqrt74.5%
pow274.5%
hypot-define74.5%
Applied egg-rr74.5%
Taylor expanded in y.re around inf 90.3%
mul-1-neg90.3%
unsub-neg90.3%
associate-/l*90.2%
Simplified90.2%
associate-*r/90.3%
add-sqr-sqrt42.8%
sqrt-unprod67.1%
sqr-neg67.1%
sqrt-unprod37.3%
add-sqr-sqrt66.9%
*-commutative66.9%
add-sqr-sqrt37.3%
sqrt-unprod67.1%
sqr-neg67.1%
sqrt-unprod42.8%
add-sqr-sqrt90.3%
Applied egg-rr90.3%
Final simplification94.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/
(/ (- (* y.re x.im) (* y.im x.re)) (hypot y.re y.im))
(hypot y.re y.im)))
(t_1 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.im -4.8e+98)
t_1
(if (<= y.im -2.1e-164)
t_0
(if (<= y.im 2.7e-170)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 1.3e+145) 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)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, 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 <= -4.8e+98) {
tmp = t_1;
} else if (y_46_im <= -2.1e-164) {
tmp = t_0;
} else if (y_46_im <= 2.7e-170) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1.3e+145) {
tmp = t_0;
} else {
tmp = t_1;
}
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 = (((y_46_re * x_46_im) - (y_46_im * x_46_re)) / Math.hypot(y_46_re, y_46_im)) / Math.hypot(y_46_re, 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 <= -4.8e+98) {
tmp = t_1;
} else if (y_46_im <= -2.1e-164) {
tmp = t_0;
} else if (y_46_im <= 2.7e-170) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1.3e+145) {
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)) / math.hypot(y_46_re, y_46_im)) / math.hypot(y_46_re, 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 <= -4.8e+98: tmp = t_1 elif y_46_im <= -2.1e-164: tmp = t_0 elif y_46_im <= 2.7e-170: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 1.3e+145: 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(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, 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 <= -4.8e+98) tmp = t_1; elseif (y_46_im <= -2.1e-164) tmp = t_0; elseif (y_46_im <= 2.7e-170) 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.3e+145) 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)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, 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 <= -4.8e+98) tmp = t_1; elseif (y_46_im <= -2.1e-164) tmp = t_0; elseif (y_46_im <= 2.7e-170) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 1.3e+145) 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[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $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, -4.8e+98], t$95$1, If[LessEqual[y$46$im, -2.1e-164], t$95$0, If[LessEqual[y$46$im, 2.7e-170], 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.3e+145], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y.re \cdot x.im - y.im \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -4.8 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -2.1 \cdot 10^{-164}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{-170}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.3 \cdot 10^{+145}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -4.7999999999999997e98 or 1.30000000000000001e145 < y.im Initial program 27.8%
div-sub27.8%
*-commutative27.8%
add-sqr-sqrt27.8%
times-frac29.2%
fma-neg29.2%
hypot-define29.2%
hypot-define38.6%
associate-/l*48.1%
add-sqr-sqrt48.1%
pow248.1%
hypot-define48.1%
Applied egg-rr48.1%
Taylor expanded in y.im around inf 85.0%
associate-/l*93.0%
Simplified93.0%
if -4.7999999999999997e98 < y.im < -2.0999999999999999e-164 or 2.6999999999999999e-170 < y.im < 1.30000000000000001e145Initial program 76.2%
*-un-lft-identity76.2%
add-sqr-sqrt76.2%
times-frac76.3%
hypot-define76.3%
hypot-define87.5%
Applied egg-rr87.5%
associate-*l/87.6%
*-un-lft-identity87.6%
*-commutative87.6%
*-commutative87.6%
Applied egg-rr87.6%
if -2.0999999999999999e-164 < y.im < 2.6999999999999999e-170Initial program 62.3%
div-sub53.8%
*-commutative53.8%
add-sqr-sqrt53.8%
times-frac60.5%
fma-neg60.5%
hypot-define60.5%
hypot-define80.9%
associate-/l*76.7%
add-sqr-sqrt76.7%
pow276.7%
hypot-define76.7%
Applied egg-rr76.7%
Taylor expanded in y.re around inf 92.4%
mul-1-neg92.4%
unsub-neg92.4%
associate-/l*93.9%
Simplified93.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re)))
(t_1 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.im -6.5e+83)
t_1
(if (<= y.im -6e-123)
(/ t_0 (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 9e-141)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 2.4e+142)
(* t_0 (/ 1.0 (pow (hypot y.re y.im) 2.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);
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -6.5e+83) {
tmp = t_1;
} else if (y_46_im <= -6e-123) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 9e-141) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 2.4e+142) {
tmp = t_0 * (1.0 / pow(hypot(y_46_re, y_46_im), 2.0));
} else {
tmp = t_1;
}
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 = (y_46_re * x_46_im) - (y_46_im * x_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 <= -6.5e+83) {
tmp = t_1;
} else if (y_46_im <= -6e-123) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 9e-141) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 2.4e+142) {
tmp = t_0 * (1.0 / Math.pow(Math.hypot(y_46_re, y_46_im), 2.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) t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im tmp = 0 if y_46_im <= -6.5e+83: tmp = t_1 elif y_46_im <= -6e-123: tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_im <= 9e-141: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_im <= 2.4e+142: tmp = t_0 * (1.0 / math.pow(math.hypot(y_46_re, y_46_im), 2.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(y_46_re * x_46_im) - Float64(y_46_im * x_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 <= -6.5e+83) tmp = t_1; elseif (y_46_im <= -6e-123) tmp = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 9e-141) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 2.4e+142) tmp = Float64(t_0 * Float64(1.0 / (hypot(y_46_re, y_46_im) ^ 2.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); t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_im <= -6.5e+83) tmp = t_1; elseif (y_46_im <= -6e-123) tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_im <= 9e-141) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_im <= 2.4e+142) tmp = t_0 * (1.0 / (hypot(y_46_re, y_46_im) ^ 2.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[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $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, -6.5e+83], t$95$1, If[LessEqual[y$46$im, -6e-123], 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$im, 9e-141], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 2.4e+142], N[(t$95$0 * N[(1.0 / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
t_1 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -6.5 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -6 \cdot 10^{-123}:\\
\;\;\;\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 9 \cdot 10^{-141}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 2.4 \cdot 10^{+142}:\\
\;\;\;\;t\_0 \cdot \frac{1}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -6.5000000000000003e83 or 2.3999999999999999e142 < y.im Initial program 29.3%
div-sub29.3%
*-commutative29.3%
add-sqr-sqrt29.3%
times-frac30.6%
fma-neg30.6%
hypot-define30.6%
hypot-define41.6%
associate-/l*51.5%
add-sqr-sqrt51.5%
pow251.5%
hypot-define51.5%
Applied egg-rr51.5%
Taylor expanded in y.im around inf 82.8%
associate-/l*90.3%
Simplified90.3%
if -6.5000000000000003e83 < y.im < -5.99999999999999968e-123Initial program 82.1%
if -5.99999999999999968e-123 < y.im < 9.0000000000000001e-141Initial program 61.5%
div-sub54.1%
*-commutative54.1%
add-sqr-sqrt54.1%
times-frac60.1%
fma-neg60.1%
hypot-define60.1%
hypot-define79.2%
associate-/l*75.5%
add-sqr-sqrt75.5%
pow275.5%
hypot-define75.5%
Applied egg-rr75.5%
Taylor expanded in y.re around inf 90.7%
mul-1-neg90.7%
unsub-neg90.7%
associate-/l*90.6%
Simplified90.6%
associate-*r/90.7%
add-sqr-sqrt43.8%
sqrt-unprod68.5%
sqr-neg68.5%
sqrt-unprod37.1%
add-sqr-sqrt68.3%
*-commutative68.3%
add-sqr-sqrt37.1%
sqrt-unprod68.5%
sqr-neg68.5%
sqrt-unprod43.8%
add-sqr-sqrt90.7%
Applied egg-rr90.7%
if 9.0000000000000001e-141 < y.im < 2.3999999999999999e142Initial program 78.1%
clear-num78.0%
associate-/r/78.3%
add-sqr-sqrt78.3%
pow278.3%
hypot-define78.3%
Applied egg-rr78.3%
Final simplification86.5%
(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 -4.6e+85)
t_1
(if (<= y.im -5.4e-108)
t_0
(if (<= y.im 1.22e-143)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 5.9e+144) 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 <= -4.6e+85) {
tmp = t_1;
} else if (y_46_im <= -5.4e-108) {
tmp = t_0;
} else if (y_46_im <= 1.22e-143) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 5.9e+144) {
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 <= (-4.6d+85)) then
tmp = t_1
else if (y_46im <= (-5.4d-108)) then
tmp = t_0
else if (y_46im <= 1.22d-143) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if (y_46im <= 5.9d+144) 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 <= -4.6e+85) {
tmp = t_1;
} else if (y_46_im <= -5.4e-108) {
tmp = t_0;
} else if (y_46_im <= 1.22e-143) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 5.9e+144) {
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 <= -4.6e+85: tmp = t_1 elif y_46_im <= -5.4e-108: tmp = t_0 elif y_46_im <= 1.22e-143: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_im <= 5.9e+144: 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 <= -4.6e+85) tmp = t_1; elseif (y_46_im <= -5.4e-108) tmp = t_0; elseif (y_46_im <= 1.22e-143) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 5.9e+144) 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 <= -4.6e+85) tmp = t_1; elseif (y_46_im <= -5.4e-108) tmp = t_0; elseif (y_46_im <= 1.22e-143) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_im <= 5.9e+144) 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, -4.6e+85], t$95$1, If[LessEqual[y$46$im, -5.4e-108], t$95$0, If[LessEqual[y$46$im, 1.22e-143], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5.9e+144], 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 -4.6 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -5.4 \cdot 10^{-108}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.22 \cdot 10^{-143}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 5.9 \cdot 10^{+144}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -4.5999999999999998e85 or 5.89999999999999988e144 < y.im Initial program 29.3%
div-sub29.3%
*-commutative29.3%
add-sqr-sqrt29.3%
times-frac30.6%
fma-neg30.6%
hypot-define30.6%
hypot-define41.6%
associate-/l*51.5%
add-sqr-sqrt51.5%
pow251.5%
hypot-define51.5%
Applied egg-rr51.5%
Taylor expanded in y.im around inf 82.8%
associate-/l*90.3%
Simplified90.3%
if -4.5999999999999998e85 < y.im < -5.4000000000000001e-108 or 1.22e-143 < y.im < 5.89999999999999988e144Initial program 79.7%
if -5.4000000000000001e-108 < y.im < 1.22e-143Initial program 61.5%
div-sub54.1%
*-commutative54.1%
add-sqr-sqrt54.1%
times-frac60.1%
fma-neg60.1%
hypot-define60.1%
hypot-define79.2%
associate-/l*75.5%
add-sqr-sqrt75.5%
pow275.5%
hypot-define75.5%
Applied egg-rr75.5%
Taylor expanded in y.re around inf 90.7%
mul-1-neg90.7%
unsub-neg90.7%
associate-/l*90.6%
Simplified90.6%
associate-*r/90.7%
add-sqr-sqrt43.8%
sqrt-unprod68.5%
sqr-neg68.5%
sqrt-unprod37.1%
add-sqr-sqrt68.3%
*-commutative68.3%
add-sqr-sqrt37.1%
sqrt-unprod68.5%
sqr-neg68.5%
sqrt-unprod43.8%
add-sqr-sqrt90.7%
Applied egg-rr90.7%
Final simplification86.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.45e+90) (not (<= y.re 28500000000000.0))) (/ (- x.im (* y.im (/ x.re y.re))) y.re) (/ (- (* x.im (/ y.re y.im)) 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.45e+90) || !(y_46_re <= 28500000000000.0)) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - 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.45d+90)) .or. (.not. (y_46re <= 28500000000000.0d0))) then
tmp = (x_46im - (y_46im * (x_46re / y_46re))) / y_46re
else
tmp = ((x_46im * (y_46re / y_46im)) - 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.45e+90) || !(y_46_re <= 28500000000000.0)) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - 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.45e+90) or not (y_46_re <= 28500000000000.0): tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re else: tmp = ((x_46_im * (y_46_re / y_46_im)) - 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.45e+90) || !(y_46_re <= 28500000000000.0)) tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / y_46_re); else tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_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_re <= -1.45e+90) || ~((y_46_re <= 28500000000000.0))) tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re; else tmp = ((x_46_im * (y_46_re / y_46_im)) - 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.45e+90], N[Not[LessEqual[y$46$re, 28500000000000.0]], $MachinePrecision]], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{+90} \lor \neg \left(y.re \leq 28500000000000\right):\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -1.4500000000000001e90 or 2.85e13 < y.re Initial program 47.1%
Taylor expanded in y.re around inf 73.9%
mul-1-neg73.9%
unsub-neg73.9%
*-commutative73.9%
associate-/l*80.5%
Simplified80.5%
if -1.4500000000000001e90 < y.re < 2.85e13Initial program 63.7%
div-sub60.1%
*-commutative60.1%
add-sqr-sqrt60.1%
times-frac61.2%
fma-neg61.2%
hypot-define61.2%
hypot-define64.9%
associate-/l*67.5%
add-sqr-sqrt67.5%
pow267.5%
hypot-define67.5%
Applied egg-rr67.5%
Taylor expanded in y.im around inf 81.7%
associate-/l*83.4%
Simplified83.4%
Final simplification82.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4.9e+32) (not (<= y.im 5.8e+21))) (/ x.re (- 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_im <= -4.9e+32) || !(y_46_im <= 5.8e+21)) {
tmp = x_46_re / -y_46_im;
} 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) :: tmp
if ((y_46im <= (-4.9d+32)) .or. (.not. (y_46im <= 5.8d+21))) then
tmp = x_46re / -y_46im
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 tmp;
if ((y_46_im <= -4.9e+32) || !(y_46_im <= 5.8e+21)) {
tmp = x_46_re / -y_46_im;
} 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): tmp = 0 if (y_46_im <= -4.9e+32) or not (y_46_im <= 5.8e+21): tmp = x_46_re / -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_im <= -4.9e+32) || !(y_46_im <= 5.8e+21)) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * 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) tmp = 0.0; if ((y_46_im <= -4.9e+32) || ~((y_46_im <= 5.8e+21))) tmp = x_46_re / -y_46_im; 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_] := If[Or[LessEqual[y$46$im, -4.9e+32], N[Not[LessEqual[y$46$im, 5.8e+21]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.9 \cdot 10^{+32} \lor \neg \left(y.im \leq 5.8 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -4.9000000000000001e32 or 5.8e21 < y.im Initial program 43.8%
Taylor expanded in y.re around 0 73.2%
associate-*r/73.2%
neg-mul-173.2%
Simplified73.2%
if -4.9000000000000001e32 < y.im < 5.8e21Initial program 68.2%
div-sub64.3%
*-commutative64.3%
add-sqr-sqrt64.3%
times-frac70.1%
fma-neg70.1%
hypot-define70.1%
hypot-define87.7%
associate-/l*85.7%
add-sqr-sqrt85.7%
pow285.7%
hypot-define85.7%
Applied egg-rr85.7%
Taylor expanded in y.re around inf 75.7%
mul-1-neg75.7%
unsub-neg75.7%
associate-/l*75.6%
Simplified75.6%
associate-*r/75.7%
add-sqr-sqrt41.1%
sqrt-unprod55.8%
sqr-neg55.8%
sqrt-unprod27.6%
add-sqr-sqrt56.8%
*-commutative56.8%
add-sqr-sqrt27.6%
sqrt-unprod55.8%
sqr-neg55.8%
sqrt-unprod41.1%
add-sqr-sqrt75.7%
Applied egg-rr75.7%
Final simplification74.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.18e+36) (not (<= y.im 5.7e+21))) (/ 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 <= -1.18e+36) || !(y_46_im <= 5.7e+21)) {
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 <= (-1.18d+36)) .or. (.not. (y_46im <= 5.7d+21))) 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 <= -1.18e+36) || !(y_46_im <= 5.7e+21)) {
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 <= -1.18e+36) or not (y_46_im <= 5.7e+21): 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 <= -1.18e+36) || !(y_46_im <= 5.7e+21)) 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 <= -1.18e+36) || ~((y_46_im <= 5.7e+21))) 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, -1.18e+36], N[Not[LessEqual[y$46$im, 5.7e+21]], $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 -1.18 \cdot 10^{+36} \lor \neg \left(y.im \leq 5.7 \cdot 10^{+21}\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 < -1.17999999999999997e36 or 5.7e21 < y.im Initial program 43.8%
Taylor expanded in y.re around 0 73.2%
associate-*r/73.2%
neg-mul-173.2%
Simplified73.2%
if -1.17999999999999997e36 < y.im < 5.7e21Initial program 68.2%
div-sub64.3%
*-commutative64.3%
add-sqr-sqrt64.3%
times-frac70.1%
fma-neg70.1%
hypot-define70.1%
hypot-define87.7%
associate-/l*85.7%
add-sqr-sqrt85.7%
pow285.7%
hypot-define85.7%
Applied egg-rr85.7%
Taylor expanded in y.re around inf 75.7%
mul-1-neg75.7%
unsub-neg75.7%
associate-/l*75.6%
Simplified75.6%
Final simplification74.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.7e+111) (not (<= y.re 45000.0))) (/ 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 <= -3.7e+111) || !(y_46_re <= 45000.0)) {
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 <= (-3.7d+111)) .or. (.not. (y_46re <= 45000.0d0))) 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 <= -3.7e+111) || !(y_46_re <= 45000.0)) {
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 <= -3.7e+111) or not (y_46_re <= 45000.0): 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 <= -3.7e+111) || !(y_46_re <= 45000.0)) 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 <= -3.7e+111) || ~((y_46_re <= 45000.0))) 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, -3.7e+111], N[Not[LessEqual[y$46$re, 45000.0]], $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 -3.7 \cdot 10^{+111} \lor \neg \left(y.re \leq 45000\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -3.7000000000000003e111 or 45000 < y.re Initial program 46.5%
Taylor expanded in y.re around inf 67.2%
if -3.7000000000000003e111 < y.re < 45000Initial program 63.7%
Taylor expanded in y.re around 0 68.1%
associate-*r/68.1%
neg-mul-168.1%
Simplified68.1%
Final simplification67.7%
(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 56.8%
Taylor expanded in y.re around inf 37.6%
herbie shell --seed 2024146
(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))))