
(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 (- (* x.im y.re) (* x.re y.im))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 1.4e+237)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(-
(/ (* x.im (/ y.re (hypot y.im y.re))) (hypot y.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 t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1.4e+237) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = ((x_46_im * (y_46_re / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)) - (x_46_re / y_46_im);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1.4e+237) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (t_0 / Math.hypot(y_46_re, y_46_im));
} else {
tmp = ((x_46_im * (y_46_re / Math.hypot(y_46_im, y_46_re))) / Math.hypot(y_46_im, y_46_re)) - (x_46_re / y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1.4e+237: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (t_0 / math.hypot(y_46_re, y_46_im)) else: tmp = ((x_46_im * (y_46_re / math.hypot(y_46_im, y_46_re))) / math.hypot(y_46_im, y_46_re)) - (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(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 1.4e+237) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); else tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)) - 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) t_0 = (x_46_im * y_46_re) - (x_46_re * y_46_im); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1.4e+237) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im)); else tmp = ((x_46_im * (y_46_re / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)) - (x_46_re / 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 * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.4e+237], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$im * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.im \cdot y.re - x.re \cdot y.im\\
\mathbf{if}\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 1.4 \cdot 10^{+237}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 1.39999999999999992e237Initial program 77.3%
*-un-lft-identity77.3%
add-sqr-sqrt77.3%
times-frac77.3%
hypot-def77.3%
hypot-def96.2%
Applied egg-rr96.2%
if 1.39999999999999992e237 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 19.3%
div-sub14.1%
*-un-lft-identity14.1%
add-sqr-sqrt14.1%
times-frac14.1%
fma-neg14.1%
hypot-def14.1%
hypot-def17.7%
associate-/l*24.0%
add-sqr-sqrt24.0%
pow224.0%
hypot-def24.0%
Applied egg-rr24.0%
fma-neg24.0%
*-commutative24.0%
associate-/l*57.0%
associate-/l*49.4%
*-commutative49.4%
associate-/l*57.0%
Simplified57.0%
associate-*l/57.1%
*-un-lft-identity57.1%
associate-/r/57.1%
hypot-udef24.0%
+-commutative24.0%
hypot-def57.1%
hypot-udef24.0%
+-commutative24.0%
hypot-def57.1%
Applied egg-rr57.1%
Taylor expanded in y.im around inf 80.2%
Final simplification91.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1
(-
(/ (* x.im (/ y.re (hypot y.im y.re))) (hypot y.im y.re))
(/ x.re y.im))))
(if (<= y.im -5e+65)
t_1
(if (<= y.im -9.8e-79)
t_0
(if (<= y.im 3.2e-127)
(/ (- x.im (/ x.re (/ y.re y.im))) y.re)
(if (<= y.im 3e+15) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((x_46_im * (y_46_re / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -5e+65) {
tmp = t_1;
} else if (y_46_im <= -9.8e-79) {
tmp = t_0;
} else if (y_46_im <= 3.2e-127) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_im <= 3e+15) {
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 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((x_46_im * (y_46_re / Math.hypot(y_46_im, y_46_re))) / Math.hypot(y_46_im, y_46_re)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -5e+65) {
tmp = t_1;
} else if (y_46_im <= -9.8e-79) {
tmp = t_0;
} else if (y_46_im <= 3.2e-127) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_im <= 3e+15) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = ((x_46_im * (y_46_re / math.hypot(y_46_im, y_46_re))) / math.hypot(y_46_im, y_46_re)) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -5e+65: tmp = t_1 elif y_46_im <= -9.8e-79: tmp = t_0 elif y_46_im <= 3.2e-127: tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re elif y_46_im <= 3e+15: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_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))) t_1 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -5e+65) tmp = t_1; elseif (y_46_im <= -9.8e-79) tmp = t_0; elseif (y_46_im <= 3.2e-127) tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re); elseif (y_46_im <= 3e+15) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = ((x_46_im * (y_46_re / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -5e+65) tmp = t_1; elseif (y_46_im <= -9.8e-79) tmp = t_0; elseif (y_46_im <= 3.2e-127) tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re; elseif (y_46_im <= 3e+15) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$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]}, Block[{t$95$1 = N[(N[(N[(x$46$im * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5e+65], t$95$1, If[LessEqual[y$46$im, -9.8e-79], t$95$0, If[LessEqual[y$46$im, 3.2e-127], 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$im, 3e+15], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -5 \cdot 10^{+65}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -9.8 \cdot 10^{-79}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{-127}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\mathbf{elif}\;y.im \leq 3 \cdot 10^{+15}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -4.99999999999999973e65 or 3e15 < y.im Initial program 32.6%
div-sub32.6%
*-un-lft-identity32.6%
add-sqr-sqrt32.6%
times-frac32.6%
fma-neg32.6%
hypot-def32.6%
hypot-def38.2%
associate-/l*44.5%
add-sqr-sqrt44.5%
pow244.5%
hypot-def44.5%
Applied egg-rr44.5%
fma-neg44.5%
*-commutative44.5%
associate-/l*60.4%
associate-/l*53.2%
*-commutative53.2%
associate-/l*59.5%
Simplified59.5%
associate-*l/59.6%
*-un-lft-identity59.6%
associate-/r/59.6%
hypot-udef39.4%
+-commutative39.4%
hypot-def59.6%
hypot-udef39.4%
+-commutative39.4%
hypot-def59.6%
Applied egg-rr59.6%
Taylor expanded in y.im around inf 91.0%
if -4.99999999999999973e65 < y.im < -9.8000000000000001e-79 or 3.20000000000000017e-127 < y.im < 3e15Initial program 87.7%
if -9.8000000000000001e-79 < y.im < 3.20000000000000017e-127Initial program 70.9%
Taylor expanded in y.re around inf 71.9%
mul-1-neg71.9%
unsub-neg71.9%
unpow271.9%
associate-/r*82.9%
Simplified82.9%
sub-div85.6%
associate-/l*87.0%
Applied egg-rr87.0%
Final simplification88.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -4.4e+66)
(* (/ 1.0 (hypot y.re y.im)) (fma -1.0 (/ y.re (/ y.im x.im)) x.re))
(if (<= y.im -2.4e-78)
t_0
(if (<= y.im 1.22e-126)
(/ (- x.im (/ x.re (/ y.re y.im))) y.re)
(if (<= y.im 1.65e+87)
t_0
(- (* (/ y.re y.im) (/ x.im 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 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -4.4e+66) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * fma(-1.0, (y_46_re / (y_46_im / x_46_im)), x_46_re);
} else if (y_46_im <= -2.4e-78) {
tmp = t_0;
} else if (y_46_im <= 1.22e-126) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_im <= 1.65e+87) {
tmp = t_0;
} else {
tmp = ((y_46_re / y_46_im) * (x_46_im / 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(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))) tmp = 0.0 if (y_46_im <= -4.4e+66) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * fma(-1.0, Float64(y_46_re / Float64(y_46_im / x_46_im)), x_46_re)); elseif (y_46_im <= -2.4e-78) tmp = t_0; elseif (y_46_im <= 1.22e-126) tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re); elseif (y_46_im <= 1.65e+87) tmp = t_0; else tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - 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[(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]}, If[LessEqual[y$46$im, -4.4e+66], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-1.0 * N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] + x$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -2.4e-78], t$95$0, If[LessEqual[y$46$im, 1.22e-126], 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$im, 1.65e+87], t$95$0, N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -4.4 \cdot 10^{+66}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \mathsf{fma}\left(-1, \frac{y.re}{\frac{y.im}{x.im}}, x.re\right)\\
\mathbf{elif}\;y.im \leq -2.4 \cdot 10^{-78}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.22 \cdot 10^{-126}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.65 \cdot 10^{+87}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -4.3999999999999997e66Initial program 20.0%
*-un-lft-identity20.0%
add-sqr-sqrt20.0%
times-frac20.0%
hypot-def20.0%
hypot-def47.1%
Applied egg-rr47.1%
Taylor expanded in y.im around -inf 71.9%
fma-def71.9%
associate-/l*81.1%
Simplified81.1%
if -4.3999999999999997e66 < y.im < -2.4e-78 or 1.21999999999999996e-126 < y.im < 1.6500000000000001e87Initial program 84.6%
if -2.4e-78 < y.im < 1.21999999999999996e-126Initial program 70.9%
Taylor expanded in y.re around inf 71.9%
mul-1-neg71.9%
unsub-neg71.9%
unpow271.9%
associate-/r*82.9%
Simplified82.9%
sub-div85.6%
associate-/l*87.0%
Applied egg-rr87.0%
if 1.6500000000000001e87 < y.im Initial program 30.5%
Taylor expanded in y.re around 0 75.3%
+-commutative75.3%
mul-1-neg75.3%
unsub-neg75.3%
unpow275.3%
times-frac85.5%
Simplified85.5%
Final simplification84.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im))))
(if (<= y.im -8.2e+70)
t_1
(if (<= y.im -2.7e-78)
t_0
(if (<= y.im 1.4e-127)
(/ (- x.im (/ x.re (/ y.re y.im))) y.re)
(if (<= y.im 5.2e+84) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -8.2e+70) {
tmp = t_1;
} else if (y_46_im <= -2.7e-78) {
tmp = t_0;
} else if (y_46_im <= 1.4e-127) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_im <= 5.2e+84) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = ((y_46re / y_46im) * (x_46im / y_46im)) - (x_46re / y_46im)
if (y_46im <= (-8.2d+70)) then
tmp = t_1
else if (y_46im <= (-2.7d-78)) then
tmp = t_0
else if (y_46im <= 1.4d-127) then
tmp = (x_46im - (x_46re / (y_46re / y_46im))) / y_46re
else if (y_46im <= 5.2d+84) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -8.2e+70) {
tmp = t_1;
} else if (y_46_im <= -2.7e-78) {
tmp = t_0;
} else if (y_46_im <= 1.4e-127) {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
} else if (y_46_im <= 5.2e+84) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -8.2e+70: tmp = t_1 elif y_46_im <= -2.7e-78: tmp = t_0 elif y_46_im <= 1.4e-127: tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re elif y_46_im <= 5.2e+84: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_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))) t_1 = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -8.2e+70) tmp = t_1; elseif (y_46_im <= -2.7e-78) tmp = t_0; elseif (y_46_im <= 1.4e-127) tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re); elseif (y_46_im <= 5.2e+84) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -8.2e+70) tmp = t_1; elseif (y_46_im <= -2.7e-78) tmp = t_0; elseif (y_46_im <= 1.4e-127) tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re; elseif (y_46_im <= 5.2e+84) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$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]}, Block[{t$95$1 = N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -8.2e+70], t$95$1, If[LessEqual[y$46$im, -2.7e-78], t$95$0, If[LessEqual[y$46$im, 1.4e-127], 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$im, 5.2e+84], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -8.2 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -2.7 \cdot 10^{-78}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{-127}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\mathbf{elif}\;y.im \leq 5.2 \cdot 10^{+84}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -8.2000000000000004e70 or 5.2000000000000002e84 < y.im Initial program 25.4%
Taylor expanded in y.re around 0 69.4%
+-commutative69.4%
mul-1-neg69.4%
unsub-neg69.4%
unpow269.4%
times-frac83.3%
Simplified83.3%
if -8.2000000000000004e70 < y.im < -2.69999999999999994e-78 or 1.4e-127 < y.im < 5.2000000000000002e84Initial program 84.6%
if -2.69999999999999994e-78 < y.im < 1.4e-127Initial program 70.9%
Taylor expanded in y.re around inf 71.9%
mul-1-neg71.9%
unsub-neg71.9%
unpow271.9%
associate-/r*82.9%
Simplified82.9%
sub-div85.6%
associate-/l*87.0%
Applied egg-rr87.0%
Final simplification84.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.65e+91) (not (<= y.re 21.0))) (+ (/ x.im y.re) (/ -1.0 (* (/ y.re y.im) (/ y.re x.re)))) (- (* (/ y.re y.im) (/ x.im 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.65e+91) || !(y_46_re <= 21.0)) {
tmp = (x_46_im / y_46_re) + (-1.0 / ((y_46_re / y_46_im) * (y_46_re / x_46_re)));
} else {
tmp = ((y_46_re / y_46_im) * (x_46_im / 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.65d+91)) .or. (.not. (y_46re <= 21.0d0))) then
tmp = (x_46im / y_46re) + ((-1.0d0) / ((y_46re / y_46im) * (y_46re / x_46re)))
else
tmp = ((y_46re / y_46im) * (x_46im / 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.65e+91) || !(y_46_re <= 21.0)) {
tmp = (x_46_im / y_46_re) + (-1.0 / ((y_46_re / y_46_im) * (y_46_re / x_46_re)));
} else {
tmp = ((y_46_re / y_46_im) * (x_46_im / 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.65e+91) or not (y_46_re <= 21.0): tmp = (x_46_im / y_46_re) + (-1.0 / ((y_46_re / y_46_im) * (y_46_re / x_46_re))) else: tmp = ((y_46_re / y_46_im) * (x_46_im / 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.65e+91) || !(y_46_re <= 21.0)) tmp = Float64(Float64(x_46_im / y_46_re) + Float64(-1.0 / Float64(Float64(y_46_re / y_46_im) * Float64(y_46_re / x_46_re)))); else tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - 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 <= -1.65e+91) || ~((y_46_re <= 21.0))) tmp = (x_46_im / y_46_re) + (-1.0 / ((y_46_re / y_46_im) * (y_46_re / x_46_re))); else tmp = ((y_46_re / y_46_im) * (x_46_im / 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.65e+91], N[Not[LessEqual[y$46$re, 21.0]], $MachinePrecision]], N[(N[(x$46$im / y$46$re), $MachinePrecision] + N[(-1.0 / N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(y$46$re / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{+91} \lor \neg \left(y.re \leq 21\right):\\
\;\;\;\;\frac{x.im}{y.re} + \frac{-1}{\frac{y.re}{y.im} \cdot \frac{y.re}{x.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -1.65000000000000009e91 or 21 < y.re Initial program 46.8%
Taylor expanded in y.re around inf 69.8%
mul-1-neg69.8%
unsub-neg69.8%
unpow269.8%
associate-/r*73.2%
Simplified73.2%
clear-num73.2%
inv-pow73.2%
associate-/l*78.4%
Applied egg-rr78.4%
unpow-178.4%
associate-/r/78.4%
Simplified78.4%
if -1.65000000000000009e91 < y.re < 21Initial program 67.3%
Taylor expanded in y.re around 0 71.6%
+-commutative71.6%
mul-1-neg71.6%
unsub-neg71.6%
unpow271.6%
times-frac78.7%
Simplified78.7%
Final simplification78.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.15e+91)
(* (- x.im (* x.re (/ y.im y.re))) (/ 1.0 y.re))
(if (<= y.re 12.5)
(- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im))
(/ (- x.im (/ x.re (/ y.re y.im))) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.15e+91) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) * (1.0 / y_46_re);
} else if (y_46_re <= 12.5) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-1.15d+91)) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) * (1.0d0 / y_46re)
else if (y_46re <= 12.5d0) then
tmp = ((y_46re / y_46im) * (x_46im / y_46im)) - (x_46re / y_46im)
else
tmp = (x_46im - (x_46re / (y_46re / y_46im))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -1.15e+91) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) * (1.0 / y_46_re);
} else if (y_46_re <= 12.5) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -1.15e+91: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) * (1.0 / y_46_re) elif y_46_re <= 12.5: tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) else: tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -1.15e+91) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) * Float64(1.0 / y_46_re)); elseif (y_46_re <= 12.5) tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -1.15e+91) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) * (1.0 / y_46_re); elseif (y_46_re <= 12.5) tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); else tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.15e+91], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 12.5], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.15 \cdot 10^{+91}:\\
\;\;\;\;\left(x.im - x.re \cdot \frac{y.im}{y.re}\right) \cdot \frac{1}{y.re}\\
\mathbf{elif}\;y.re \leq 12.5:\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\end{array}
\end{array}
if y.re < -1.14999999999999996e91Initial program 43.7%
Taylor expanded in y.re around inf 65.9%
mul-1-neg65.9%
unsub-neg65.9%
unpow265.9%
associate-/r*71.4%
Simplified71.4%
sub-div71.4%
associate-/l*74.5%
Applied egg-rr74.5%
div-inv74.5%
div-inv74.5%
clear-num74.5%
Applied egg-rr74.5%
if -1.14999999999999996e91 < y.re < 12.5Initial program 67.3%
Taylor expanded in y.re around 0 71.6%
+-commutative71.6%
mul-1-neg71.6%
unsub-neg71.6%
unpow271.6%
times-frac78.7%
Simplified78.7%
if 12.5 < y.re Initial program 48.5%
Taylor expanded in y.re around inf 71.9%
mul-1-neg71.9%
unsub-neg71.9%
unpow271.9%
associate-/r*74.2%
Simplified74.2%
sub-div74.2%
associate-/l*80.5%
Applied egg-rr80.5%
Final simplification78.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -560000000.0) (not (<= y.im 420000.0))) (- (/ x.re y.im)) (/ (- x.im (/ x.re (/ y.re y.im))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -560000000.0) || !(y_46_im <= 420000.0)) {
tmp = -(x_46_re / y_46_im);
} else {
tmp = (x_46_im - (x_46_re / (y_46_re / y_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 <= (-560000000.0d0)) .or. (.not. (y_46im <= 420000.0d0))) then
tmp = -(x_46re / y_46im)
else
tmp = (x_46im - (x_46re / (y_46re / y_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 <= -560000000.0) || !(y_46_im <= 420000.0)) {
tmp = -(x_46_re / y_46_im);
} else {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -560000000.0) or not (y_46_im <= 420000.0): tmp = -(x_46_re / y_46_im) else: tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -560000000.0) || !(y_46_im <= 420000.0)) tmp = Float64(-Float64(x_46_re / y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -560000000.0) || ~((y_46_im <= 420000.0))) tmp = -(x_46_re / y_46_im); else tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -560000000.0], N[Not[LessEqual[y$46$im, 420000.0]], $MachinePrecision]], (-N[(x$46$re / y$46$im), $MachinePrecision]), N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -560000000 \lor \neg \left(y.im \leq 420000\right):\\
\;\;\;\;-\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
\end{array}
\end{array}
if y.im < -5.6e8 or 4.2e5 < y.im Initial program 39.5%
Taylor expanded in y.re around 0 66.7%
associate-*r/66.7%
neg-mul-166.7%
Simplified66.7%
if -5.6e8 < y.im < 4.2e5Initial program 79.3%
Taylor expanded in y.re around inf 67.5%
mul-1-neg67.5%
unsub-neg67.5%
unpow267.5%
associate-/r*74.6%
Simplified74.6%
sub-div76.3%
associate-/l*77.0%
Applied egg-rr77.0%
Final simplification71.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -580000000.0) (not (<= y.im 15000000000000.0))) (- (/ 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 <= -580000000.0) || !(y_46_im <= 15000000000000.0)) {
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 <= (-580000000.0d0)) .or. (.not. (y_46im <= 15000000000000.0d0))) 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 <= -580000000.0) || !(y_46_im <= 15000000000000.0)) {
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 <= -580000000.0) or not (y_46_im <= 15000000000000.0): 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 <= -580000000.0) || !(y_46_im <= 15000000000000.0)) tmp = Float64(-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 <= -580000000.0) || ~((y_46_im <= 15000000000000.0))) 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, -580000000.0], N[Not[LessEqual[y$46$im, 15000000000000.0]], $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 -580000000 \lor \neg \left(y.im \leq 15000000000000\right):\\
\;\;\;\;-\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -5.8e8 or 1.5e13 < y.im Initial program 38.9%
Taylor expanded in y.re around 0 67.4%
associate-*r/67.4%
neg-mul-167.4%
Simplified67.4%
if -5.8e8 < y.im < 1.5e13Initial program 79.1%
Taylor expanded in y.re around inf 56.6%
Final simplification61.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -6.8e+215) (/ 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 <= -6.8e+215) {
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 <= (-6.8d+215)) 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 <= -6.8e+215) {
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 <= -6.8e+215: 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 <= -6.8e+215) 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 <= -6.8e+215) 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[LessEqual[y$46$im, -6.8e+215], 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 -6.8 \cdot 10^{+215}:\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -6.80000000000000036e215Initial program 30.3%
*-un-lft-identity30.3%
add-sqr-sqrt30.3%
times-frac30.3%
hypot-def30.3%
hypot-def49.0%
Applied egg-rr49.0%
Taylor expanded in y.im around -inf 86.4%
fma-def86.4%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in y.re around 0 31.6%
if -6.80000000000000036e215 < y.im Initial program 62.0%
Taylor expanded in y.re around inf 41.5%
Final simplification40.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.im))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46im
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_im) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 59.4%
*-un-lft-identity59.4%
add-sqr-sqrt59.4%
times-frac59.4%
hypot-def59.4%
hypot-def73.8%
Applied egg-rr73.8%
Taylor expanded in y.im around -inf 28.1%
fma-def28.1%
associate-/l*30.1%
Simplified30.1%
Taylor expanded in y.re around -inf 7.5%
Final simplification7.5%
(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 59.4%
Taylor expanded in y.re around inf 38.4%
Final simplification38.4%
herbie shell --seed 2023238
(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))))