
(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 15 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(Float64(x_46_re * 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[(N[(x$46$re * N[(y$46$im / 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]), $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)}, \frac{x.re \cdot \frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)}}{-\mathsf{hypot}\left(y.im, y.re\right)}\right)
\end{array}
Initial program 64.5%
div-sub60.5%
*-commutative60.5%
add-sqr-sqrt60.5%
times-frac63.8%
fma-neg63.8%
hypot-define63.8%
hypot-define77.2%
associate-/l*80.6%
add-sqr-sqrt80.6%
pow280.6%
hypot-define80.6%
Applied egg-rr80.6%
*-un-lft-identity80.6%
unpow280.6%
times-frac97.2%
hypot-undefine80.6%
+-commutative80.6%
hypot-undefine97.2%
hypot-undefine80.6%
+-commutative80.6%
hypot-undefine97.2%
Applied egg-rr97.2%
associate-*l/97.2%
*-lft-identity97.2%
Simplified97.2%
associate-*r/97.7%
Applied egg-rr97.7%
Final simplification97.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.im (hypot y.re y.im))) (t_1 (/ y.re (hypot y.re y.im))))
(if (or (<= y.im -2.6e+141) (not (<= y.im 7e+67)))
(fma t_1 t_0 (* x.re (/ -1.0 y.im)))
(fma t_1 t_0 (* x.re (/ y.im (- (pow (hypot y.re y.im) 2.0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_im / hypot(y_46_re, y_46_im);
double t_1 = y_46_re / hypot(y_46_re, y_46_im);
double tmp;
if ((y_46_im <= -2.6e+141) || !(y_46_im <= 7e+67)) {
tmp = fma(t_1, t_0, (x_46_re * (-1.0 / y_46_im)));
} else {
tmp = fma(t_1, t_0, (x_46_re * (y_46_im / -pow(hypot(y_46_re, y_46_im), 2.0))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_im / hypot(y_46_re, y_46_im)) t_1 = Float64(y_46_re / hypot(y_46_re, y_46_im)) tmp = 0.0 if ((y_46_im <= -2.6e+141) || !(y_46_im <= 7e+67)) tmp = fma(t_1, t_0, Float64(x_46_re * Float64(-1.0 / y_46_im))); else tmp = fma(t_1, t_0, Float64(x_46_re * Float64(y_46_im / Float64(-(hypot(y_46_re, y_46_im) ^ 2.0))))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -2.6e+141], N[Not[LessEqual[y$46$im, 7e+67]], $MachinePrecision]], N[(t$95$1 * t$95$0 + N[(x$46$re * N[(-1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0 + 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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{if}\;y.im \leq -2.6 \cdot 10^{+141} \lor \neg \left(y.im \leq 7 \cdot 10^{+67}\right):\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_0, x.re \cdot \frac{-1}{y.im}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, t\_0, x.re \cdot \frac{y.im}{-{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)\\
\end{array}
\end{array}
if y.im < -2.5999999999999999e141 or 7e67 < y.im Initial program 47.0%
div-sub47.0%
*-commutative47.0%
add-sqr-sqrt47.0%
times-frac48.3%
fma-neg48.3%
hypot-define48.3%
hypot-define58.8%
associate-/l*62.6%
add-sqr-sqrt62.6%
pow262.6%
hypot-define62.6%
Applied egg-rr62.6%
Taylor expanded in y.im around inf 96.4%
if -2.5999999999999999e141 < y.im < 7e67Initial program 74.9%
div-sub68.6%
*-commutative68.6%
add-sqr-sqrt68.6%
times-frac73.1%
fma-neg73.1%
hypot-define73.1%
hypot-define88.3%
associate-/l*91.4%
add-sqr-sqrt91.4%
pow291.4%
hypot-define91.4%
Applied egg-rr91.4%
Final simplification93.2%
(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 64.5%
div-sub60.5%
*-commutative60.5%
add-sqr-sqrt60.5%
times-frac63.8%
fma-neg63.8%
hypot-define63.8%
hypot-define77.2%
associate-/l*80.6%
add-sqr-sqrt80.6%
pow280.6%
hypot-define80.6%
Applied egg-rr80.6%
*-un-lft-identity80.6%
unpow280.6%
times-frac97.2%
hypot-undefine80.6%
+-commutative80.6%
hypot-undefine97.2%
hypot-undefine80.6%
+-commutative80.6%
hypot-undefine97.2%
Applied egg-rr97.2%
associate-*l/97.2%
*-lft-identity97.2%
Simplified97.2%
Final simplification97.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 1e+285)
(/ (/ t_0 (hypot y.re y.im)) (hypot y.re y.im))
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(* x.re (/ -1.0 y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+285) {
tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
} else {
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 * (-1.0 / y_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 1e+285) tmp = Float64(Float64(t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)); else 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(-1.0 / y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $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], 1e+285], N[(N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $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 * N[(-1.0 / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 10^{+285}:\\
\;\;\;\;\frac{\frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\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{-1}{y.im}\right)\\
\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))) < 9.9999999999999998e284Initial program 82.0%
*-un-lft-identity82.0%
add-sqr-sqrt82.0%
times-frac82.0%
hypot-define82.0%
fma-neg82.0%
distribute-rgt-neg-in82.0%
hypot-define96.6%
Applied egg-rr96.6%
associate-*l/96.9%
*-un-lft-identity96.9%
distribute-rgt-neg-out96.9%
*-commutative96.9%
fma-neg96.9%
*-commutative96.9%
*-commutative96.9%
Applied egg-rr96.9%
if 9.9999999999999998e284 < (/.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 13.0%
div-sub6.8%
*-commutative6.8%
add-sqr-sqrt6.8%
times-frac16.9%
fma-neg16.9%
hypot-define16.9%
hypot-define52.5%
associate-/l*61.4%
add-sqr-sqrt61.4%
pow261.4%
hypot-define61.4%
Applied egg-rr61.4%
Taylor expanded in y.im around inf 71.5%
Final simplification90.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 1e+307)
(/ (/ t_0 (hypot y.re y.im)) (hypot y.re y.im))
(- (/ 1.0 (* y.im (/ (/ y.im y.re) x.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);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+307) {
tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
} else {
tmp = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (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 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+307) {
tmp = (t_0 / Math.hypot(y_46_re, y_46_im)) / Math.hypot(y_46_re, y_46_im);
} else {
tmp = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im);
}
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) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+307: tmp = (t_0 / math.hypot(y_46_re, y_46_im)) / math.hypot(y_46_re, y_46_im) else: tmp = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_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(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 1e+307) tmp = Float64(Float64(t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)); else tmp = Float64(Float64(1.0 / Float64(y_46_im * Float64(Float64(y_46_im / y_46_re) / x_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) t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+307) tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im); else tmp = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_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_] := Block[{t$95$0 = N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $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], 1e+307], N[(N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(y$46$im * N[(N[(y$46$im / y$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 10^{+307}:\\
\;\;\;\;\frac{\frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y.im \cdot \frac{\frac{y.im}{y.re}}{x.im}} - \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))) < 9.99999999999999986e306Initial program 82.2%
*-un-lft-identity82.2%
add-sqr-sqrt82.2%
times-frac82.3%
hypot-define82.3%
fma-neg82.3%
distribute-rgt-neg-in82.3%
hypot-define96.7%
Applied egg-rr96.7%
associate-*l/96.9%
*-un-lft-identity96.9%
distribute-rgt-neg-out96.9%
*-commutative96.9%
fma-neg96.9%
*-commutative96.9%
*-commutative96.9%
Applied egg-rr96.9%
if 9.99999999999999986e306 < (/.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 8.8%
Taylor expanded in y.re around 0 40.2%
+-commutative40.2%
mul-1-neg40.2%
unsub-neg40.2%
associate-/l*45.6%
Simplified45.6%
*-un-lft-identity45.6%
pow245.6%
times-frac54.5%
Applied egg-rr54.5%
associate-*r*56.5%
clear-num56.4%
un-div-inv56.5%
un-div-inv56.5%
Applied egg-rr56.5%
clear-num56.5%
inv-pow56.5%
Applied egg-rr56.5%
unpow-156.5%
associate-/r/56.5%
Simplified56.5%
Final simplification87.1%
(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 (- (/ 1.0 (* y.im (/ (/ y.im y.re) x.im))) (/ x.re y.im))))
(if (<= y.im -4.9e+93)
t_1
(if (<= y.im -1.95e-26)
t_0
(if (<= y.im 1.25e-140)
(- (/ x.im y.re) (* x.re (* y.im (pow y.re -2.0))))
(if (<= y.im 7e+67) 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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -4.9e+93) {
tmp = t_1;
} else if (y_46_im <= -1.95e-26) {
tmp = t_0;
} else if (y_46_im <= 1.25e-140) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im * pow(y_46_re, -2.0)));
} else if (y_46_im <= 7e+67) {
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 = (1.0d0 / (y_46im * ((y_46im / y_46re) / x_46im))) - (x_46re / y_46im)
if (y_46im <= (-4.9d+93)) then
tmp = t_1
else if (y_46im <= (-1.95d-26)) then
tmp = t_0
else if (y_46im <= 1.25d-140) then
tmp = (x_46im / y_46re) - (x_46re * (y_46im * (y_46re ** (-2.0d0))))
else if (y_46im <= 7d+67) 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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -4.9e+93) {
tmp = t_1;
} else if (y_46_im <= -1.95e-26) {
tmp = t_0;
} else if (y_46_im <= 1.25e-140) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im * Math.pow(y_46_re, -2.0)));
} else if (y_46_im <= 7e+67) {
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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -4.9e+93: tmp = t_1 elif y_46_im <= -1.95e-26: tmp = t_0 elif y_46_im <= 1.25e-140: tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im * math.pow(y_46_re, -2.0))) elif y_46_im <= 7e+67: 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(1.0 / Float64(y_46_im * Float64(Float64(y_46_im / y_46_re) / x_46_im))) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -4.9e+93) tmp = t_1; elseif (y_46_im <= -1.95e-26) tmp = t_0; elseif (y_46_im <= 1.25e-140) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im * (y_46_re ^ -2.0)))); elseif (y_46_im <= 7e+67) 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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -4.9e+93) tmp = t_1; elseif (y_46_im <= -1.95e-26) tmp = t_0; elseif (y_46_im <= 1.25e-140) tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im * (y_46_re ^ -2.0))); elseif (y_46_im <= 7e+67) 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[(1.0 / N[(y$46$im * N[(N[(y$46$im / y$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -4.9e+93], t$95$1, If[LessEqual[y$46$im, -1.95e-26], t$95$0, If[LessEqual[y$46$im, 1.25e-140], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(x$46$re * N[(y$46$im * N[Power[y$46$re, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7e+67], 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{1}{y.im \cdot \frac{\frac{y.im}{y.re}}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -4.9 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -1.95 \cdot 10^{-26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.25 \cdot 10^{-140}:\\
\;\;\;\;\frac{x.im}{y.re} - x.re \cdot \left(y.im \cdot {y.re}^{-2}\right)\\
\mathbf{elif}\;y.im \leq 7 \cdot 10^{+67}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -4.89999999999999969e93 or 7e67 < y.im Initial program 46.6%
Taylor expanded in y.re around 0 80.8%
+-commutative80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*82.9%
Simplified82.9%
*-un-lft-identity82.9%
pow282.9%
times-frac84.4%
Applied egg-rr84.4%
associate-*r*89.9%
clear-num89.9%
un-div-inv89.9%
un-div-inv89.9%
Applied egg-rr89.9%
clear-num89.9%
inv-pow89.9%
Applied egg-rr89.9%
unpow-189.9%
associate-/r/89.9%
Simplified89.9%
if -4.89999999999999969e93 < y.im < -1.94999999999999993e-26 or 1.25000000000000004e-140 < y.im < 7e67Initial program 81.9%
if -1.94999999999999993e-26 < y.im < 1.25000000000000004e-140Initial program 75.1%
Taylor expanded in y.re around inf 85.5%
+-commutative85.5%
mul-1-neg85.5%
unsub-neg85.5%
associate-/l*85.6%
Simplified85.6%
div-inv84.9%
pow-flip84.9%
metadata-eval84.9%
Applied egg-rr84.9%
Final simplification86.4%
(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 (- (/ 1.0 (* y.im (/ (/ y.im y.re) x.im))) (/ x.re y.im))))
(if (<= y.im -1.65e+93)
t_1
(if (<= y.im -4.8e-29)
t_0
(if (<= y.im 2.3e-141)
(- (/ x.im y.re) (* x.re (/ y.im (pow y.re 2.0))))
(if (<= y.im 6.5e+67) 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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -1.65e+93) {
tmp = t_1;
} else if (y_46_im <= -4.8e-29) {
tmp = t_0;
} else if (y_46_im <= 2.3e-141) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / pow(y_46_re, 2.0)));
} else if (y_46_im <= 6.5e+67) {
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 = (1.0d0 / (y_46im * ((y_46im / y_46re) / x_46im))) - (x_46re / y_46im)
if (y_46im <= (-1.65d+93)) then
tmp = t_1
else if (y_46im <= (-4.8d-29)) then
tmp = t_0
else if (y_46im <= 2.3d-141) then
tmp = (x_46im / y_46re) - (x_46re * (y_46im / (y_46re ** 2.0d0)))
else if (y_46im <= 6.5d+67) 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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -1.65e+93) {
tmp = t_1;
} else if (y_46_im <= -4.8e-29) {
tmp = t_0;
} else if (y_46_im <= 2.3e-141) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / Math.pow(y_46_re, 2.0)));
} else if (y_46_im <= 6.5e+67) {
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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -1.65e+93: tmp = t_1 elif y_46_im <= -4.8e-29: tmp = t_0 elif y_46_im <= 2.3e-141: tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / math.pow(y_46_re, 2.0))) elif y_46_im <= 6.5e+67: 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(1.0 / Float64(y_46_im * Float64(Float64(y_46_im / y_46_re) / x_46_im))) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -1.65e+93) tmp = t_1; elseif (y_46_im <= -4.8e-29) tmp = t_0; elseif (y_46_im <= 2.3e-141) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im / (y_46_re ^ 2.0)))); elseif (y_46_im <= 6.5e+67) 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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -1.65e+93) tmp = t_1; elseif (y_46_im <= -4.8e-29) tmp = t_0; elseif (y_46_im <= 2.3e-141) tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / (y_46_re ^ 2.0))); elseif (y_46_im <= 6.5e+67) 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[(1.0 / N[(y$46$im * N[(N[(y$46$im / y$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.65e+93], t$95$1, If[LessEqual[y$46$im, -4.8e-29], t$95$0, If[LessEqual[y$46$im, 2.3e-141], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(x$46$re * N[(y$46$im / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.5e+67], 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{1}{y.im \cdot \frac{\frac{y.im}{y.re}}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.65 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -4.8 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.3 \cdot 10^{-141}:\\
\;\;\;\;\frac{x.im}{y.re} - x.re \cdot \frac{y.im}{{y.re}^{2}}\\
\mathbf{elif}\;y.im \leq 6.5 \cdot 10^{+67}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.65000000000000004e93 or 6.4999999999999995e67 < y.im Initial program 46.6%
Taylor expanded in y.re around 0 80.8%
+-commutative80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*82.9%
Simplified82.9%
*-un-lft-identity82.9%
pow282.9%
times-frac84.4%
Applied egg-rr84.4%
associate-*r*89.9%
clear-num89.9%
un-div-inv89.9%
un-div-inv89.9%
Applied egg-rr89.9%
clear-num89.9%
inv-pow89.9%
Applied egg-rr89.9%
unpow-189.9%
associate-/r/89.9%
Simplified89.9%
if -1.65000000000000004e93 < y.im < -4.79999999999999984e-29 or 2.29999999999999995e-141 < y.im < 6.4999999999999995e67Initial program 81.9%
if -4.79999999999999984e-29 < y.im < 2.29999999999999995e-141Initial program 75.1%
Taylor expanded in y.re around inf 85.5%
+-commutative85.5%
mul-1-neg85.5%
unsub-neg85.5%
associate-/l*85.6%
Simplified85.6%
Final simplification86.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -2.2e+38)
(* (/ 1.0 (hypot y.re y.im)) (- x.re (* x.im (/ y.re y.im))))
(if (<= y.im 2.6e-139)
(- (/ x.im y.re) (* x.re (/ y.im (pow y.re 2.0))))
(if (<= y.im 6.4e+67)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(- (/ 1.0 (* y.im (/ (/ y.im y.re) x.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 <= -2.2e+38) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_re - (x_46_im * (y_46_re / y_46_im)));
} else if (y_46_im <= 2.6e-139) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / pow(y_46_re, 2.0)));
} else if (y_46_im <= 6.4e+67) {
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 {
tmp = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (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 tmp;
if (y_46_im <= -2.2e+38) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_re - (x_46_im * (y_46_re / y_46_im)));
} else if (y_46_im <= 2.6e-139) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / Math.pow(y_46_re, 2.0)));
} else if (y_46_im <= 6.4e+67) {
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 {
tmp = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_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_im <= -2.2e+38: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_re - (x_46_im * (y_46_re / y_46_im))) elif y_46_im <= 2.6e-139: tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / math.pow(y_46_re, 2.0))) elif y_46_im <= 6.4e+67: 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: tmp = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_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 <= -2.2e+38) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_re - Float64(x_46_im * Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 2.6e-139) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im / (y_46_re ^ 2.0)))); elseif (y_46_im <= 6.4e+67) 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))); else tmp = Float64(Float64(1.0 / Float64(y_46_im * Float64(Float64(y_46_im / y_46_re) / x_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_im <= -2.2e+38) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_re - (x_46_im * (y_46_re / y_46_im))); elseif (y_46_im <= 2.6e-139) tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im / (y_46_re ^ 2.0))); elseif (y_46_im <= 6.4e+67) 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 tmp = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_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[LessEqual[y$46$im, -2.2e+38], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re - N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.6e-139], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(x$46$re * N[(y$46$im / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.4e+67], 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], N[(N[(1.0 / N[(y$46$im * N[(N[(y$46$im / y$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.2 \cdot 10^{+38}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.re - x.im \cdot \frac{y.re}{y.im}\right)\\
\mathbf{elif}\;y.im \leq 2.6 \cdot 10^{-139}:\\
\;\;\;\;\frac{x.im}{y.re} - x.re \cdot \frac{y.im}{{y.re}^{2}}\\
\mathbf{elif}\;y.im \leq 6.4 \cdot 10^{+67}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y.im \cdot \frac{\frac{y.im}{y.re}}{x.im}} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -2.20000000000000006e38Initial program 46.5%
*-un-lft-identity46.5%
add-sqr-sqrt46.5%
times-frac46.4%
hypot-define46.4%
fma-neg46.4%
distribute-rgt-neg-in46.4%
hypot-define66.5%
Applied egg-rr66.5%
Taylor expanded in y.im around -inf 80.3%
mul-1-neg80.3%
unsub-neg80.3%
associate-/l*83.4%
Simplified83.4%
if -2.20000000000000006e38 < y.im < 2.5999999999999998e-139Initial program 76.8%
Taylor expanded in y.re around inf 83.0%
+-commutative83.0%
mul-1-neg83.0%
unsub-neg83.0%
associate-/l*83.1%
Simplified83.1%
if 2.5999999999999998e-139 < y.im < 6.39999999999999965e67Initial program 81.1%
if 6.39999999999999965e67 < y.im Initial program 50.1%
Taylor expanded in y.re around 0 84.7%
+-commutative84.7%
mul-1-neg84.7%
unsub-neg84.7%
associate-/l*87.1%
Simplified87.1%
*-un-lft-identity87.1%
pow287.1%
times-frac88.3%
Applied egg-rr88.3%
associate-*r*94.3%
clear-num94.3%
un-div-inv94.3%
un-div-inv94.3%
Applied egg-rr94.3%
clear-num94.3%
inv-pow94.3%
Applied egg-rr94.3%
unpow-194.3%
associate-/r/94.3%
Simplified94.3%
Final simplification85.1%
(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 (- (/ 1.0 (* y.im (/ (/ y.im y.re) x.im))) (/ x.re y.im))))
(if (<= y.im -2.35e+92)
t_1
(if (<= y.im -9e-193)
t_0
(if (<= y.im 1.75e-163)
(/ x.im y.re)
(if (<= y.im 1.15e+67) 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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -2.35e+92) {
tmp = t_1;
} else if (y_46_im <= -9e-193) {
tmp = t_0;
} else if (y_46_im <= 1.75e-163) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 1.15e+67) {
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 = (1.0d0 / (y_46im * ((y_46im / y_46re) / x_46im))) - (x_46re / y_46im)
if (y_46im <= (-2.35d+92)) then
tmp = t_1
else if (y_46im <= (-9d-193)) then
tmp = t_0
else if (y_46im <= 1.75d-163) then
tmp = x_46im / y_46re
else if (y_46im <= 1.15d+67) 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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -2.35e+92) {
tmp = t_1;
} else if (y_46_im <= -9e-193) {
tmp = t_0;
} else if (y_46_im <= 1.75e-163) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 1.15e+67) {
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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -2.35e+92: tmp = t_1 elif y_46_im <= -9e-193: tmp = t_0 elif y_46_im <= 1.75e-163: tmp = x_46_im / y_46_re elif y_46_im <= 1.15e+67: 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(1.0 / Float64(y_46_im * Float64(Float64(y_46_im / y_46_re) / x_46_im))) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -2.35e+92) tmp = t_1; elseif (y_46_im <= -9e-193) tmp = t_0; elseif (y_46_im <= 1.75e-163) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 1.15e+67) 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 = (1.0 / (y_46_im * ((y_46_im / y_46_re) / x_46_im))) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -2.35e+92) tmp = t_1; elseif (y_46_im <= -9e-193) tmp = t_0; elseif (y_46_im <= 1.75e-163) tmp = x_46_im / y_46_re; elseif (y_46_im <= 1.15e+67) 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[(1.0 / N[(y$46$im * N[(N[(y$46$im / y$46$re), $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.35e+92], t$95$1, If[LessEqual[y$46$im, -9e-193], t$95$0, If[LessEqual[y$46$im, 1.75e-163], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.15e+67], 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{1}{y.im \cdot \frac{\frac{y.im}{y.re}}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -2.35 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -9 \cdot 10^{-193}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.75 \cdot 10^{-163}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 1.15 \cdot 10^{+67}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -2.35e92 or 1.1499999999999999e67 < y.im Initial program 46.6%
Taylor expanded in y.re around 0 80.8%
+-commutative80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*82.9%
Simplified82.9%
*-un-lft-identity82.9%
pow282.9%
times-frac84.4%
Applied egg-rr84.4%
associate-*r*89.9%
clear-num89.9%
un-div-inv89.9%
un-div-inv89.9%
Applied egg-rr89.9%
clear-num89.9%
inv-pow89.9%
Applied egg-rr89.9%
unpow-189.9%
associate-/r/89.9%
Simplified89.9%
if -2.35e92 < y.im < -8.9999999999999997e-193 or 1.75000000000000014e-163 < y.im < 1.1499999999999999e67Initial program 81.3%
if -8.9999999999999997e-193 < y.im < 1.75000000000000014e-163Initial program 72.8%
Taylor expanded in y.re around inf 84.4%
Final simplification85.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -2.1e+143)
(/ x.im y.re)
(if (<= y.re -1.8e-30)
(/ (* y.re x.im) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 5.5e+58)
(- (/ (/ (* y.re x.im) y.im) y.im) (/ 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_re <= -2.1e+143) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -1.8e-30) {
tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 5.5e+58) {
tmp = (((y_46_re * x_46_im) / y_46_im) / y_46_im) - (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_46re <= (-2.1d+143)) then
tmp = x_46im / y_46re
else if (y_46re <= (-1.8d-30)) then
tmp = (y_46re * x_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46re <= 5.5d+58) then
tmp = (((y_46re * x_46im) / y_46im) / y_46im) - (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_re <= -2.1e+143) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -1.8e-30) {
tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 5.5e+58) {
tmp = (((y_46_re * x_46_im) / y_46_im) / y_46_im) - (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_re <= -2.1e+143: tmp = x_46_im / y_46_re elif y_46_re <= -1.8e-30: tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_re <= 5.5e+58: tmp = (((y_46_re * x_46_im) / y_46_im) / y_46_im) - (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_re <= -2.1e+143) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -1.8e-30) tmp = Float64(Float64(y_46_re * x_46_im) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_re <= 5.5e+58) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) / y_46_im) - 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_re <= -2.1e+143) tmp = x_46_im / y_46_re; elseif (y_46_re <= -1.8e-30) tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_re <= 5.5e+58) tmp = (((y_46_re * x_46_im) / y_46_im) / y_46_im) - (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$re, -2.1e+143], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -1.8e-30], N[(N[(y$46$re * x$46$im), $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, 5.5e+58], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.1 \cdot 10^{+143}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -1.8 \cdot 10^{-30}:\\
\;\;\;\;\frac{y.re \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{+58}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im}}{y.im} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -2.09999999999999988e143 or 5.4999999999999999e58 < y.re Initial program 39.3%
Taylor expanded in y.re around inf 78.4%
if -2.09999999999999988e143 < y.re < -1.8000000000000002e-30Initial program 78.7%
Taylor expanded in x.im around inf 71.1%
*-commutative71.1%
Simplified71.1%
if -1.8000000000000002e-30 < y.re < 5.4999999999999999e58Initial program 73.9%
Taylor expanded in y.re around 0 74.1%
+-commutative74.1%
mul-1-neg74.1%
unsub-neg74.1%
associate-/l*74.9%
Simplified74.9%
pow274.9%
associate-*r/74.1%
*-commutative74.1%
associate-/r*79.5%
Applied egg-rr79.5%
Final simplification78.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.16e+27) (not (<= y.im 3.35e-133))) (- (* x.im (/ (/ y.re y.im) y.im)) (/ 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.16e+27) || !(y_46_im <= 3.35e-133)) {
tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (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.16d+27)) .or. (.not. (y_46im <= 3.35d-133))) then
tmp = (x_46im * ((y_46re / y_46im) / y_46im)) - (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.16e+27) || !(y_46_im <= 3.35e-133)) {
tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (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.16e+27) or not (y_46_im <= 3.35e-133): tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (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.16e+27) || !(y_46_im <= 3.35e-133)) tmp = Float64(Float64(x_46_im * Float64(Float64(y_46_re / y_46_im) / y_46_im)) - 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.16e+27) || ~((y_46_im <= 3.35e-133))) tmp = (x_46_im * ((y_46_re / y_46_im) / y_46_im)) - (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.16e+27], N[Not[LessEqual[y$46$im, 3.35e-133]], $MachinePrecision]], N[(N[(x$46$im * N[(N[(y$46$re / y$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.16 \cdot 10^{+27} \lor \neg \left(y.im \leq 3.35 \cdot 10^{-133}\right):\\
\;\;\;\;x.im \cdot \frac{\frac{y.re}{y.im}}{y.im} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.16e27 or 3.3500000000000001e-133 < y.im Initial program 55.6%
Taylor expanded in y.re around 0 72.6%
+-commutative72.6%
mul-1-neg72.6%
unsub-neg72.6%
associate-/l*73.6%
Simplified73.6%
*-un-lft-identity73.6%
pow273.6%
times-frac74.6%
Applied egg-rr74.6%
associate-*l/74.6%
*-lft-identity74.6%
Simplified74.6%
if -1.16e27 < y.im < 3.3500000000000001e-133Initial program 76.8%
Taylor expanded in y.re around inf 76.4%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.25e+29) (not (<= y.im 3.6e-38))) (- (/ (/ x.im y.im) (/ y.im y.re)) (/ 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.25e+29) || !(y_46_im <= 3.6e-38)) {
tmp = ((x_46_im / y_46_im) / (y_46_im / y_46_re)) - (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.25d+29)) .or. (.not. (y_46im <= 3.6d-38))) then
tmp = ((x_46im / y_46im) / (y_46im / y_46re)) - (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.25e+29) || !(y_46_im <= 3.6e-38)) {
tmp = ((x_46_im / y_46_im) / (y_46_im / y_46_re)) - (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.25e+29) or not (y_46_im <= 3.6e-38): tmp = ((x_46_im / y_46_im) / (y_46_im / y_46_re)) - (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.25e+29) || !(y_46_im <= 3.6e-38)) tmp = Float64(Float64(Float64(x_46_im / y_46_im) / Float64(y_46_im / y_46_re)) - 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.25e+29) || ~((y_46_im <= 3.6e-38))) tmp = ((x_46_im / y_46_im) / (y_46_im / y_46_re)) - (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.25e+29], N[Not[LessEqual[y$46$im, 3.6e-38]], $MachinePrecision]], N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.25 \cdot 10^{+29} \lor \neg \left(y.im \leq 3.6 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{\frac{x.im}{y.im}}{\frac{y.im}{y.re}} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.25e29 or 3.6000000000000001e-38 < y.im Initial program 53.9%
Taylor expanded in y.re around 0 75.3%
+-commutative75.3%
mul-1-neg75.3%
unsub-neg75.3%
associate-/l*76.4%
Simplified76.4%
*-un-lft-identity76.4%
pow276.4%
times-frac77.5%
Applied egg-rr77.5%
associate-*r*82.3%
clear-num81.9%
un-div-inv81.9%
un-div-inv81.9%
Applied egg-rr81.9%
if -1.25e29 < y.im < 3.6000000000000001e-38Initial program 76.0%
Taylor expanded in y.re around inf 72.2%
Final simplification77.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -7.2e-31) (not (<= y.re 2.6e+57))) (/ x.im y.re) (- (/ (/ (* y.re x.im) y.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 <= -7.2e-31) || !(y_46_re <= 2.6e+57)) {
tmp = x_46_im / y_46_re;
} else {
tmp = (((y_46_re * x_46_im) / y_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 <= (-7.2d-31)) .or. (.not. (y_46re <= 2.6d+57))) then
tmp = x_46im / y_46re
else
tmp = (((y_46re * x_46im) / y_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 <= -7.2e-31) || !(y_46_re <= 2.6e+57)) {
tmp = x_46_im / y_46_re;
} else {
tmp = (((y_46_re * x_46_im) / y_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 <= -7.2e-31) or not (y_46_re <= 2.6e+57): tmp = x_46_im / y_46_re else: tmp = (((y_46_re * x_46_im) / y_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 <= -7.2e-31) || !(y_46_re <= 2.6e+57)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_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 <= -7.2e-31) || ~((y_46_re <= 2.6e+57))) tmp = x_46_im / y_46_re; else tmp = (((y_46_re * x_46_im) / y_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, -7.2e-31], N[Not[LessEqual[y$46$re, 2.6e+57]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -7.2 \cdot 10^{-31} \lor \neg \left(y.re \leq 2.6 \cdot 10^{+57}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im}}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -7.20000000000000007e-31 or 2.6e57 < y.re Initial program 52.3%
Taylor expanded in y.re around inf 71.8%
if -7.20000000000000007e-31 < y.re < 2.6e57Initial program 73.9%
Taylor expanded in y.re around 0 74.1%
+-commutative74.1%
mul-1-neg74.1%
unsub-neg74.1%
associate-/l*74.9%
Simplified74.9%
pow274.9%
associate-*r/74.1%
*-commutative74.1%
associate-/r*79.5%
Applied egg-rr79.5%
Final simplification76.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -8.5e+101) (not (<= y.im 2.9e+60))) (/ 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 <= -8.5e+101) || !(y_46_im <= 2.9e+60)) {
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 <= (-8.5d+101)) .or. (.not. (y_46im <= 2.9d+60))) 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 <= -8.5e+101) || !(y_46_im <= 2.9e+60)) {
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 <= -8.5e+101) or not (y_46_im <= 2.9e+60): 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 <= -8.5e+101) || !(y_46_im <= 2.9e+60)) tmp = Float64(x_46_re / Float64(-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 <= -8.5e+101) || ~((y_46_im <= 2.9e+60))) 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, -8.5e+101], N[Not[LessEqual[y$46$im, 2.9e+60]], $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 -8.5 \cdot 10^{+101} \lor \neg \left(y.im \leq 2.9 \cdot 10^{+60}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -8.5000000000000001e101 or 2.9e60 < y.im Initial program 47.9%
Taylor expanded in y.re around 0 77.8%
associate-*r/77.8%
neg-mul-177.8%
Simplified77.8%
if -8.5000000000000001e101 < y.im < 2.9e60Initial program 76.0%
Taylor expanded in y.re around inf 65.5%
Final simplification70.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 64.5%
Taylor expanded in y.re around inf 44.9%
Final simplification44.9%
herbie shell --seed 2024048
(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))))