
(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 (/ y.re (hypot y.re y.im)))
(t_1 (/ x.im (hypot y.re y.im)))
(t_2 (fma t_0 t_1 (* (/ y.im (pow (hypot y.re y.im) 2.0)) (- x.re))))
(t_3 (/ (- x.re) y.im)))
(if (<= y.im -5e+168)
(fma t_0 t_1 t_3)
(if (<= y.im -4e-157)
t_2
(if (<= y.im 1.5e-187)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 1.8e+111) t_2 (fma (cbrt (pow t_0 3.0)) t_1 t_3)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re / hypot(y_46_re, y_46_im);
double t_1 = x_46_im / hypot(y_46_re, y_46_im);
double t_2 = fma(t_0, t_1, ((y_46_im / pow(hypot(y_46_re, y_46_im), 2.0)) * -x_46_re));
double t_3 = -x_46_re / y_46_im;
double tmp;
if (y_46_im <= -5e+168) {
tmp = fma(t_0, t_1, t_3);
} else if (y_46_im <= -4e-157) {
tmp = t_2;
} else if (y_46_im <= 1.5e-187) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1.8e+111) {
tmp = t_2;
} else {
tmp = fma(cbrt(pow(t_0, 3.0)), t_1, t_3);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re / hypot(y_46_re, y_46_im)) t_1 = Float64(x_46_im / hypot(y_46_re, y_46_im)) t_2 = fma(t_0, t_1, Float64(Float64(y_46_im / (hypot(y_46_re, y_46_im) ^ 2.0)) * Float64(-x_46_re))) t_3 = Float64(Float64(-x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -5e+168) tmp = fma(t_0, t_1, t_3); elseif (y_46_im <= -4e-157) tmp = t_2; elseif (y_46_im <= 1.5e-187) 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.8e+111) tmp = t_2; else tmp = fma(cbrt((t_0 ^ 3.0)), t_1, t_3); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * t$95$1 + N[(N[(y$46$im / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * (-x$46$re)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -5e+168], N[(t$95$0 * t$95$1 + t$95$3), $MachinePrecision], If[LessEqual[y$46$im, -4e-157], t$95$2, If[LessEqual[y$46$im, 1.5e-187], 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.8e+111], t$95$2, N[(N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision] * t$95$1 + t$95$3), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_2 := \mathsf{fma}\left(t\_0, t\_1, \frac{y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \cdot \left(-x.re\right)\right)\\
t_3 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -5 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_1, t\_3\right)\\
\mathbf{elif}\;y.im \leq -4 \cdot 10^{-157}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 1.5 \cdot 10^{-187}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+111}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{{t\_0}^{3}}, t\_1, t\_3\right)\\
\end{array}
\end{array}
if y.im < -4.99999999999999967e168Initial program 26.5%
div-sub26.5%
*-commutative26.5%
add-sqr-sqrt26.5%
times-frac27.0%
fma-neg27.0%
hypot-define27.0%
hypot-define44.5%
associate-/l*45.9%
add-sqr-sqrt45.9%
pow245.9%
hypot-define45.9%
Applied egg-rr45.9%
Taylor expanded in y.im around inf 99.9%
if -4.99999999999999967e168 < y.im < -3.99999999999999977e-157 or 1.50000000000000002e-187 < y.im < 1.8000000000000001e111Initial program 72.5%
div-sub71.7%
*-commutative71.7%
add-sqr-sqrt71.7%
times-frac75.2%
fma-neg75.2%
hypot-define75.2%
hypot-define91.5%
associate-/l*95.2%
add-sqr-sqrt95.2%
pow295.2%
hypot-define95.2%
Applied egg-rr95.2%
if -3.99999999999999977e-157 < y.im < 1.50000000000000002e-187Initial program 72.6%
Taylor expanded in y.re around inf 92.2%
remove-double-neg92.2%
mul-1-neg92.2%
neg-mul-192.2%
distribute-lft-in92.2%
mul-1-neg92.2%
distribute-neg-in92.2%
mul-1-neg92.2%
remove-double-neg92.2%
unsub-neg92.2%
associate-/l*93.8%
Simplified93.8%
if 1.8000000000000001e111 < y.im Initial program 36.0%
div-sub36.0%
*-commutative36.0%
add-sqr-sqrt36.0%
times-frac36.0%
fma-neg36.0%
hypot-define36.0%
hypot-define40.1%
associate-/l*43.8%
add-sqr-sqrt43.8%
pow243.8%
hypot-define43.8%
Applied egg-rr43.8%
add-cbrt-cube43.8%
pow343.8%
Applied egg-rr43.8%
Taylor expanded in y.im around inf 99.9%
Final simplification96.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ y.re (hypot y.re y.im)))
(t_1 (/ x.im (hypot y.re y.im)))
(t_2 (/ (- x.re) y.im)))
(if (<= y.im -3.8e+64)
(fma t_0 t_1 t_2)
(if (<= y.im -1.1e-157)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 3e-59)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 1e+112)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.im y.im (* y.re y.re)))
(fma (cbrt (pow t_0 3.0)) t_1 t_2)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = y_46_re / hypot(y_46_re, y_46_im);
double t_1 = x_46_im / hypot(y_46_re, y_46_im);
double t_2 = -x_46_re / y_46_im;
double tmp;
if (y_46_im <= -3.8e+64) {
tmp = fma(t_0, t_1, t_2);
} else if (y_46_im <= -1.1e-157) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 3e-59) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1e+112) {
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 {
tmp = fma(cbrt(pow(t_0, 3.0)), t_1, t_2);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(y_46_re / hypot(y_46_re, y_46_im)) t_1 = Float64(x_46_im / hypot(y_46_re, y_46_im)) t_2 = Float64(Float64(-x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -3.8e+64) tmp = fma(t_0, t_1, t_2); elseif (y_46_im <= -1.1e-157) tmp = 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))); elseif (y_46_im <= 3e-59) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 1e+112) 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))); else tmp = fma(cbrt((t_0 ^ 3.0)), t_1, t_2); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -3.8e+64], N[(t$95$0 * t$95$1 + t$95$2), $MachinePrecision], If[LessEqual[y$46$im, -1.1e-157], 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], If[LessEqual[y$46$im, 3e-59], 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, 1e+112], 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], N[(N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 1/3], $MachinePrecision] * t$95$1 + t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_2 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -3.8 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_1, t\_2\right)\\
\mathbf{elif}\;y.im \leq -1.1 \cdot 10^{-157}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 3 \cdot 10^{-59}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 10^{+112}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt[3]{{t\_0}^{3}}, t\_1, t\_2\right)\\
\end{array}
\end{array}
if y.im < -3.8000000000000001e64Initial program 44.6%
div-sub44.6%
*-commutative44.6%
add-sqr-sqrt44.6%
times-frac45.2%
fma-neg45.2%
hypot-define45.2%
hypot-define64.7%
associate-/l*67.4%
add-sqr-sqrt67.4%
pow267.4%
hypot-define67.4%
Applied egg-rr67.4%
Taylor expanded in y.im around inf 92.0%
if -3.8000000000000001e64 < y.im < -1.10000000000000005e-157Initial program 75.6%
if -1.10000000000000005e-157 < y.im < 3.0000000000000001e-59Initial program 69.0%
Taylor expanded in y.re around inf 88.6%
remove-double-neg88.6%
mul-1-neg88.6%
neg-mul-188.6%
distribute-lft-in88.6%
mul-1-neg88.6%
distribute-neg-in88.6%
mul-1-neg88.6%
remove-double-neg88.6%
unsub-neg88.6%
associate-/l*89.7%
Simplified89.7%
if 3.0000000000000001e-59 < y.im < 9.9999999999999993e111Initial program 82.2%
fma-neg82.4%
distribute-rgt-neg-out82.4%
+-commutative82.4%
fma-define82.4%
Simplified82.4%
if 9.9999999999999993e111 < y.im Initial program 33.1%
div-sub33.1%
*-commutative33.1%
add-sqr-sqrt33.1%
times-frac33.2%
fma-neg33.2%
hypot-define33.2%
hypot-define37.4%
associate-/l*41.3%
add-sqr-sqrt41.3%
pow241.3%
hypot-define41.3%
Applied egg-rr41.3%
add-cbrt-cube41.3%
pow341.3%
Applied egg-rr41.3%
Taylor expanded in y.im around inf 99.9%
Final simplification88.6%
(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))))
(if (<= y.im -8.5e+64)
t_0
(if (<= y.im -1.25e-154)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 1.75e-58)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 4.4e+111)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.im y.im (* y.re y.re)))
t_0))))))
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));
double tmp;
if (y_46_im <= -8.5e+64) {
tmp = t_0;
} else if (y_46_im <= -1.25e-154) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 1.75e-58) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 4.4e+111) {
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 {
tmp = t_0;
}
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(Float64(-x_46_re) / y_46_im)) tmp = 0.0 if (y_46_im <= -8.5e+64) tmp = t_0; elseif (y_46_im <= -1.25e-154) tmp = 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))); elseif (y_46_im <= 1.75e-58) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 4.4e+111) 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))); else tmp = t_0; 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) / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -8.5e+64], t$95$0, If[LessEqual[y$46$im, -1.25e-154], 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], If[LessEqual[y$46$im, 1.75e-58], 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, 4.4e+111], 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], t$95$0]]]]]
\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)}, \frac{-x.re}{y.im}\right)\\
\mathbf{if}\;y.im \leq -8.5 \cdot 10^{+64}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -1.25 \cdot 10^{-154}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.75 \cdot 10^{-58}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 4.4 \cdot 10^{+111}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -8.4999999999999998e64 or 4.39999999999999997e111 < y.im Initial program 39.2%
div-sub39.2%
*-commutative39.2%
add-sqr-sqrt39.2%
times-frac39.6%
fma-neg39.6%
hypot-define39.6%
hypot-define51.9%
associate-/l*55.1%
add-sqr-sqrt55.1%
pow255.1%
hypot-define55.1%
Applied egg-rr55.1%
Taylor expanded in y.im around inf 95.7%
if -8.4999999999999998e64 < y.im < -1.25000000000000005e-154Initial program 75.6%
if -1.25000000000000005e-154 < y.im < 1.75e-58Initial program 69.0%
Taylor expanded in y.re around inf 88.6%
remove-double-neg88.6%
mul-1-neg88.6%
neg-mul-188.6%
distribute-lft-in88.6%
mul-1-neg88.6%
distribute-neg-in88.6%
mul-1-neg88.6%
remove-double-neg88.6%
unsub-neg88.6%
associate-/l*89.7%
Simplified89.7%
if 1.75e-58 < y.im < 4.39999999999999997e111Initial program 82.2%
fma-neg82.4%
distribute-rgt-neg-out82.4%
+-commutative82.4%
fma-define82.4%
Simplified82.4%
Final simplification88.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -4.6e+126)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im -7.2e-156)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 2.5e-58)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 2.9e+111)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.im y.im (* y.re y.re)))
(fma (/ y.re y.im) (/ x.im (hypot 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_im <= -4.6e+126) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= -7.2e-156) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 2.5e-58) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 2.9e+111) {
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 {
tmp = fma((y_46_re / y_46_im), (x_46_im / hypot(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_im <= -4.6e+126) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= -7.2e-156) tmp = 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))); elseif (y_46_im <= 2.5e-58) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 2.9e+111) 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))); else tmp = fma(Float64(y_46_re / y_46_im), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(-x_46_re) / y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -4.6e+126], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -7.2e-156], 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], If[LessEqual[y$46$im, 2.5e-58], 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, 2.9e+111], 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], N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[((-x$46$re) / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.6 \cdot 10^{+126}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -7.2 \cdot 10^{-156}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 2.5 \cdot 10^{-58}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 2.9 \cdot 10^{+111}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.re}{y.im}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{-x.re}{y.im}\right)\\
\end{array}
\end{array}
if y.im < -4.6000000000000001e126Initial program 33.2%
Taylor expanded in y.re around 0 74.3%
+-commutative74.3%
mul-1-neg74.3%
unsub-neg74.3%
unpow274.3%
associate-/r*82.9%
div-sub82.9%
*-commutative82.9%
associate-/l*91.4%
Simplified91.4%
if -4.6000000000000001e126 < y.im < -7.19999999999999998e-156Initial program 73.6%
if -7.19999999999999998e-156 < y.im < 2.49999999999999989e-58Initial program 69.0%
Taylor expanded in y.re around inf 88.6%
remove-double-neg88.6%
mul-1-neg88.6%
neg-mul-188.6%
distribute-lft-in88.6%
mul-1-neg88.6%
distribute-neg-in88.6%
mul-1-neg88.6%
remove-double-neg88.6%
unsub-neg88.6%
associate-/l*89.7%
Simplified89.7%
if 2.49999999999999989e-58 < y.im < 2.9e111Initial program 82.2%
fma-neg82.4%
distribute-rgt-neg-out82.4%
+-commutative82.4%
fma-define82.4%
Simplified82.4%
if 2.9e111 < y.im Initial program 33.1%
div-sub33.1%
*-commutative33.1%
add-sqr-sqrt33.1%
times-frac33.2%
fma-neg33.2%
hypot-define33.2%
hypot-define37.4%
associate-/l*41.3%
add-sqr-sqrt41.3%
pow241.3%
hypot-define41.3%
Applied egg-rr41.3%
Taylor expanded in y.im around inf 99.9%
Taylor expanded in y.re around 0 98.2%
Final simplification86.8%
(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)))))
(if (<= y.im -1.8e+127)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im -5e-157)
t_0
(if (<= y.im 1.26e-58)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 3.3e+112)
t_0
(fma
(/ y.re y.im)
(/ x.im (hypot 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 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 tmp;
if (y_46_im <= -1.8e+127) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= -5e-157) {
tmp = t_0;
} else if (y_46_im <= 1.26e-58) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 3.3e+112) {
tmp = t_0;
} else {
tmp = fma((y_46_re / y_46_im), (x_46_im / hypot(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) 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))) tmp = 0.0 if (y_46_im <= -1.8e+127) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= -5e-157) tmp = t_0; elseif (y_46_im <= 1.26e-58) 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.3e+112) tmp = t_0; else tmp = fma(Float64(y_46_re / y_46_im), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(-x_46_re) / 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[(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]}, If[LessEqual[y$46$im, -1.8e+127], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -5e-157], t$95$0, If[LessEqual[y$46$im, 1.26e-58], 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.3e+112], t$95$0, N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[((-x$46$re) / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]
\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}\\
\mathbf{if}\;y.im \leq -1.8 \cdot 10^{+127}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -5 \cdot 10^{-157}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.26 \cdot 10^{-58}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 3.3 \cdot 10^{+112}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.re}{y.im}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{-x.re}{y.im}\right)\\
\end{array}
\end{array}
if y.im < -1.79999999999999989e127Initial program 33.2%
Taylor expanded in y.re around 0 74.3%
+-commutative74.3%
mul-1-neg74.3%
unsub-neg74.3%
unpow274.3%
associate-/r*82.9%
div-sub82.9%
*-commutative82.9%
associate-/l*91.4%
Simplified91.4%
if -1.79999999999999989e127 < y.im < -5.0000000000000002e-157 or 1.2600000000000001e-58 < y.im < 3.2999999999999999e112Initial program 77.2%
if -5.0000000000000002e-157 < y.im < 1.2600000000000001e-58Initial program 69.0%
Taylor expanded in y.re around inf 88.6%
remove-double-neg88.6%
mul-1-neg88.6%
neg-mul-188.6%
distribute-lft-in88.6%
mul-1-neg88.6%
distribute-neg-in88.6%
mul-1-neg88.6%
remove-double-neg88.6%
unsub-neg88.6%
associate-/l*89.7%
Simplified89.7%
if 3.2999999999999999e112 < y.im Initial program 33.1%
div-sub33.1%
*-commutative33.1%
add-sqr-sqrt33.1%
times-frac33.2%
fma-neg33.2%
hypot-define33.2%
hypot-define37.4%
associate-/l*41.3%
add-sqr-sqrt41.3%
pow241.3%
hypot-define41.3%
Applied egg-rr41.3%
Taylor expanded in y.im around inf 99.9%
Taylor expanded in y.re around 0 98.2%
Final simplification86.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 (/ (- (* y.re (/ x.im y.im)) x.re) y.im)))
(if (<= y.im -5.5e+126)
t_1
(if (<= y.im -3.1e-155)
t_0
(if (<= y.im 1.22e-58)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 8.6e+110) 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 = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -5.5e+126) {
tmp = t_1;
} else if (y_46_im <= -3.1e-155) {
tmp = t_0;
} else if (y_46_im <= 1.22e-58) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 8.6e+110) {
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 = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
if (y_46im <= (-5.5d+126)) then
tmp = t_1
else if (y_46im <= (-3.1d-155)) then
tmp = t_0
else if (y_46im <= 1.22d-58) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else if (y_46im <= 8.6d+110) 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 = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -5.5e+126) {
tmp = t_1;
} else if (y_46_im <= -3.1e-155) {
tmp = t_0;
} else if (y_46_im <= 1.22e-58) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 8.6e+110) {
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 = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im tmp = 0 if y_46_im <= -5.5e+126: tmp = t_1 elif y_46_im <= -3.1e-155: tmp = t_0 elif y_46_im <= 1.22e-58: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 8.6e+110: 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(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -5.5e+126) tmp = t_1; elseif (y_46_im <= -3.1e-155) tmp = t_0; elseif (y_46_im <= 1.22e-58) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 8.6e+110) 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 = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_im <= -5.5e+126) tmp = t_1; elseif (y_46_im <= -3.1e-155) tmp = t_0; elseif (y_46_im <= 1.22e-58) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 8.6e+110) 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[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -5.5e+126], t$95$1, If[LessEqual[y$46$im, -3.1e-155], t$95$0, If[LessEqual[y$46$im, 1.22e-58], 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, 8.6e+110], 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{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -5.5 \cdot 10^{+126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -3.1 \cdot 10^{-155}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.22 \cdot 10^{-58}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 8.6 \cdot 10^{+110}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -5.5000000000000004e126 or 8.60000000000000014e110 < y.im Initial program 34.8%
Taylor expanded in y.re around 0 85.4%
+-commutative85.4%
mul-1-neg85.4%
unsub-neg85.4%
unpow285.4%
associate-/r*90.3%
div-sub90.3%
*-commutative90.3%
associate-/l*95.3%
Simplified95.3%
if -5.5000000000000004e126 < y.im < -3.1e-155 or 1.2199999999999999e-58 < y.im < 8.60000000000000014e110Initial program 76.7%
if -3.1e-155 < y.im < 1.2199999999999999e-58Initial program 69.0%
Taylor expanded in y.re around inf 88.6%
remove-double-neg88.6%
mul-1-neg88.6%
neg-mul-188.6%
distribute-lft-in88.6%
mul-1-neg88.6%
distribute-neg-in88.6%
mul-1-neg88.6%
remove-double-neg88.6%
unsub-neg88.6%
associate-/l*89.7%
Simplified89.7%
Final simplification86.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4.2e-26) (not (<= y.im 2.3e-41))) (/ (- (* y.re (/ x.im 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 <= -4.2e-26) || !(y_46_im <= 2.3e-41)) {
tmp = ((y_46_re * (x_46_im / 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 <= (-4.2d-26)) .or. (.not. (y_46im <= 2.3d-41))) then
tmp = ((y_46re * (x_46im / 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 <= -4.2e-26) || !(y_46_im <= 2.3e-41)) {
tmp = ((y_46_re * (x_46_im / 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 <= -4.2e-26) or not (y_46_im <= 2.3e-41): tmp = ((y_46_re * (x_46_im / 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 <= -4.2e-26) || !(y_46_im <= 2.3e-41)) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / 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 <= -4.2e-26) || ~((y_46_im <= 2.3e-41))) tmp = ((y_46_re * (x_46_im / 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, -4.2e-26], N[Not[LessEqual[y$46$im, 2.3e-41]], $MachinePrecision]], N[(N[(N[(y$46$re * N[(x$46$im / 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 -4.2 \cdot 10^{-26} \lor \neg \left(y.im \leq 2.3 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{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 < -4.20000000000000016e-26 or 2.3000000000000001e-41 < y.im Initial program 52.4%
Taylor expanded in y.re around 0 74.3%
+-commutative74.3%
mul-1-neg74.3%
unsub-neg74.3%
unpow274.3%
associate-/r*77.0%
div-sub77.0%
*-commutative77.0%
associate-/l*79.9%
Simplified79.9%
if -4.20000000000000016e-26 < y.im < 2.3000000000000001e-41Initial program 72.2%
Taylor expanded in y.re around inf 81.6%
remove-double-neg81.6%
mul-1-neg81.6%
neg-mul-181.6%
distribute-lft-in81.6%
mul-1-neg81.6%
distribute-neg-in81.6%
mul-1-neg81.6%
remove-double-neg81.6%
unsub-neg81.6%
associate-/l*82.5%
Simplified82.5%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.3e+62) (not (<= y.im 9.5e+16))) (/ (- 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 <= -3.3e+62) || !(y_46_im <= 9.5e+16)) {
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 <= (-3.3d+62)) .or. (.not. (y_46im <= 9.5d+16))) 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 <= -3.3e+62) || !(y_46_im <= 9.5e+16)) {
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 <= -3.3e+62) or not (y_46_im <= 9.5e+16): 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 <= -3.3e+62) || !(y_46_im <= 9.5e+16)) tmp = Float64(Float64(-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 <= -3.3e+62) || ~((y_46_im <= 9.5e+16))) 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, -3.3e+62], N[Not[LessEqual[y$46$im, 9.5e+16]], $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 -3.3 \cdot 10^{+62} \lor \neg \left(y.im \leq 9.5 \cdot 10^{+16}\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 < -3.3e62 or 9.5e16 < y.im Initial program 47.8%
Taylor expanded in y.re around 0 74.7%
associate-*r/74.7%
neg-mul-174.7%
Simplified74.7%
if -3.3e62 < y.im < 9.5e16Initial program 72.7%
Taylor expanded in y.re around inf 75.7%
remove-double-neg75.7%
mul-1-neg75.7%
neg-mul-175.7%
distribute-lft-in75.7%
mul-1-neg75.7%
distribute-neg-in75.7%
mul-1-neg75.7%
remove-double-neg75.7%
unsub-neg75.7%
associate-/l*76.4%
Simplified76.4%
Final simplification75.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.6e+111) (not (<= y.re 3.5e+52))) (/ 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 <= -2.6e+111) || !(y_46_re <= 3.5e+52)) {
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 <= (-2.6d+111)) .or. (.not. (y_46re <= 3.5d+52))) 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 <= -2.6e+111) || !(y_46_re <= 3.5e+52)) {
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 <= -2.6e+111) or not (y_46_re <= 3.5e+52): 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 <= -2.6e+111) || !(y_46_re <= 3.5e+52)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(-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 <= -2.6e+111) || ~((y_46_re <= 3.5e+52))) 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, -2.6e+111], N[Not[LessEqual[y$46$re, 3.5e+52]], $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 -2.6 \cdot 10^{+111} \lor \neg \left(y.re \leq 3.5 \cdot 10^{+52}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -2.5999999999999999e111 or 3.5e52 < y.re Initial program 45.3%
Taylor expanded in y.re around inf 77.8%
if -2.5999999999999999e111 < y.re < 3.5e52Initial program 69.5%
Taylor expanded in y.re around 0 61.1%
associate-*r/61.1%
neg-mul-161.1%
Simplified61.1%
Final simplification66.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.06e+155) (not (<= y.im 1.8e+111))) (/ 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.06e+155) || !(y_46_im <= 1.8e+111)) {
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.06d+155)) .or. (.not. (y_46im <= 1.8d+111))) 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.06e+155) || !(y_46_im <= 1.8e+111)) {
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.06e+155) or not (y_46_im <= 1.8e+111): 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.06e+155) || !(y_46_im <= 1.8e+111)) 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.06e+155) || ~((y_46_im <= 1.8e+111))) 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.06e+155], N[Not[LessEqual[y$46$im, 1.8e+111]], $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.06 \cdot 10^{+155} \lor \neg \left(y.im \leq 1.8 \cdot 10^{+111}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.06000000000000005e155 or 1.8000000000000001e111 < y.im Initial program 32.7%
Taylor expanded in y.im around inf 91.0%
frac-2neg91.0%
div-inv90.7%
distribute-neg-in90.7%
add-sqr-sqrt49.7%
sqrt-unprod48.2%
neg-mul-148.2%
neg-mul-148.2%
sqr-neg48.2%
sqrt-unprod14.9%
add-sqr-sqrt30.5%
neg-mul-130.5%
sub-neg30.5%
add-sqr-sqrt15.6%
sqrt-unprod43.3%
neg-mul-143.3%
neg-mul-143.3%
sqr-neg43.3%
sqrt-unprod40.6%
add-sqr-sqrt90.7%
*-commutative90.7%
Applied egg-rr90.7%
Taylor expanded in x.re around inf 85.2%
un-div-inv85.5%
distribute-neg-frac285.5%
neg-sub085.5%
sub-neg85.5%
add-sqr-sqrt56.0%
sqrt-unprod50.9%
sqr-neg50.9%
sqrt-unprod21.0%
add-sqr-sqrt23.0%
Applied egg-rr23.0%
+-lft-identity23.0%
Simplified23.0%
if -1.06000000000000005e155 < y.im < 1.8000000000000001e111Initial program 73.1%
Taylor expanded in y.re around inf 53.7%
Final simplification44.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.1%
Taylor expanded in y.re around inf 39.6%
herbie shell --seed 2024086
(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))))