
(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-sub53.6%
*-commutative53.6%
add-sqr-sqrt53.6%
times-frac57.8%
fma-neg57.8%
hypot-define57.8%
hypot-define77.1%
associate-/l*81.9%
add-sqr-sqrt81.9%
pow281.9%
hypot-define81.9%
Applied egg-rr81.9%
*-un-lft-identity81.9%
unpow281.9%
times-frac97.6%
add-sqr-sqrt49.5%
sqrt-prod59.3%
sqr-neg59.3%
sqrt-unprod29.0%
add-sqr-sqrt60.8%
hypot-undefine57.9%
+-commutative57.9%
hypot-define60.8%
add-sqr-sqrt29.0%
sqrt-unprod59.3%
sqr-neg59.3%
sqrt-prod49.5%
add-sqr-sqrt97.6%
hypot-undefine82.0%
+-commutative82.0%
hypot-define97.6%
Applied egg-rr97.6%
associate-*l/97.6%
*-lft-identity97.6%
Simplified97.6%
Final simplification97.6%
(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 (* x.re (/ y.im (- (pow (hypot y.re y.im) 2.0))))))
(t_3 (fma t_0 t_1 (/ x.re (- y.im)))))
(if (<= y.im -9e+153)
t_3
(if (<= y.im -5e-65)
t_2
(if (<= y.im 5e-138)
(*
(/ (- y.re (* x.re (/ y.im x.im))) (hypot y.im y.re))
(/ x.im (hypot y.im y.re)))
(if (<= y.im 1.25e+128) t_2 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, (x_46_re * (y_46_im / -pow(hypot(y_46_re, y_46_im), 2.0))));
double t_3 = fma(t_0, t_1, (x_46_re / -y_46_im));
double tmp;
if (y_46_im <= -9e+153) {
tmp = t_3;
} else if (y_46_im <= -5e-65) {
tmp = t_2;
} else if (y_46_im <= 5e-138) {
tmp = ((y_46_re - (x_46_re * (y_46_im / x_46_im))) / hypot(y_46_im, y_46_re)) * (x_46_im / hypot(y_46_im, y_46_re));
} else if (y_46_im <= 1.25e+128) {
tmp = t_2;
} else {
tmp = 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(x_46_re * Float64(y_46_im / Float64(-(hypot(y_46_re, y_46_im) ^ 2.0))))) t_3 = fma(t_0, t_1, Float64(x_46_re / Float64(-y_46_im))) tmp = 0.0 if (y_46_im <= -9e+153) tmp = t_3; elseif (y_46_im <= -5e-65) tmp = t_2; elseif (y_46_im <= 5e-138) tmp = Float64(Float64(Float64(y_46_re - Float64(x_46_re * Float64(y_46_im / x_46_im))) / hypot(y_46_im, y_46_re)) * Float64(x_46_im / hypot(y_46_im, y_46_re))); elseif (y_46_im <= 1.25e+128) tmp = t_2; else tmp = 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[(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$3 = N[(t$95$0 * t$95$1 + N[(x$46$re / (-y$46$im)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -9e+153], t$95$3, If[LessEqual[y$46$im, -5e-65], t$95$2, If[LessEqual[y$46$im, 5e-138], N[(N[(N[(y$46$re - N[(x$46$re * N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.25e+128], t$95$2, t$95$3]]]]]]]]
\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, x.re \cdot \frac{y.im}{-{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)\\
t_3 := \mathsf{fma}\left(t\_0, t\_1, \frac{x.re}{-y.im}\right)\\
\mathbf{if}\;y.im \leq -9 \cdot 10^{+153}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y.im \leq -5 \cdot 10^{-65}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{-138}:\\
\;\;\;\;\frac{y.re - x.re \cdot \frac{y.im}{x.im}}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.im \leq 1.25 \cdot 10^{+128}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y.im < -9.0000000000000002e153 or 1.25e128 < y.im Initial program 30.5%
div-sub30.5%
*-commutative30.5%
add-sqr-sqrt30.5%
times-frac30.8%
fma-neg30.8%
hypot-define30.8%
hypot-define50.2%
associate-/l*51.4%
add-sqr-sqrt51.4%
pow251.4%
hypot-define51.4%
Applied egg-rr51.4%
Taylor expanded in y.im around inf 94.8%
if -9.0000000000000002e153 < y.im < -4.99999999999999983e-65 or 4.99999999999999989e-138 < y.im < 1.25e128Initial program 69.9%
div-sub69.9%
*-commutative69.9%
add-sqr-sqrt69.9%
times-frac73.3%
fma-neg73.3%
hypot-define73.3%
hypot-define89.5%
associate-/l*98.7%
add-sqr-sqrt98.7%
pow298.7%
hypot-define98.7%
Applied egg-rr98.7%
if -4.99999999999999983e-65 < y.im < 4.99999999999999989e-138Initial program 63.6%
Taylor expanded in x.im around inf 63.5%
mul-1-neg63.5%
unsub-neg63.5%
associate-/l*63.5%
Simplified63.5%
*-commutative63.5%
+-commutative63.5%
add-sqr-sqrt63.5%
hypot-undefine63.5%
hypot-undefine63.5%
times-frac98.2%
Applied egg-rr98.2%
Final simplification97.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -4.6e+41) (not (<= y.im 8e+22)))
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(/ x.re (- y.im)))
(*
(/ (- y.re (* x.re (/ y.im x.im))) (hypot y.im y.re))
(/ x.im (hypot y.im y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -4.6e+41) || !(y_46_im <= 8e+22)) {
tmp = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), (x_46_re / -y_46_im));
} else {
tmp = ((y_46_re - (x_46_re * (y_46_im / x_46_im))) / hypot(y_46_im, y_46_re)) * (x_46_im / hypot(y_46_im, y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -4.6e+41) || !(y_46_im <= 8e+22)) tmp = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(x_46_re / Float64(-y_46_im))); else tmp = Float64(Float64(Float64(y_46_re - Float64(x_46_re * Float64(y_46_im / x_46_im))) / hypot(y_46_im, y_46_re)) * Float64(x_46_im / hypot(y_46_im, y_46_re))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -4.6e+41], N[Not[LessEqual[y$46$im, 8e+22]], $MachinePrecision]], N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(x$46$re / (-y$46$im)), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$46$re - N[(x$46$re * N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.6 \cdot 10^{+41} \lor \neg \left(y.im \leq 8 \cdot 10^{+22}\right):\\
\;\;\;\;\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{else}:\\
\;\;\;\;\frac{y.re - x.re \cdot \frac{y.im}{x.im}}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\end{array}
\end{array}
if y.im < -4.5999999999999997e41 or 8e22 < y.im Initial program 40.0%
div-sub40.0%
*-commutative40.0%
add-sqr-sqrt40.0%
times-frac42.8%
fma-neg42.8%
hypot-define42.8%
hypot-define62.1%
associate-/l*70.3%
add-sqr-sqrt70.3%
pow270.3%
hypot-define70.3%
Applied egg-rr70.3%
Taylor expanded in y.im around inf 90.8%
if -4.5999999999999997e41 < y.im < 8e22Initial program 70.6%
Taylor expanded in x.im around inf 69.2%
mul-1-neg69.2%
unsub-neg69.2%
associate-/l*69.2%
Simplified69.2%
*-commutative69.2%
+-commutative69.2%
add-sqr-sqrt69.1%
hypot-undefine69.2%
hypot-undefine69.2%
times-frac94.7%
Applied egg-rr94.7%
Final simplification92.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -1.48e+113) (not (<= y.im 4.5e+175)))
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(*
(/ (- y.re (* x.re (/ y.im x.im))) (hypot y.im y.re))
(/ x.im (hypot y.im y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.48e+113) || !(y_46_im <= 4.5e+175)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = ((y_46_re - (x_46_re * (y_46_im / x_46_im))) / hypot(y_46_im, y_46_re)) * (x_46_im / hypot(y_46_im, y_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.48e+113) || !(y_46_im <= 4.5e+175)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = ((y_46_re - (x_46_re * (y_46_im / x_46_im))) / Math.hypot(y_46_im, y_46_re)) * (x_46_im / Math.hypot(y_46_im, y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.48e+113) or not (y_46_im <= 4.5e+175): tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im else: tmp = ((y_46_re - (x_46_re * (y_46_im / x_46_im))) / math.hypot(y_46_im, y_46_re)) * (x_46_im / math.hypot(y_46_im, y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.48e+113) || !(y_46_im <= 4.5e+175)) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(Float64(y_46_re - Float64(x_46_re * Float64(y_46_im / x_46_im))) / hypot(y_46_im, y_46_re)) * Float64(x_46_im / hypot(y_46_im, y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.48e+113) || ~((y_46_im <= 4.5e+175))) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; else tmp = ((y_46_re - (x_46_re * (y_46_im / x_46_im))) / hypot(y_46_im, y_46_re)) * (x_46_im / hypot(y_46_im, y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.48e+113], N[Not[LessEqual[y$46$im, 4.5e+175]], $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[(N[(y$46$re - N[(x$46$re * N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.48 \cdot 10^{+113} \lor \neg \left(y.im \leq 4.5 \cdot 10^{+175}\right):\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re - x.re \cdot \frac{y.im}{x.im}}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\end{array}
\end{array}
if y.im < -1.48000000000000002e113 or 4.49999999999999989e175 < y.im Initial program 28.7%
Taylor expanded in y.re around 0 77.3%
+-commutative77.3%
mul-1-neg77.3%
unsub-neg77.3%
unpow277.3%
associate-/r*82.7%
div-sub82.7%
*-commutative82.7%
associate-/l*85.5%
fma-neg85.5%
Simplified85.5%
fma-undefine85.5%
unsub-neg85.5%
Applied egg-rr85.5%
if -1.48000000000000002e113 < y.im < 4.49999999999999989e175Initial program 67.6%
Taylor expanded in x.im around inf 64.5%
mul-1-neg64.5%
unsub-neg64.5%
associate-/l*63.4%
Simplified63.4%
*-commutative63.4%
+-commutative63.4%
add-sqr-sqrt63.4%
hypot-undefine63.4%
hypot-undefine63.4%
times-frac91.1%
Applied egg-rr91.1%
Final simplification89.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)))))
(if (<= y.re -2.7e+72)
(* (/ x.im (hypot y.im y.re)) (/ y.re (hypot y.im y.re)))
(if (<= y.re -1.22e-123)
t_0
(if (<= y.re 5.8e-59)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.re 2.75e+57)
t_0
(/ (- 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 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_re <= -2.7e+72) {
tmp = (x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re));
} else if (y_46_re <= -1.22e-123) {
tmp = t_0;
} else if (y_46_re <= 5.8e-59) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 2.75e+57) {
tmp = t_0;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double 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_re <= -2.7e+72) {
tmp = (x_46_im / Math.hypot(y_46_im, y_46_re)) * (y_46_re / Math.hypot(y_46_im, y_46_re));
} else if (y_46_re <= -1.22e-123) {
tmp = t_0;
} else if (y_46_re <= 5.8e-59) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 2.75e+57) {
tmp = t_0;
} 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): 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)) tmp = 0 if y_46_re <= -2.7e+72: tmp = (x_46_im / math.hypot(y_46_im, y_46_re)) * (y_46_re / math.hypot(y_46_im, y_46_re)) elif y_46_re <= -1.22e-123: tmp = t_0 elif y_46_re <= 5.8e-59: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im elif y_46_re <= 2.75e+57: tmp = t_0 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) 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_re <= -2.7e+72) tmp = Float64(Float64(x_46_im / hypot(y_46_im, y_46_re)) * Float64(y_46_re / hypot(y_46_im, y_46_re))); elseif (y_46_re <= -1.22e-123) tmp = t_0; elseif (y_46_re <= 5.8e-59) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_re <= 2.75e+57) tmp = t_0; 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) 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)); tmp = 0.0; if (y_46_re <= -2.7e+72) tmp = (x_46_im / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re)); elseif (y_46_re <= -1.22e-123) tmp = t_0; elseif (y_46_re <= 5.8e-59) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_re <= 2.75e+57) tmp = t_0; 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_] := 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$re, -2.7e+72], N[(N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -1.22e-123], t$95$0, If[LessEqual[y$46$re, 5.8e-59], 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$re, 2.75e+57], t$95$0, N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]]
\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.re \leq -2.7 \cdot 10^{+72}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{elif}\;y.re \leq -1.22 \cdot 10^{-123}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.8 \cdot 10^{-59}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 2.75 \cdot 10^{+57}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -2.7000000000000001e72Initial program 25.6%
Taylor expanded in x.im around inf 23.5%
mul-1-neg23.5%
unsub-neg23.5%
associate-/l*23.5%
Simplified23.5%
*-commutative23.5%
+-commutative23.5%
add-sqr-sqrt23.5%
hypot-undefine23.5%
hypot-undefine23.5%
times-frac88.1%
Applied egg-rr88.1%
Taylor expanded in y.re around inf 81.6%
if -2.7000000000000001e72 < y.re < -1.22e-123 or 5.80000000000000033e-59 < y.re < 2.7500000000000001e57Initial program 83.2%
if -1.22e-123 < y.re < 5.80000000000000033e-59Initial program 66.1%
Taylor expanded in y.re around 0 84.0%
+-commutative84.0%
mul-1-neg84.0%
unsub-neg84.0%
unpow284.0%
associate-/r*92.3%
div-sub93.3%
associate-/l*93.4%
Simplified93.4%
if 2.7500000000000001e57 < y.re Initial program 39.7%
Taylor expanded in y.re around inf 86.7%
mul-1-neg86.7%
unsub-neg86.7%
unsub-neg86.7%
remove-double-neg86.7%
mul-1-neg86.7%
neg-mul-186.7%
mul-1-neg86.7%
distribute-lft-in86.7%
distribute-lft-in86.7%
mul-1-neg86.7%
unsub-neg86.7%
neg-mul-186.7%
mul-1-neg86.7%
remove-double-neg86.7%
associate-/l*88.3%
Simplified88.3%
Final simplification87.9%
(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 (* x.re (/ y.im y.re))) y.re)))
(if (<= y.re -6.6e+85)
t_1
(if (<= y.re -3.4e-129)
t_0
(if (<= y.re 1e-59)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.re 6.8e+63) 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 - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -6.6e+85) {
tmp = t_1;
} else if (y_46_re <= -3.4e-129) {
tmp = t_0;
} else if (y_46_re <= 1e-59) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 6.8e+63) {
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 - (x_46re * (y_46im / y_46re))) / y_46re
if (y_46re <= (-6.6d+85)) then
tmp = t_1
else if (y_46re <= (-3.4d-129)) then
tmp = t_0
else if (y_46re <= 1d-59) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else if (y_46re <= 6.8d+63) 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 - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -6.6e+85) {
tmp = t_1;
} else if (y_46_re <= -3.4e-129) {
tmp = t_0;
} else if (y_46_re <= 1e-59) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 6.8e+63) {
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 - (x_46_re * (y_46_im / y_46_re))) / y_46_re tmp = 0 if y_46_re <= -6.6e+85: tmp = t_1 elif y_46_re <= -3.4e-129: tmp = t_0 elif y_46_re <= 1e-59: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im elif y_46_re <= 6.8e+63: 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(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re) tmp = 0.0 if (y_46_re <= -6.6e+85) tmp = t_1; elseif (y_46_re <= -3.4e-129) tmp = t_0; elseif (y_46_re <= 1e-59) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_re <= 6.8e+63) 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 - (x_46_re * (y_46_im / y_46_re))) / y_46_re; tmp = 0.0; if (y_46_re <= -6.6e+85) tmp = t_1; elseif (y_46_re <= -3.4e-129) tmp = t_0; elseif (y_46_re <= 1e-59) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_re <= 6.8e+63) 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[(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$re, -6.6e+85], t$95$1, If[LessEqual[y$46$re, -3.4e-129], t$95$0, If[LessEqual[y$46$re, 1e-59], 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$re, 6.8e+63], 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 - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -6.6 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -3.4 \cdot 10^{-129}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 10^{-59}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 6.8 \cdot 10^{+63}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -6.5999999999999998e85 or 6.7999999999999997e63 < y.re Initial program 32.5%
Taylor expanded in y.re around inf 82.3%
mul-1-neg82.3%
unsub-neg82.3%
unsub-neg82.3%
remove-double-neg82.3%
mul-1-neg82.3%
neg-mul-182.3%
mul-1-neg82.3%
distribute-lft-in82.3%
distribute-lft-in82.3%
mul-1-neg82.3%
unsub-neg82.3%
neg-mul-182.3%
mul-1-neg82.3%
remove-double-neg82.3%
associate-/l*85.2%
Simplified85.2%
if -6.5999999999999998e85 < y.re < -3.40000000000000013e-129 or 1e-59 < y.re < 6.7999999999999997e63Initial program 80.9%
if -3.40000000000000013e-129 < y.re < 1e-59Initial program 66.1%
Taylor expanded in y.re around 0 84.0%
+-commutative84.0%
mul-1-neg84.0%
unsub-neg84.0%
unpow284.0%
associate-/r*92.3%
div-sub93.3%
associate-/l*93.4%
Simplified93.4%
Final simplification87.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -1.85e+102)
(and (not (<= y.re -3.8e+31))
(or (<= y.re -1.62e-49) (not (<= y.re 5.2e-57)))))
(/ (- x.im (* x.re (/ y.im 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.85e+102) || (!(y_46_re <= -3.8e+31) && ((y_46_re <= -1.62e-49) || !(y_46_re <= 5.2e-57)))) {
tmp = (x_46_im - (x_46_re * (y_46_im / 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.85d+102)) .or. (.not. (y_46re <= (-3.8d+31))) .and. (y_46re <= (-1.62d-49)) .or. (.not. (y_46re <= 5.2d-57))) then
tmp = (x_46im - (x_46re * (y_46im / 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.85e+102) || (!(y_46_re <= -3.8e+31) && ((y_46_re <= -1.62e-49) || !(y_46_re <= 5.2e-57)))) {
tmp = (x_46_im - (x_46_re * (y_46_im / 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.85e+102) or (not (y_46_re <= -3.8e+31) and ((y_46_re <= -1.62e-49) or not (y_46_re <= 5.2e-57))): tmp = (x_46_im - (x_46_re * (y_46_im / 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.85e+102) || (!(y_46_re <= -3.8e+31) && ((y_46_re <= -1.62e-49) || !(y_46_re <= 5.2e-57)))) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / 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.85e+102) || (~((y_46_re <= -3.8e+31)) && ((y_46_re <= -1.62e-49) || ~((y_46_re <= 5.2e-57))))) tmp = (x_46_im - (x_46_re * (y_46_im / 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.85e+102], And[N[Not[LessEqual[y$46$re, -3.8e+31]], $MachinePrecision], Or[LessEqual[y$46$re, -1.62e-49], N[Not[LessEqual[y$46$re, 5.2e-57]], $MachinePrecision]]]], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / 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.85 \cdot 10^{+102} \lor \neg \left(y.re \leq -3.8 \cdot 10^{+31}\right) \land \left(y.re \leq -1.62 \cdot 10^{-49} \lor \neg \left(y.re \leq 5.2 \cdot 10^{-57}\right)\right):\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{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.85000000000000011e102 or -3.8000000000000001e31 < y.re < -1.62e-49 or 5.19999999999999971e-57 < y.re Initial program 49.1%
Taylor expanded in y.re around inf 79.8%
mul-1-neg79.8%
unsub-neg79.8%
unsub-neg79.8%
remove-double-neg79.8%
mul-1-neg79.8%
neg-mul-179.8%
mul-1-neg79.8%
distribute-lft-in79.8%
distribute-lft-in79.8%
mul-1-neg79.8%
unsub-neg79.8%
neg-mul-179.8%
mul-1-neg79.8%
remove-double-neg79.8%
associate-/l*81.1%
Simplified81.1%
if -1.85000000000000011e102 < y.re < -3.8000000000000001e31 or -1.62e-49 < y.re < 5.19999999999999971e-57Initial program 65.1%
Taylor expanded in y.re around 0 80.3%
+-commutative80.3%
mul-1-neg80.3%
unsub-neg80.3%
unpow280.3%
associate-/r*86.9%
div-sub87.8%
associate-/l*89.4%
Simplified89.4%
Final simplification85.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.re (- y.im))))
(if (<= y.im -2.45e-6)
t_0
(if (<= y.im 5.6e+22)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (or (<= y.im 1e+165) (not (<= y.im 1.8e+184)))
t_0
(/ (* y.im (/ x.im y.im)) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -2.45e-6) {
tmp = t_0;
} else if (y_46_im <= 5.6e+22) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if ((y_46_im <= 1e+165) || !(y_46_im <= 1.8e+184)) {
tmp = t_0;
} else {
tmp = (y_46_im * (x_46_im / 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) :: t_0
real(8) :: tmp
t_0 = x_46re / -y_46im
if (y_46im <= (-2.45d-6)) then
tmp = t_0
else if (y_46im <= 5.6d+22) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else if ((y_46im <= 1d+165) .or. (.not. (y_46im <= 1.8d+184))) then
tmp = t_0
else
tmp = (y_46im * (x_46im / 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 t_0 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -2.45e-6) {
tmp = t_0;
} else if (y_46_im <= 5.6e+22) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if ((y_46_im <= 1e+165) || !(y_46_im <= 1.8e+184)) {
tmp = t_0;
} else {
tmp = (y_46_im * (x_46_im / y_46_im)) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = x_46_re / -y_46_im tmp = 0 if y_46_im <= -2.45e-6: tmp = t_0 elif y_46_im <= 5.6e+22: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif (y_46_im <= 1e+165) or not (y_46_im <= 1.8e+184): tmp = t_0 else: tmp = (y_46_im * (x_46_im / y_46_im)) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_re / Float64(-y_46_im)) tmp = 0.0 if (y_46_im <= -2.45e-6) tmp = t_0; elseif (y_46_im <= 5.6e+22) 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+165) || !(y_46_im <= 1.8e+184)) tmp = t_0; else tmp = Float64(Float64(y_46_im * Float64(x_46_im / 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) t_0 = x_46_re / -y_46_im; tmp = 0.0; if (y_46_im <= -2.45e-6) tmp = t_0; elseif (y_46_im <= 5.6e+22) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif ((y_46_im <= 1e+165) || ~((y_46_im <= 1.8e+184))) tmp = t_0; else tmp = (y_46_im * (x_46_im / y_46_im)) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$re / (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$im, -2.45e-6], t$95$0, If[LessEqual[y$46$im, 5.6e+22], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[Or[LessEqual[y$46$im, 1e+165], N[Not[LessEqual[y$46$im, 1.8e+184]], $MachinePrecision]], t$95$0, N[(N[(y$46$im * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{-y.im}\\
\mathbf{if}\;y.im \leq -2.45 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 5.6 \cdot 10^{+22}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 10^{+165} \lor \neg \left(y.im \leq 1.8 \cdot 10^{+184}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y.im \cdot \frac{x.im}{y.im}}{y.re}\\
\end{array}
\end{array}
if y.im < -2.44999999999999984e-6 or 5.6e22 < y.im < 9.99999999999999899e164 or 1.80000000000000007e184 < y.im Initial program 44.1%
Taylor expanded in y.re around 0 68.4%
associate-*r/68.4%
neg-mul-168.4%
Simplified68.4%
if -2.44999999999999984e-6 < y.im < 5.6e22Initial program 69.5%
Taylor expanded in y.re around inf 81.3%
mul-1-neg81.3%
unsub-neg81.3%
unsub-neg81.3%
remove-double-neg81.3%
mul-1-neg81.3%
neg-mul-181.3%
mul-1-neg81.3%
distribute-lft-in81.3%
distribute-lft-in81.3%
mul-1-neg81.3%
unsub-neg81.3%
neg-mul-181.3%
mul-1-neg81.3%
remove-double-neg81.3%
associate-/l*81.4%
Simplified81.4%
if 9.99999999999999899e164 < y.im < 1.80000000000000007e184Initial program 28.1%
Taylor expanded in y.re around inf 70.4%
mul-1-neg70.4%
unsub-neg70.4%
unsub-neg70.4%
remove-double-neg70.4%
mul-1-neg70.4%
neg-mul-170.4%
mul-1-neg70.4%
distribute-lft-in70.4%
distribute-lft-in70.4%
neg-mul-170.4%
mul-1-neg70.4%
remove-double-neg70.4%
associate-*r/70.4%
mul-1-neg70.4%
distribute-rgt-neg-out70.4%
Simplified70.4%
Taylor expanded in y.im around inf 70.1%
+-commutative70.1%
mul-1-neg70.1%
unsub-neg70.1%
Simplified70.1%
Taylor expanded in x.im around inf 84.2%
Final simplification75.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -2e+100)
(and (not (<= y.re -4.2e+31))
(or (<= y.re -1.04e-19) (not (<= y.re 2.35e-17)))))
(/ 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 <= -2e+100) || (!(y_46_re <= -4.2e+31) && ((y_46_re <= -1.04e-19) || !(y_46_re <= 2.35e-17)))) {
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 <= (-2d+100)) .or. (.not. (y_46re <= (-4.2d+31))) .and. (y_46re <= (-1.04d-19)) .or. (.not. (y_46re <= 2.35d-17))) 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 <= -2e+100) || (!(y_46_re <= -4.2e+31) && ((y_46_re <= -1.04e-19) || !(y_46_re <= 2.35e-17)))) {
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 <= -2e+100) or (not (y_46_re <= -4.2e+31) and ((y_46_re <= -1.04e-19) or not (y_46_re <= 2.35e-17))): 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 <= -2e+100) || (!(y_46_re <= -4.2e+31) && ((y_46_re <= -1.04e-19) || !(y_46_re <= 2.35e-17)))) 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 <= -2e+100) || (~((y_46_re <= -4.2e+31)) && ((y_46_re <= -1.04e-19) || ~((y_46_re <= 2.35e-17))))) 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, -2e+100], And[N[Not[LessEqual[y$46$re, -4.2e+31]], $MachinePrecision], Or[LessEqual[y$46$re, -1.04e-19], N[Not[LessEqual[y$46$re, 2.35e-17]], $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 \cdot 10^{+100} \lor \neg \left(y.re \leq -4.2 \cdot 10^{+31}\right) \land \left(y.re \leq -1.04 \cdot 10^{-19} \lor \neg \left(y.re \leq 2.35 \cdot 10^{-17}\right)\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -2.00000000000000003e100 or -4.19999999999999958e31 < y.re < -1.03999999999999998e-19 or 2.35e-17 < y.re Initial program 46.2%
Taylor expanded in y.re around inf 75.6%
if -2.00000000000000003e100 < y.re < -4.19999999999999958e31 or -1.03999999999999998e-19 < y.re < 2.35e-17Initial program 66.1%
Taylor expanded in y.re around 0 62.2%
associate-*r/62.2%
neg-mul-162.2%
Simplified62.2%
Final simplification68.4%
(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 45.2%
Final simplification45.2%
herbie shell --seed 2024075
(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))))