
(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 13 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 (/ (hypot y.re y.im) y.im)) (- (hypot y.re y.im)))))
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 / (hypot(y_46_re, y_46_im) / y_46_im)) / -hypot(y_46_re, y_46_im)));
}
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(hypot(y_46_re, y_46_im) / y_46_im)) / Float64(-hypot(y_46_re, y_46_im)))) 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[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / (-N[Sqrt[y$46$re ^ 2 + y$46$im ^ 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{\frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}}}{-\mathsf{hypot}\left(y.re, y.im\right)}\right)
\end{array}
Initial program 65.3%
div-sub63.3%
*-commutative63.3%
add-sqr-sqrt63.3%
times-frac65.3%
fma-neg65.3%
hypot-define65.3%
hypot-define78.1%
associate-/l*79.7%
add-sqr-sqrt79.7%
pow279.7%
hypot-define79.7%
Applied egg-rr79.7%
*-un-lft-identity79.7%
unpow279.7%
times-frac95.5%
Applied egg-rr95.5%
associate-*l/95.5%
*-lft-identity95.5%
hypot-undefine79.7%
unpow279.7%
unpow279.7%
+-commutative79.7%
unpow279.7%
unpow279.7%
hypot-define95.5%
hypot-undefine79.7%
unpow279.7%
unpow279.7%
+-commutative79.7%
unpow279.7%
unpow279.7%
hypot-define95.5%
Simplified95.5%
associate-*r/98.0%
distribute-neg-frac298.0%
clear-num98.0%
un-div-inv98.0%
hypot-undefine80.9%
+-commutative80.9%
hypot-undefine98.0%
hypot-undefine80.9%
+-commutative80.9%
hypot-undefine98.0%
Applied egg-rr98.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.im (hypot y.re y.im))))
(if (<= y.re -1.05e+148)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.re -8.7e-113)
(fma
(/ y.re (hypot y.re y.im))
t_0
(* (/ y.im (pow (hypot y.re y.im) 2.0)) (- x.re)))
(if (<= y.re 7.8e-147)
(/ (- (/ (* y.re x.im) y.im) x.re) y.im)
(if (<= y.re 2.45e+44)
(*
(/ 1.0 (hypot y.re y.im))
(/ (- (* y.re x.im) (* y.im x.re)) (hypot y.re y.im)))
(fma
1.0
t_0
(/
(/ x.re (/ (hypot y.re y.im) y.im))
(- (hypot y.re y.im))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_im / hypot(y_46_re, y_46_im);
double tmp;
if (y_46_re <= -1.05e+148) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_re <= -8.7e-113) {
tmp = fma((y_46_re / hypot(y_46_re, y_46_im)), t_0, ((y_46_im / pow(hypot(y_46_re, y_46_im), 2.0)) * -x_46_re));
} else if (y_46_re <= 7.8e-147) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 2.45e+44) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (((y_46_re * x_46_im) - (y_46_im * x_46_re)) / hypot(y_46_re, y_46_im));
} else {
tmp = fma(1.0, t_0, ((x_46_re / (hypot(y_46_re, y_46_im) / y_46_im)) / -hypot(y_46_re, y_46_im)));
}
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)) tmp = 0.0 if (y_46_re <= -1.05e+148) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_re <= -8.7e-113) tmp = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), t_0, Float64(Float64(y_46_im / (hypot(y_46_re, y_46_im) ^ 2.0)) * Float64(-x_46_re))); elseif (y_46_re <= 7.8e-147) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 2.45e+44) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / hypot(y_46_re, y_46_im))); else tmp = fma(1.0, t_0, Float64(Float64(x_46_re / Float64(hypot(y_46_re, y_46_im) / y_46_im)) / Float64(-hypot(y_46_re, y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.05e+148], 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, -8.7e-113], N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * t$95$0 + N[(N[(y$46$im / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * (-x$46$re)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 7.8e-147], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.45e+44], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * t$95$0 + N[(N[(x$46$re / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / (-N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{if}\;y.re \leq -1.05 \cdot 10^{+148}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq -8.7 \cdot 10^{-113}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, t\_0, \frac{y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \cdot \left(-x.re\right)\right)\\
\mathbf{elif}\;y.re \leq 7.8 \cdot 10^{-147}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{+44}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re \cdot x.im - y.im \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, t\_0, \frac{\frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}}}{-\mathsf{hypot}\left(y.re, y.im\right)}\right)\\
\end{array}
\end{array}
if y.re < -1.04999999999999999e148Initial program 43.0%
Taylor expanded in y.re around inf 82.6%
mul-1-neg82.6%
unsub-neg82.6%
associate-/l*93.4%
Simplified93.4%
if -1.04999999999999999e148 < y.re < -8.69999999999999954e-113Initial program 80.1%
div-sub80.1%
*-commutative80.1%
add-sqr-sqrt80.1%
times-frac85.4%
fma-neg85.4%
hypot-define85.4%
hypot-define93.4%
associate-/l*93.5%
add-sqr-sqrt93.5%
pow293.5%
hypot-define93.5%
Applied egg-rr93.5%
if -8.69999999999999954e-113 < y.re < 7.7999999999999996e-147Initial program 69.0%
div-sub63.0%
*-commutative63.0%
add-sqr-sqrt63.0%
times-frac60.0%
fma-neg60.0%
hypot-define60.0%
hypot-define61.3%
associate-/l*66.4%
add-sqr-sqrt66.4%
pow266.4%
hypot-define66.4%
Applied egg-rr66.4%
Taylor expanded in y.im around inf 94.4%
if 7.7999999999999996e-147 < y.re < 2.45000000000000018e44Initial program 83.4%
*-un-lft-identity83.4%
add-sqr-sqrt83.4%
times-frac83.3%
hypot-define83.3%
hypot-define96.7%
Applied egg-rr96.7%
if 2.45000000000000018e44 < y.re Initial program 38.5%
div-sub38.5%
*-commutative38.5%
add-sqr-sqrt38.5%
times-frac48.0%
fma-neg48.0%
hypot-define48.0%
hypot-define82.6%
associate-/l*81.4%
add-sqr-sqrt81.4%
pow281.4%
hypot-define81.4%
Applied egg-rr81.4%
*-un-lft-identity81.4%
unpow281.4%
times-frac95.8%
Applied egg-rr95.8%
associate-*l/95.9%
*-lft-identity95.9%
hypot-undefine81.4%
unpow281.4%
unpow281.4%
+-commutative81.4%
unpow281.4%
unpow281.4%
hypot-define95.9%
hypot-undefine81.4%
unpow281.4%
unpow281.4%
+-commutative81.4%
unpow281.4%
unpow281.4%
hypot-define95.9%
Simplified95.9%
associate-*r/99.8%
distribute-neg-frac299.8%
clear-num99.9%
un-div-inv99.9%
hypot-undefine83.4%
+-commutative83.4%
hypot-undefine99.9%
hypot-undefine83.4%
+-commutative83.4%
hypot-undefine99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around inf 96.1%
Final simplification94.7%
(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 65.3%
div-sub63.3%
*-commutative63.3%
add-sqr-sqrt63.3%
times-frac65.3%
fma-neg65.3%
hypot-define65.3%
hypot-define78.1%
associate-/l*79.7%
add-sqr-sqrt79.7%
pow279.7%
hypot-define79.7%
Applied egg-rr79.7%
*-un-lft-identity79.7%
unpow279.7%
times-frac95.5%
Applied egg-rr95.5%
associate-*l/95.5%
*-lft-identity95.5%
hypot-undefine79.7%
unpow279.7%
unpow279.7%
+-commutative79.7%
unpow279.7%
unpow279.7%
hypot-define95.5%
hypot-undefine79.7%
unpow279.7%
unpow279.7%
+-commutative79.7%
unpow279.7%
unpow279.7%
hypot-define95.5%
Simplified95.5%
Final simplification95.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re)))
(t_1 (/ t_0 (+ (* y.re y.re) (* y.im y.im)))))
(if (<= t_1 (- INFINITY))
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= t_1 2e+285)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(fma
1.0
(/ x.im (hypot y.re y.im))
(/ (/ x.re (/ (hypot y.re y.im) y.im)) (- (hypot y.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 t_1 = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (t_1 <= 2e+285) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = fma(1.0, (x_46_im / hypot(y_46_re, y_46_im)), ((x_46_re / (hypot(y_46_re, y_46_im) / y_46_im)) / -hypot(y_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)) t_1 = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (t_1 <= 2e+285) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); else tmp = fma(1.0, Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(x_46_re / Float64(hypot(y_46_re, y_46_im) / y_46_im)) / Float64(-hypot(y_46_re, y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[t$95$1, 2e+285], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / (-N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
t_1 := \frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+285}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{\frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}}}{-\mathsf{hypot}\left(y.re, y.im\right)}\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))) < -inf.0Initial program 54.9%
Taylor expanded in y.re around 0 69.4%
+-commutative69.4%
mul-1-neg69.4%
unsub-neg69.4%
unpow269.4%
associate-/r*84.9%
div-sub84.9%
*-commutative84.9%
associate-/l*88.1%
Simplified88.1%
if -inf.0 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 2e285Initial program 85.6%
*-un-lft-identity85.6%
add-sqr-sqrt85.6%
times-frac85.6%
hypot-define85.6%
hypot-define98.9%
Applied egg-rr98.9%
if 2e285 < (/.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 16.8%
div-sub12.3%
*-commutative12.3%
add-sqr-sqrt12.3%
times-frac20.9%
fma-neg20.9%
hypot-define20.9%
hypot-define50.9%
associate-/l*54.0%
add-sqr-sqrt54.0%
pow254.0%
hypot-define54.0%
Applied egg-rr54.0%
*-un-lft-identity54.0%
unpow254.0%
times-frac96.4%
Applied egg-rr96.4%
associate-*l/96.4%
*-lft-identity96.4%
hypot-undefine54.0%
unpow254.0%
unpow254.0%
+-commutative54.0%
unpow254.0%
unpow254.0%
hypot-define96.4%
hypot-undefine54.0%
unpow254.0%
unpow254.0%
+-commutative54.0%
unpow254.0%
unpow254.0%
hypot-define96.4%
Simplified96.4%
associate-*r/99.8%
distribute-neg-frac299.8%
clear-num99.8%
un-div-inv99.8%
hypot-undefine54.0%
+-commutative54.0%
hypot-undefine99.8%
hypot-undefine54.0%
+-commutative54.0%
hypot-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in y.re around inf 72.1%
Final simplification91.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(/ 1.0 (hypot y.re y.im))
(/ (- (* y.re x.im) (* y.im x.re)) (hypot y.re y.im))))
(t_1 (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
(if (<= y.re -1.7e+143)
t_1
(if (<= y.re -6.2e-113)
t_0
(if (<= y.re 7.5e-147)
(/ (- (/ (* y.re x.im) y.im) x.re) y.im)
(if (<= y.re 1.9e+124) 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 = (1.0 / hypot(y_46_re, y_46_im)) * (((y_46_re * x_46_im) - (y_46_im * x_46_re)) / hypot(y_46_re, 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 <= -1.7e+143) {
tmp = t_1;
} else if (y_46_re <= -6.2e-113) {
tmp = t_0;
} else if (y_46_re <= 7.5e-147) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.9e+124) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (1.0 / Math.hypot(y_46_re, y_46_im)) * (((y_46_re * x_46_im) - (y_46_im * x_46_re)) / Math.hypot(y_46_re, 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 <= -1.7e+143) {
tmp = t_1;
} else if (y_46_re <= -6.2e-113) {
tmp = t_0;
} else if (y_46_re <= 7.5e-147) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.9e+124) {
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 = (1.0 / math.hypot(y_46_re, y_46_im)) * (((y_46_re * x_46_im) - (y_46_im * x_46_re)) / math.hypot(y_46_re, 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 <= -1.7e+143: tmp = t_1 elif y_46_re <= -6.2e-113: tmp = t_0 elif y_46_re <= 7.5e-147: tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im elif y_46_re <= 1.9e+124: 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(1.0 / hypot(y_46_re, y_46_im)) * Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / hypot(y_46_re, 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 <= -1.7e+143) tmp = t_1; elseif (y_46_re <= -6.2e-113) tmp = t_0; elseif (y_46_re <= 7.5e-147) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 1.9e+124) 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 = (1.0 / hypot(y_46_re, y_46_im)) * (((y_46_re * x_46_im) - (y_46_im * x_46_re)) / hypot(y_46_re, 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 <= -1.7e+143) tmp = t_1; elseif (y_46_re <= -6.2e-113) tmp = t_0; elseif (y_46_re <= 7.5e-147) tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im; elseif (y_46_re <= 1.9e+124) 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[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $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, -1.7e+143], t$95$1, If[LessEqual[y$46$re, -6.2e-113], t$95$0, If[LessEqual[y$46$re, 7.5e-147], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.9e+124], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{y.re \cdot x.im - y.im \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := \frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -1.7 \cdot 10^{+143}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -6.2 \cdot 10^{-113}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 7.5 \cdot 10^{-147}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.9 \cdot 10^{+124}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.69999999999999991e143 or 1.8999999999999999e124 < y.re Initial program 32.9%
Taylor expanded in y.re around inf 80.1%
mul-1-neg80.1%
unsub-neg80.1%
associate-/l*89.7%
Simplified89.7%
if -1.69999999999999991e143 < y.re < -6.20000000000000024e-113 or 7.50000000000000047e-147 < y.re < 1.8999999999999999e124Initial program 81.4%
*-un-lft-identity81.4%
add-sqr-sqrt81.4%
times-frac81.4%
hypot-define81.4%
hypot-define89.5%
Applied egg-rr89.5%
if -6.20000000000000024e-113 < y.re < 7.50000000000000047e-147Initial program 69.0%
div-sub63.0%
*-commutative63.0%
add-sqr-sqrt63.0%
times-frac60.0%
fma-neg60.0%
hypot-define60.0%
hypot-define61.3%
associate-/l*66.4%
add-sqr-sqrt66.4%
pow266.4%
hypot-define66.4%
Applied egg-rr66.4%
Taylor expanded in y.im around inf 94.4%
Final simplification91.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -1.25e+42)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im -1.2e-118)
t_0
(if (<= y.im 8e-60)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 2.35e+62)
t_0
(/ (- (* 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 t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.25e+42) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= -1.2e-118) {
tmp = t_0;
} else if (y_46_im <= 8e-60) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 2.35e+62) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46im <= (-1.25d+42)) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else if (y_46im <= (-1.2d-118)) then
tmp = t_0
else if (y_46im <= 8d-60) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else if (y_46im <= 2.35d+62) then
tmp = t_0
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 t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.25e+42) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= -1.2e-118) {
tmp = t_0;
} else if (y_46_im <= 8e-60) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 2.35e+62) {
tmp = t_0;
} 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): 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_im <= -1.25e+42: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= -1.2e-118: tmp = t_0 elif y_46_im <= 8e-60: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 2.35e+62: tmp = t_0 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) t_0 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -1.25e+42) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= -1.2e-118) tmp = t_0; elseif (y_46_im <= 8e-60) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 2.35e+62) tmp = t_0; 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) 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_im <= -1.25e+42) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= -1.2e-118) tmp = t_0; elseif (y_46_im <= 8e-60) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 2.35e+62) tmp = t_0; 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_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.25e+42], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -1.2e-118], t$95$0, If[LessEqual[y$46$im, 8e-60], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 2.35e+62], t$95$0, 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}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.25 \cdot 10^{+42}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -1.2 \cdot 10^{-118}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 8 \cdot 10^{-60}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+62}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -1.25000000000000002e42Initial program 38.6%
Taylor expanded in y.re around 0 64.7%
+-commutative64.7%
mul-1-neg64.7%
unsub-neg64.7%
unpow264.7%
associate-/r*68.0%
div-sub68.0%
*-commutative68.0%
associate-/l*82.7%
Simplified82.7%
if -1.25000000000000002e42 < y.im < -1.2000000000000001e-118 or 7.9999999999999998e-60 < y.im < 2.3500000000000001e62Initial program 90.9%
if -1.2000000000000001e-118 < y.im < 7.9999999999999998e-60Initial program 73.9%
Taylor expanded in y.re around inf 93.6%
mul-1-neg93.6%
unsub-neg93.6%
associate-/l*94.5%
Simplified94.5%
if 2.3500000000000001e62 < y.im Initial program 39.7%
div-sub39.7%
*-commutative39.7%
add-sqr-sqrt39.7%
times-frac39.9%
fma-neg39.9%
hypot-define39.9%
hypot-define49.9%
associate-/l*59.4%
add-sqr-sqrt59.4%
pow259.4%
hypot-define59.4%
Applied egg-rr59.4%
Taylor expanded in y.im around inf 81.6%
associate-/l*83.7%
Simplified83.7%
Final simplification89.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.6e-15) (not (<= y.im 4.6e-53))) (/ (- (* x.im (/ y.re y.im)) x.re) y.im) (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.6e-15) || !(y_46_im <= 4.6e-53)) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-2.6d-15)) .or. (.not. (y_46im <= 4.6d-53))) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.6e-15) || !(y_46_im <= 4.6e-53)) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -2.6e-15) or not (y_46_im <= 4.6e-53): tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -2.6e-15) || !(y_46_im <= 4.6e-53)) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -2.6e-15) || ~((y_46_im <= 4.6e-53))) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -2.6e-15], N[Not[LessEqual[y$46$im, 4.6e-53]], $MachinePrecision]], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.6 \cdot 10^{-15} \lor \neg \left(y.im \leq 4.6 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -2.60000000000000004e-15 or 4.6000000000000003e-53 < y.im Initial program 55.6%
div-sub55.6%
*-commutative55.6%
add-sqr-sqrt55.6%
times-frac54.4%
fma-neg54.4%
hypot-define54.4%
hypot-define64.2%
associate-/l*68.8%
add-sqr-sqrt68.8%
pow268.8%
hypot-define68.8%
Applied egg-rr68.8%
Taylor expanded in y.im around inf 71.8%
associate-/l*75.4%
Simplified75.4%
if -2.60000000000000004e-15 < y.im < 4.6000000000000003e-53Initial program 75.2%
Taylor expanded in y.re around inf 88.8%
mul-1-neg88.8%
unsub-neg88.8%
associate-/l*89.5%
Simplified89.5%
Final simplification82.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.7e+32) (not (<= y.im 8500000000.0))) (/ x.re (- y.im)) (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -3.7e+32) || !(y_46_im <= 8500000000.0)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-3.7d+32)) .or. (.not. (y_46im <= 8500000000.0d0))) then
tmp = x_46re / -y_46im
else
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -3.7e+32) || !(y_46_im <= 8500000000.0)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -3.7e+32) or not (y_46_im <= 8500000000.0): tmp = x_46_re / -y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -3.7e+32) || !(y_46_im <= 8500000000.0)) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -3.7e+32) || ~((y_46_im <= 8500000000.0))) tmp = x_46_re / -y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -3.7e+32], N[Not[LessEqual[y$46$im, 8500000000.0]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.7 \cdot 10^{+32} \lor \neg \left(y.im \leq 8500000000\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -3.7e32 or 8.5e9 < y.im Initial program 45.5%
Taylor expanded in y.re around 0 67.8%
associate-*r/67.8%
neg-mul-167.8%
Simplified67.8%
if -3.7e32 < y.im < 8.5e9Initial program 78.7%
Taylor expanded in y.re around inf 81.1%
mul-1-neg81.1%
unsub-neg81.1%
associate-/l*81.7%
Simplified81.7%
Final simplification76.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -4.9e-14)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im 4.6e-53)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(/ (- (/ x.im (/ y.im y.re)) x.re) y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -4.9e-14) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 4.6e-53) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = ((x_46_im / (y_46_im / y_46_re)) - 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_46im <= (-4.9d-14)) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else if (y_46im <= 4.6d-53) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else
tmp = ((x_46im / (y_46im / y_46re)) - 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_im <= -4.9e-14) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 4.6e-53) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = ((x_46_im / (y_46_im / y_46_re)) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -4.9e-14: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= 4.6e-53: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re else: tmp = ((x_46_im / (y_46_im / y_46_re)) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -4.9e-14) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= 4.6e-53) 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_im / y_46_re)) - 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 <= -4.9e-14) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= 4.6e-53) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; else tmp = ((x_46_im / (y_46_im / y_46_re)) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -4.9e-14], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 4.6e-53], 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$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.9 \cdot 10^{-14}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 4.6 \cdot 10^{-53}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x.im}{\frac{y.im}{y.re}} - x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -4.89999999999999995e-14Initial program 48.7%
Taylor expanded in y.re around 0 63.6%
+-commutative63.6%
mul-1-neg63.6%
unsub-neg63.6%
unpow263.6%
associate-/r*66.4%
div-sub66.4%
*-commutative66.4%
associate-/l*78.7%
Simplified78.7%
if -4.89999999999999995e-14 < y.im < 4.6000000000000003e-53Initial program 75.2%
Taylor expanded in y.re around inf 88.8%
mul-1-neg88.8%
unsub-neg88.8%
associate-/l*89.5%
Simplified89.5%
if 4.6000000000000003e-53 < y.im Initial program 60.5%
div-sub60.5%
*-commutative60.5%
add-sqr-sqrt60.5%
times-frac58.2%
fma-neg58.2%
hypot-define58.2%
hypot-define65.8%
associate-/l*71.7%
add-sqr-sqrt71.7%
pow271.7%
hypot-define71.7%
Applied egg-rr71.7%
Taylor expanded in y.im around inf 75.6%
associate-/l*76.9%
Simplified76.9%
clear-num76.9%
un-div-inv76.9%
Applied egg-rr76.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -4.2e-15)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im 4.6e-53)
(/ (- 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_im <= -4.2e-15) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 4.6e-53) {
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_46im <= (-4.2d-15)) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else if (y_46im <= 4.6d-53) 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_im <= -4.2e-15) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 4.6e-53) {
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_im <= -4.2e-15: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= 4.6e-53: 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_im <= -4.2e-15) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= 4.6e-53) 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_im <= -4.2e-15) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= 4.6e-53) 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[LessEqual[y$46$im, -4.2e-15], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 4.6e-53], 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.im \leq -4.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 4.6 \cdot 10^{-53}:\\
\;\;\;\;\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.im < -4.19999999999999962e-15Initial program 48.7%
Taylor expanded in y.re around 0 63.6%
+-commutative63.6%
mul-1-neg63.6%
unsub-neg63.6%
unpow263.6%
associate-/r*66.4%
div-sub66.4%
*-commutative66.4%
associate-/l*78.7%
Simplified78.7%
if -4.19999999999999962e-15 < y.im < 4.6000000000000003e-53Initial program 75.2%
Taylor expanded in y.re around inf 88.8%
mul-1-neg88.8%
unsub-neg88.8%
associate-/l*89.5%
Simplified89.5%
if 4.6000000000000003e-53 < y.im Initial program 60.5%
div-sub60.5%
*-commutative60.5%
add-sqr-sqrt60.5%
times-frac58.2%
fma-neg58.2%
hypot-define58.2%
hypot-define65.8%
associate-/l*71.7%
add-sqr-sqrt71.7%
pow271.7%
hypot-define71.7%
Applied egg-rr71.7%
Taylor expanded in y.im around inf 75.6%
associate-/l*76.9%
Simplified76.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -9.5e-107) (not (<= y.re 19500000000000.0))) (/ x.im y.re) (/ x.re (- y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -9.5e-107) || !(y_46_re <= 19500000000000.0)) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_re / -y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-9.5d-107)) .or. (.not. (y_46re <= 19500000000000.0d0))) then
tmp = x_46im / y_46re
else
tmp = x_46re / -y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -9.5e-107) || !(y_46_re <= 19500000000000.0)) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_re / -y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -9.5e-107) or not (y_46_re <= 19500000000000.0): tmp = x_46_im / y_46_re else: tmp = x_46_re / -y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -9.5e-107) || !(y_46_re <= 19500000000000.0)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(x_46_re / Float64(-y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -9.5e-107) || ~((y_46_re <= 19500000000000.0))) tmp = x_46_im / y_46_re; else tmp = x_46_re / -y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -9.5e-107], N[Not[LessEqual[y$46$re, 19500000000000.0]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(x$46$re / (-y$46$im)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -9.5 \cdot 10^{-107} \lor \neg \left(y.re \leq 19500000000000\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -9.4999999999999999e-107 or 1.95e13 < y.re Initial program 58.4%
Taylor expanded in y.re around inf 61.3%
if -9.4999999999999999e-107 < y.re < 1.95e13Initial program 73.3%
Taylor expanded in y.re around 0 65.0%
associate-*r/65.0%
neg-mul-165.0%
Simplified65.0%
Final simplification63.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.25e+223) (not (<= y.im 3.9e+154))) (/ 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 <= -2.25e+223) || !(y_46_im <= 3.9e+154)) {
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 <= (-2.25d+223)) .or. (.not. (y_46im <= 3.9d+154))) 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 <= -2.25e+223) || !(y_46_im <= 3.9e+154)) {
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 <= -2.25e+223) or not (y_46_im <= 3.9e+154): 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 <= -2.25e+223) || !(y_46_im <= 3.9e+154)) tmp = Float64(x_46_re / y_46_im); else tmp = Float64(x_46_im / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -2.25e+223) || ~((y_46_im <= 3.9e+154))) 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, -2.25e+223], N[Not[LessEqual[y$46$im, 3.9e+154]], $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 -2.25 \cdot 10^{+223} \lor \neg \left(y.im \leq 3.9 \cdot 10^{+154}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -2.25e223 or 3.9000000000000003e154 < y.im Initial program 33.4%
*-un-lft-identity33.4%
add-sqr-sqrt33.4%
times-frac33.4%
hypot-define33.4%
hypot-define54.7%
Applied egg-rr54.7%
Taylor expanded in y.im around -inf 47.7%
Taylor expanded in y.re around 0 32.3%
if -2.25e223 < y.im < 3.9000000000000003e154Initial program 71.8%
Taylor expanded in y.re around inf 47.1%
Final simplification44.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46re
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.re}
\end{array}
Initial program 65.3%
Taylor expanded in y.re around inf 40.4%
herbie shell --seed 2024144
(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))))