
(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)) (/ (* (/ y.im (hypot y.im y.re)) (- x.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)), (((y_46_im / hypot(y_46_im, y_46_re)) * -x_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(Float64(y_46_im / hypot(y_46_im, y_46_re)) * Float64(-x_46_re)) / 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[(N[(y$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * (-x$46$re)), $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{\frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \left(-x.re\right)}{\mathsf{hypot}\left(y.im, y.re\right)}\right)
\end{array}
Initial program 63.0%
div-sub61.0%
*-commutative61.0%
add-sqr-sqrt61.0%
times-frac62.1%
fma-neg62.1%
hypot-define62.1%
hypot-define76.4%
associate-/l*79.7%
add-sqr-sqrt79.7%
pow279.7%
hypot-define79.7%
Applied egg-rr79.7%
*-un-lft-identity79.7%
unpow279.7%
times-frac97.6%
add-sqr-sqrt47.5%
sqrt-prod59.3%
sqr-neg59.3%
sqrt-unprod31.1%
add-sqr-sqrt58.5%
hypot-undefine56.4%
+-commutative56.4%
hypot-define58.5%
add-sqr-sqrt31.1%
sqrt-unprod59.3%
sqr-neg59.3%
sqrt-prod47.5%
add-sqr-sqrt97.6%
hypot-undefine79.7%
+-commutative79.7%
hypot-define97.6%
Applied egg-rr97.6%
*-commutative97.6%
associate-*l/97.6%
*-un-lft-identity97.6%
associate-*l/99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* y.re (/ x.im (hypot y.im y.re))) (hypot y.im y.re)))
(t_1 (+ (* y.re y.re) (* y.im y.im)))
(t_2
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(/ x.re (- y.im)))))
(if (<= y.re -3.8e+133)
t_0
(if (<= y.re -1.9e-131)
(/
(+ (* y.re x.im) (fma x.re (- y.im) (fma x.re (- y.im) (* y.im x.re))))
t_1)
(if (<= y.re 8.2e-29)
t_2
(if (<= y.re 1.3e+44)
(/ (fma (- y.im) x.re (* y.re x.im)) t_1)
(if (<= y.re 1.36e+79) t_2 t_0)))))))
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 / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re);
double t_1 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double t_2 = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), (x_46_re / -y_46_im));
double tmp;
if (y_46_re <= -3.8e+133) {
tmp = t_0;
} else if (y_46_re <= -1.9e-131) {
tmp = ((y_46_re * x_46_im) + fma(x_46_re, -y_46_im, fma(x_46_re, -y_46_im, (y_46_im * x_46_re)))) / t_1;
} else if (y_46_re <= 8.2e-29) {
tmp = t_2;
} else if (y_46_re <= 1.3e+44) {
tmp = fma(-y_46_im, x_46_re, (y_46_re * x_46_im)) / t_1;
} else if (y_46_re <= 1.36e+79) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * Float64(x_46_im / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)) t_1 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) t_2 = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(x_46_re / Float64(-y_46_im))) tmp = 0.0 if (y_46_re <= -3.8e+133) tmp = t_0; elseif (y_46_re <= -1.9e-131) tmp = Float64(Float64(Float64(y_46_re * x_46_im) + fma(x_46_re, Float64(-y_46_im), fma(x_46_re, Float64(-y_46_im), Float64(y_46_im * x_46_re)))) / t_1); elseif (y_46_re <= 8.2e-29) tmp = t_2; elseif (y_46_re <= 1.3e+44) tmp = Float64(fma(Float64(-y_46_im), x_46_re, Float64(y_46_re * x_46_im)) / t_1); elseif (y_46_re <= 1.36e+79) tmp = t_2; else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * N[(x$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]}, Block[{t$95$1 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(x$46$re / (-y$46$im)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.8e+133], t$95$0, If[LessEqual[y$46$re, -1.9e-131], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * (-y$46$im) + N[(x$46$re * (-y$46$im) + N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 8.2e-29], t$95$2, If[LessEqual[y$46$re, 1.3e+44], N[(N[((-y$46$im) * x$46$re + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.36e+79], t$95$2, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot \frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
t_1 := y.re \cdot y.re + y.im \cdot y.im\\
t_2 := \mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.re}{-y.im}\right)\\
\mathbf{if}\;y.re \leq -3.8 \cdot 10^{+133}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -1.9 \cdot 10^{-131}:\\
\;\;\;\;\frac{y.re \cdot x.im + \mathsf{fma}\left(x.re, -y.im, \mathsf{fma}\left(x.re, -y.im, y.im \cdot x.re\right)\right)}{t\_1}\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{-29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{+44}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-y.im, x.re, y.re \cdot x.im\right)}{t\_1}\\
\mathbf{elif}\;y.re \leq 1.36 \cdot 10^{+79}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.8000000000000002e133 or 1.36000000000000003e79 < y.re Initial program 34.7%
Taylor expanded in x.im around inf 35.1%
rem-square-sqrt35.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-undefine35.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-undefine35.1%
unpow235.1%
*-commutative35.1%
associate-*r/36.1%
hypot-undefine36.1%
unpow236.1%
unpow236.1%
+-commutative36.1%
unpow236.1%
unpow236.1%
hypot-define36.1%
Simplified36.1%
associate-*r/35.1%
unpow235.1%
hypot-undefine35.1%
unpow235.1%
hypot-undefine35.1%
unpow235.1%
add-sqr-sqrt35.1%
+-commutative35.1%
unpow235.1%
rem-square-sqrt35.1%
hypot-undefine35.1%
hypot-undefine35.1%
frac-times79.9%
associate-*l/79.9%
Applied egg-rr79.9%
if -3.8000000000000002e133 < y.re < -1.89999999999999997e-131Initial program 90.6%
prod-diff90.6%
*-commutative90.6%
fma-define90.6%
associate-+l+90.6%
distribute-rgt-neg-in90.6%
fma-define90.7%
*-commutative90.7%
fma-undefine90.6%
distribute-lft-neg-in90.6%
*-commutative90.6%
distribute-rgt-neg-in90.6%
fma-define90.7%
Applied egg-rr90.7%
if -1.89999999999999997e-131 < y.re < 8.1999999999999996e-29 or 1.3e44 < y.re < 1.36000000000000003e79Initial program 66.5%
div-sub61.4%
*-commutative61.4%
add-sqr-sqrt61.3%
times-frac62.3%
fma-neg62.3%
hypot-define62.3%
hypot-define64.3%
associate-/l*70.1%
add-sqr-sqrt70.1%
pow270.1%
hypot-define70.1%
Applied egg-rr70.1%
Taylor expanded in y.im around inf 95.2%
if 8.1999999999999996e-29 < y.re < 1.3e44Initial program 89.5%
sub-neg89.5%
+-commutative89.5%
*-commutative89.5%
distribute-lft-neg-in89.5%
fma-define89.5%
Applied egg-rr89.5%
Final simplification88.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
2e+281)
(*
(/ 1.0 (hypot y.re y.im))
(/ (fma x.im y.re (* x.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 (- 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 * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 2e+281) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (fma(x_46_im, y_46_re, (x_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 / -y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (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))) <= 2e+281) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(fma(x_46_im, y_46_re, Float64(x_46_re * Float64(-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(-y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[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], 2e+281], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(x$46$im * y$46$re + N[(x$46$re * (-y$46$im)), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $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 / (-y$46$im)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im} \leq 2 \cdot 10^{+281}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.im, y.re, x.re \cdot \left(-y.im\right)\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)}, \frac{x.re}{-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))) < 2.0000000000000001e281Initial program 78.0%
*-un-lft-identity78.0%
add-sqr-sqrt78.0%
times-frac78.1%
hypot-define78.1%
fma-neg78.1%
distribute-rgt-neg-in78.1%
hypot-define96.9%
Applied egg-rr96.9%
if 2.0000000000000001e281 < (/.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 15.0%
div-sub10.0%
*-commutative10.0%
add-sqr-sqrt10.0%
times-frac11.2%
fma-neg11.2%
hypot-define11.2%
hypot-define44.3%
associate-/l*54.0%
add-sqr-sqrt54.0%
pow254.0%
hypot-define54.0%
Applied egg-rr54.0%
Taylor expanded in y.im around inf 73.3%
Final simplification91.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im)))
(t_1 (/ (* y.re (/ x.im (hypot y.im y.re))) (hypot y.im y.re)))
(t_2 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.re -4.2e+134)
t_1
(if (<= y.re -1.05e-139)
(/ (- (* y.re x.im) (* y.im x.re)) t_0)
(if (<= y.re 2e-29)
t_2
(if (<= y.re 1.6e+44)
(/ (fma (- y.im) x.re (* y.re x.im)) t_0)
(if (<= y.re 1.25e+79) t_2 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 * y_46_re) + (y_46_im * y_46_im);
double t_1 = (y_46_re * (x_46_im / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re);
double t_2 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_re <= -4.2e+134) {
tmp = t_1;
} else if (y_46_re <= -1.05e-139) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_0;
} else if (y_46_re <= 2e-29) {
tmp = t_2;
} else if (y_46_re <= 1.6e+44) {
tmp = fma(-y_46_im, x_46_re, (y_46_re * x_46_im)) / t_0;
} else if (y_46_re <= 1.25e+79) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) t_1 = Float64(Float64(y_46_re * Float64(x_46_im / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)) t_2 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_re <= -4.2e+134) tmp = t_1; elseif (y_46_re <= -1.05e-139) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / t_0); elseif (y_46_re <= 2e-29) tmp = t_2; elseif (y_46_re <= 1.6e+44) tmp = Float64(fma(Float64(-y_46_im), x_46_re, Float64(y_46_re * x_46_im)) / t_0); elseif (y_46_re <= 1.25e+79) tmp = t_2; else tmp = t_1; 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 * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y$46$re * N[(x$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]}, Block[{t$95$2 = N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -4.2e+134], t$95$1, If[LessEqual[y$46$re, -1.05e-139], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 2e-29], t$95$2, If[LessEqual[y$46$re, 1.6e+44], N[(N[((-y$46$im) * x$46$re + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.25e+79], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
t_1 := \frac{y.re \cdot \frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
t_2 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.re \leq -4.2 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.05 \cdot 10^{-139}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{t\_0}\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{-29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{+44}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-y.im, x.re, y.re \cdot x.im\right)}{t\_0}\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{+79}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -4.2000000000000002e134 or 1.25e79 < y.re Initial program 34.7%
Taylor expanded in x.im around inf 35.1%
rem-square-sqrt35.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-undefine35.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-undefine35.1%
unpow235.1%
*-commutative35.1%
associate-*r/36.1%
hypot-undefine36.1%
unpow236.1%
unpow236.1%
+-commutative36.1%
unpow236.1%
unpow236.1%
hypot-define36.1%
Simplified36.1%
associate-*r/35.1%
unpow235.1%
hypot-undefine35.1%
unpow235.1%
hypot-undefine35.1%
unpow235.1%
add-sqr-sqrt35.1%
+-commutative35.1%
unpow235.1%
rem-square-sqrt35.1%
hypot-undefine35.1%
hypot-undefine35.1%
frac-times79.9%
associate-*l/79.9%
Applied egg-rr79.9%
if -4.2000000000000002e134 < y.re < -1.05000000000000004e-139Initial program 90.6%
if -1.05000000000000004e-139 < y.re < 1.99999999999999989e-29 or 1.60000000000000002e44 < y.re < 1.25e79Initial program 66.5%
div-sub61.4%
*-commutative61.4%
add-sqr-sqrt61.3%
times-frac62.3%
fma-neg62.3%
hypot-define62.3%
hypot-define64.3%
associate-/l*70.1%
add-sqr-sqrt70.1%
pow270.1%
hypot-define70.1%
Applied egg-rr70.1%
*-un-lft-identity70.1%
unpow270.1%
times-frac99.8%
add-sqr-sqrt49.6%
sqrt-prod48.7%
sqr-neg48.7%
sqrt-unprod19.6%
add-sqr-sqrt37.1%
hypot-undefine31.7%
+-commutative31.7%
hypot-define37.1%
add-sqr-sqrt19.6%
sqrt-unprod48.7%
sqr-neg48.7%
sqrt-prod49.6%
add-sqr-sqrt99.8%
hypot-undefine70.1%
+-commutative70.1%
hypot-define99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y.re around 0 83.3%
neg-mul-183.3%
associate-*r/83.9%
+-commutative83.9%
unsub-neg83.9%
*-lft-identity83.9%
unpow283.9%
times-frac90.2%
*-commutative90.2%
associate-*r/90.2%
*-rgt-identity90.2%
associate-/l*91.0%
div-sub92.1%
Simplified92.1%
if 1.99999999999999989e-29 < y.re < 1.60000000000000002e44Initial program 89.5%
sub-neg89.5%
+-commutative89.5%
*-commutative89.5%
distribute-lft-neg-in89.5%
fma-define89.5%
Applied egg-rr89.5%
Final simplification87.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* y.re (/ x.im (hypot y.im y.re))) (hypot y.im y.re)))
(t_1 (+ (* y.re y.re) (* y.im y.im)))
(t_2 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.re -9.2e+133)
t_0
(if (<= y.re -1.9e-136)
(/
(+ (* y.re x.im) (fma x.re (- y.im) (fma x.re (- y.im) (* y.im x.re))))
t_1)
(if (<= y.re 1.2e-28)
t_2
(if (<= y.re 1.6e+44)
(/ (fma (- y.im) x.re (* y.re x.im)) t_1)
(if (<= y.re 1.7e+79) t_2 t_0)))))))
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 / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re);
double t_1 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double t_2 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_re <= -9.2e+133) {
tmp = t_0;
} else if (y_46_re <= -1.9e-136) {
tmp = ((y_46_re * x_46_im) + fma(x_46_re, -y_46_im, fma(x_46_re, -y_46_im, (y_46_im * x_46_re)))) / t_1;
} else if (y_46_re <= 1.2e-28) {
tmp = t_2;
} else if (y_46_re <= 1.6e+44) {
tmp = fma(-y_46_im, x_46_re, (y_46_re * x_46_im)) / t_1;
} else if (y_46_re <= 1.7e+79) {
tmp = t_2;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * Float64(x_46_im / hypot(y_46_im, y_46_re))) / hypot(y_46_im, y_46_re)) t_1 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) t_2 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_re <= -9.2e+133) tmp = t_0; elseif (y_46_re <= -1.9e-136) tmp = Float64(Float64(Float64(y_46_re * x_46_im) + fma(x_46_re, Float64(-y_46_im), fma(x_46_re, Float64(-y_46_im), Float64(y_46_im * x_46_re)))) / t_1); elseif (y_46_re <= 1.2e-28) tmp = t_2; elseif (y_46_re <= 1.6e+44) tmp = Float64(fma(Float64(-y_46_im), x_46_re, Float64(y_46_re * x_46_im)) / t_1); elseif (y_46_re <= 1.7e+79) tmp = t_2; else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * N[(x$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]}, Block[{t$95$1 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -9.2e+133], t$95$0, If[LessEqual[y$46$re, -1.9e-136], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] + N[(x$46$re * (-y$46$im) + N[(x$46$re * (-y$46$im) + N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.2e-28], t$95$2, If[LessEqual[y$46$re, 1.6e+44], N[(N[((-y$46$im) * x$46$re + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 1.7e+79], t$95$2, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot \frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\
t_1 := y.re \cdot y.re + y.im \cdot y.im\\
t_2 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.re \leq -9.2 \cdot 10^{+133}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -1.9 \cdot 10^{-136}:\\
\;\;\;\;\frac{y.re \cdot x.im + \mathsf{fma}\left(x.re, -y.im, \mathsf{fma}\left(x.re, -y.im, y.im \cdot x.re\right)\right)}{t\_1}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-28}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{+44}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-y.im, x.re, y.re \cdot x.im\right)}{t\_1}\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{+79}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -9.1999999999999996e133 or 1.70000000000000016e79 < y.re Initial program 34.7%
Taylor expanded in x.im around inf 35.1%
rem-square-sqrt35.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-undefine35.1%
+-commutative35.1%
unpow235.1%
unpow235.1%
hypot-undefine35.1%
unpow235.1%
*-commutative35.1%
associate-*r/36.1%
hypot-undefine36.1%
unpow236.1%
unpow236.1%
+-commutative36.1%
unpow236.1%
unpow236.1%
hypot-define36.1%
Simplified36.1%
associate-*r/35.1%
unpow235.1%
hypot-undefine35.1%
unpow235.1%
hypot-undefine35.1%
unpow235.1%
add-sqr-sqrt35.1%
+-commutative35.1%
unpow235.1%
rem-square-sqrt35.1%
hypot-undefine35.1%
hypot-undefine35.1%
frac-times79.9%
associate-*l/79.9%
Applied egg-rr79.9%
if -9.1999999999999996e133 < y.re < -1.9000000000000001e-136Initial program 90.6%
prod-diff90.6%
*-commutative90.6%
fma-define90.6%
associate-+l+90.6%
distribute-rgt-neg-in90.6%
fma-define90.7%
*-commutative90.7%
fma-undefine90.6%
distribute-lft-neg-in90.6%
*-commutative90.6%
distribute-rgt-neg-in90.6%
fma-define90.7%
Applied egg-rr90.7%
if -1.9000000000000001e-136 < y.re < 1.2000000000000001e-28 or 1.60000000000000002e44 < y.re < 1.70000000000000016e79Initial program 66.5%
div-sub61.4%
*-commutative61.4%
add-sqr-sqrt61.3%
times-frac62.3%
fma-neg62.3%
hypot-define62.3%
hypot-define64.3%
associate-/l*70.1%
add-sqr-sqrt70.1%
pow270.1%
hypot-define70.1%
Applied egg-rr70.1%
*-un-lft-identity70.1%
unpow270.1%
times-frac99.8%
add-sqr-sqrt49.6%
sqrt-prod48.7%
sqr-neg48.7%
sqrt-unprod19.6%
add-sqr-sqrt37.1%
hypot-undefine31.7%
+-commutative31.7%
hypot-define37.1%
add-sqr-sqrt19.6%
sqrt-unprod48.7%
sqr-neg48.7%
sqrt-prod49.6%
add-sqr-sqrt99.8%
hypot-undefine70.1%
+-commutative70.1%
hypot-define99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y.re around 0 83.3%
neg-mul-183.3%
associate-*r/83.9%
+-commutative83.9%
unsub-neg83.9%
*-lft-identity83.9%
unpow283.9%
times-frac90.2%
*-commutative90.2%
associate-*r/90.2%
*-rgt-identity90.2%
associate-/l*91.0%
div-sub92.1%
Simplified92.1%
if 1.2000000000000001e-28 < y.re < 1.60000000000000002e44Initial program 89.5%
sub-neg89.5%
+-commutative89.5%
*-commutative89.5%
distribute-lft-neg-in89.5%
fma-define89.5%
Applied egg-rr89.5%
Final simplification87.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.re -2.12e+133)
(- (/ x.im y.re) (* x.re (* y.im (pow y.re -2.0))))
(if (<= y.re -6e-131)
(/ (- (* y.re x.im) (* y.im x.re)) t_0)
(if (<= y.re 2e-29)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.re 2.5e+40)
(/ (fma (- y.im) x.re (* y.re x.im)) t_0)
(/ x.im (* (hypot y.im y.re) (/ (hypot y.im y.re) y.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_re <= -2.12e+133) {
tmp = (x_46_im / y_46_re) - (x_46_re * (y_46_im * pow(y_46_re, -2.0)));
} else if (y_46_re <= -6e-131) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_0;
} else if (y_46_re <= 2e-29) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 2.5e+40) {
tmp = fma(-y_46_im, x_46_re, (y_46_re * x_46_im)) / t_0;
} else {
tmp = x_46_im / (hypot(y_46_im, y_46_re) * (hypot(y_46_im, y_46_re) / y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) tmp = 0.0 if (y_46_re <= -2.12e+133) 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_re <= -6e-131) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / t_0); elseif (y_46_re <= 2e-29) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_re <= 2.5e+40) tmp = Float64(fma(Float64(-y_46_im), x_46_re, Float64(y_46_re * x_46_im)) / t_0); else tmp = Float64(x_46_im / Float64(hypot(y_46_im, y_46_re) * Float64(hypot(y_46_im, y_46_re) / y_46_re))); 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 * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.12e+133], 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$re, -6e-131], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 2e-29], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.5e+40], N[(N[((-y$46$im) * x$46$re + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(x$46$im / N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] * N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
\mathbf{if}\;y.re \leq -2.12 \cdot 10^{+133}:\\
\;\;\;\;\frac{x.im}{y.re} - x.re \cdot \left(y.im \cdot {y.re}^{-2}\right)\\
\mathbf{elif}\;y.re \leq -6 \cdot 10^{-131}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{t\_0}\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{-29}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+40}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-y.im, x.re, y.re \cdot x.im\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right) \cdot \frac{\mathsf{hypot}\left(y.im, y.re\right)}{y.re}}\\
\end{array}
\end{array}
if y.re < -2.12e133Initial program 30.2%
Taylor expanded in y.re around inf 74.5%
+-commutative74.5%
mul-1-neg74.5%
unsub-neg74.5%
associate-/l*77.3%
Simplified77.3%
div-inv77.3%
pow-flip79.1%
metadata-eval79.1%
Applied egg-rr79.1%
if -2.12e133 < y.re < -5.99999999999999992e-131Initial program 90.6%
if -5.99999999999999992e-131 < y.re < 1.99999999999999989e-29Initial program 69.7%
div-sub64.0%
*-commutative64.0%
add-sqr-sqrt64.0%
times-frac65.1%
fma-neg65.1%
hypot-define65.1%
hypot-define65.1%
associate-/l*71.4%
add-sqr-sqrt71.4%
pow271.4%
hypot-define71.4%
Applied egg-rr71.4%
*-un-lft-identity71.4%
unpow271.4%
times-frac99.8%
add-sqr-sqrt49.1%
sqrt-prod51.2%
sqr-neg51.2%
sqrt-unprod19.3%
add-sqr-sqrt35.2%
hypot-undefine29.2%
+-commutative29.2%
hypot-define35.2%
add-sqr-sqrt19.3%
sqrt-unprod51.2%
sqr-neg51.2%
sqrt-prod49.1%
add-sqr-sqrt99.8%
hypot-undefine71.3%
+-commutative71.3%
hypot-define99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
associate-*l/100.0%
Applied egg-rr100.0%
Taylor expanded in y.re around 0 86.8%
neg-mul-186.8%
associate-*r/87.3%
+-commutative87.3%
unsub-neg87.3%
*-lft-identity87.3%
unpow287.3%
times-frac92.1%
*-commutative92.1%
associate-*r/92.2%
*-rgt-identity92.2%
associate-/l*92.2%
div-sub93.3%
Simplified93.3%
if 1.99999999999999989e-29 < y.re < 2.50000000000000002e40Initial program 89.0%
sub-neg89.0%
+-commutative89.0%
*-commutative89.0%
distribute-lft-neg-in89.0%
fma-define89.1%
Applied egg-rr89.1%
if 2.50000000000000002e40 < y.re Initial program 39.1%
Taylor expanded in x.im around inf 39.7%
rem-square-sqrt39.7%
+-commutative39.7%
unpow239.7%
unpow239.7%
hypot-undefine39.7%
+-commutative39.7%
unpow239.7%
unpow239.7%
hypot-undefine39.7%
unpow239.7%
*-commutative39.7%
associate-*r/40.7%
hypot-undefine40.7%
unpow240.7%
unpow240.7%
+-commutative40.7%
unpow240.7%
unpow240.7%
hypot-define40.7%
Simplified40.7%
associate-*r/39.7%
unpow239.7%
hypot-undefine39.7%
unpow239.7%
hypot-undefine39.7%
unpow239.7%
add-sqr-sqrt39.7%
+-commutative39.7%
unpow239.7%
rem-square-sqrt39.7%
hypot-undefine39.7%
hypot-undefine39.7%
frac-times76.5%
clear-num76.5%
frac-times74.8%
*-un-lft-identity74.8%
Applied egg-rr74.8%
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 (- (/ x.im y.re) (* x.re (* y.im (pow y.re -2.0)))))
(t_2 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.re -2.12e+133)
t_1
(if (<= y.re -5.5e-129)
t_0
(if (<= y.re 2.4e-29)
t_2
(if (<= y.re 1.75e+44) t_0 (if (<= y.re 1e+88) t_2 t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - (x_46_re * (y_46_im * pow(y_46_re, -2.0)));
double t_2 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_re <= -2.12e+133) {
tmp = t_1;
} else if (y_46_re <= -5.5e-129) {
tmp = t_0;
} else if (y_46_re <= 2.4e-29) {
tmp = t_2;
} else if (y_46_re <= 1.75e+44) {
tmp = t_0;
} else if (y_46_re <= 1e+88) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_0 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im / y_46re) - (x_46re * (y_46im * (y_46re ** (-2.0d0))))
t_2 = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
if (y_46re <= (-2.12d+133)) then
tmp = t_1
else if (y_46re <= (-5.5d-129)) then
tmp = t_0
else if (y_46re <= 2.4d-29) then
tmp = t_2
else if (y_46re <= 1.75d+44) then
tmp = t_0
else if (y_46re <= 1d+88) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - (x_46_re * (y_46_im * Math.pow(y_46_re, -2.0)));
double t_2 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_re <= -2.12e+133) {
tmp = t_1;
} else if (y_46_re <= -5.5e-129) {
tmp = t_0;
} else if (y_46_re <= 2.4e-29) {
tmp = t_2;
} else if (y_46_re <= 1.75e+44) {
tmp = t_0;
} else if (y_46_re <= 1e+88) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_im / y_46_re) - (x_46_re * (y_46_im * math.pow(y_46_re, -2.0))) t_2 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im tmp = 0 if y_46_re <= -2.12e+133: tmp = t_1 elif y_46_re <= -5.5e-129: tmp = t_0 elif y_46_re <= 2.4e-29: tmp = t_2 elif y_46_re <= 1.75e+44: tmp = t_0 elif y_46_re <= 1e+88: tmp = t_2 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im * (y_46_re ^ -2.0)))) t_2 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_re <= -2.12e+133) tmp = t_1; elseif (y_46_re <= -5.5e-129) tmp = t_0; elseif (y_46_re <= 2.4e-29) tmp = t_2; elseif (y_46_re <= 1.75e+44) tmp = t_0; elseif (y_46_re <= 1e+88) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_im / y_46_re) - (x_46_re * (y_46_im * (y_46_re ^ -2.0))); t_2 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_re <= -2.12e+133) tmp = t_1; elseif (y_46_re <= -5.5e-129) tmp = t_0; elseif (y_46_re <= 2.4e-29) tmp = t_2; elseif (y_46_re <= 1.75e+44) tmp = t_0; elseif (y_46_re <= 1e+88) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(x$46$re * N[(y$46$im * N[Power[y$46$re, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -2.12e+133], t$95$1, If[LessEqual[y$46$re, -5.5e-129], t$95$0, If[LessEqual[y$46$re, 2.4e-29], t$95$2, If[LessEqual[y$46$re, 1.75e+44], t$95$0, If[LessEqual[y$46$re, 1e+88], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im}{y.re} - x.re \cdot \left(y.im \cdot {y.re}^{-2}\right)\\
t_2 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.re \leq -2.12 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -5.5 \cdot 10^{-129}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.4 \cdot 10^{-29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+44}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 10^{+88}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.12e133 or 9.99999999999999959e87 < y.re Initial program 34.0%
Taylor expanded in y.re around inf 73.6%
+-commutative73.6%
mul-1-neg73.6%
unsub-neg73.6%
associate-/l*77.8%
Simplified77.8%
div-inv77.8%
pow-flip78.9%
metadata-eval78.9%
Applied egg-rr78.9%
if -2.12e133 < y.re < -5.50000000000000023e-129 or 2.39999999999999992e-29 < y.re < 1.75e44Initial program 90.3%
if -5.50000000000000023e-129 < y.re < 2.39999999999999992e-29 or 1.75e44 < y.re < 9.99999999999999959e87Initial program 65.9%
div-sub60.9%
*-commutative60.9%
add-sqr-sqrt60.9%
times-frac61.9%
fma-neg61.9%
hypot-define61.9%
hypot-define64.6%
associate-/l*70.3%
add-sqr-sqrt70.3%
pow270.3%
hypot-define70.3%
Applied egg-rr70.3%
*-un-lft-identity70.3%
unpow270.3%
times-frac99.8%
add-sqr-sqrt48.7%
sqrt-prod47.9%
sqr-neg47.9%
sqrt-unprod21.7%
add-sqr-sqrt38.6%
hypot-undefine33.3%
+-commutative33.3%
hypot-define38.6%
add-sqr-sqrt21.7%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-prod48.7%
add-sqr-sqrt99.8%
hypot-undefine70.3%
+-commutative70.3%
hypot-define99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around 0 82.1%
neg-mul-182.1%
associate-*r/82.7%
+-commutative82.7%
unsub-neg82.7%
*-lft-identity82.7%
unpow282.7%
times-frac88.7%
*-commutative88.7%
associate-*r/88.7%
*-rgt-identity88.7%
associate-/l*90.4%
div-sub91.4%
Simplified91.4%
Final simplification87.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (* x.im (/ y.re y.im)) x.re) y.im))
(t_1 (- (/ x.im y.re) (* x.re (* y.im (pow y.re -2.0)))))
(t_2 (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.re -2.2e+135)
t_1
(if (<= y.re -1.1e-136)
(/ (- (* y.re x.im) (* y.im x.re)) t_2)
(if (<= y.re 3.3e-29)
t_0
(if (<= y.re 1.75e+44)
(/ (fma (- y.im) x.re (* y.re x.im)) t_2)
(if (<= y.re 9.6e+87) t_0 t_1)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double t_1 = (x_46_im / y_46_re) - (x_46_re * (y_46_im * pow(y_46_re, -2.0)));
double t_2 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_re <= -2.2e+135) {
tmp = t_1;
} else if (y_46_re <= -1.1e-136) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / t_2;
} else if (y_46_re <= 3.3e-29) {
tmp = t_0;
} else if (y_46_re <= 1.75e+44) {
tmp = fma(-y_46_im, x_46_re, (y_46_re * x_46_im)) / t_2;
} else if (y_46_re <= 9.6e+87) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) t_1 = Float64(Float64(x_46_im / y_46_re) - Float64(x_46_re * Float64(y_46_im * (y_46_re ^ -2.0)))) t_2 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) tmp = 0.0 if (y_46_re <= -2.2e+135) tmp = t_1; elseif (y_46_re <= -1.1e-136) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / t_2); elseif (y_46_re <= 3.3e-29) tmp = t_0; elseif (y_46_re <= 1.75e+44) tmp = Float64(fma(Float64(-y_46_im), x_46_re, Float64(y_46_re * x_46_im)) / t_2); elseif (y_46_re <= 9.6e+87) tmp = t_0; else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.2e+135], t$95$1, If[LessEqual[y$46$re, -1.1e-136], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 3.3e-29], t$95$0, If[LessEqual[y$46$re, 1.75e+44], N[(N[((-y$46$im) * x$46$re + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[y$46$re, 9.6e+87], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
t_1 := \frac{x.im}{y.re} - x.re \cdot \left(y.im \cdot {y.re}^{-2}\right)\\
t_2 := y.re \cdot y.re + y.im \cdot y.im\\
\mathbf{if}\;y.re \leq -2.2 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.1 \cdot 10^{-136}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{t\_2}\\
\mathbf{elif}\;y.re \leq 3.3 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+44}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-y.im, x.re, y.re \cdot x.im\right)}{t\_2}\\
\mathbf{elif}\;y.re \leq 9.6 \cdot 10^{+87}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -2.1999999999999999e135 or 9.59999999999999926e87 < y.re Initial program 34.0%
Taylor expanded in y.re around inf 73.6%
+-commutative73.6%
mul-1-neg73.6%
unsub-neg73.6%
associate-/l*77.8%
Simplified77.8%
div-inv77.8%
pow-flip78.9%
metadata-eval78.9%
Applied egg-rr78.9%
if -2.1999999999999999e135 < y.re < -1.1000000000000001e-136Initial program 90.6%
if -1.1000000000000001e-136 < y.re < 3.30000000000000028e-29 or 1.75e44 < y.re < 9.59999999999999926e87Initial program 65.9%
div-sub60.9%
*-commutative60.9%
add-sqr-sqrt60.9%
times-frac61.9%
fma-neg61.9%
hypot-define61.9%
hypot-define64.6%
associate-/l*70.3%
add-sqr-sqrt70.3%
pow270.3%
hypot-define70.3%
Applied egg-rr70.3%
*-un-lft-identity70.3%
unpow270.3%
times-frac99.8%
add-sqr-sqrt48.7%
sqrt-prod47.9%
sqr-neg47.9%
sqrt-unprod21.7%
add-sqr-sqrt38.6%
hypot-undefine33.3%
+-commutative33.3%
hypot-define38.6%
add-sqr-sqrt21.7%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-prod48.7%
add-sqr-sqrt99.8%
hypot-undefine70.3%
+-commutative70.3%
hypot-define99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around 0 82.1%
neg-mul-182.1%
associate-*r/82.7%
+-commutative82.7%
unsub-neg82.7%
*-lft-identity82.7%
unpow282.7%
times-frac88.7%
*-commutative88.7%
associate-*r/88.7%
*-rgt-identity88.7%
associate-/l*90.4%
div-sub91.4%
Simplified91.4%
if 3.30000000000000028e-29 < y.re < 1.75e44Initial program 89.5%
sub-neg89.5%
+-commutative89.5%
*-commutative89.5%
distribute-lft-neg-in89.5%
fma-define89.5%
Applied egg-rr89.5%
Final simplification87.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (* x.im (/ y.re y.im)) x.re) y.im))
(t_1
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -1.3e+135)
(/ x.im y.re)
(if (<= y.re -1.8e-135)
t_1
(if (<= y.re 2e-29)
t_0
(if (<= y.re 1.75e+44)
t_1
(if (<= y.re 9.6e+87) t_0 (/ x.im (hypot y.im y.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.3e+135) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -1.8e-135) {
tmp = t_1;
} else if (y_46_re <= 2e-29) {
tmp = t_0;
} else if (y_46_re <= 1.75e+44) {
tmp = t_1;
} else if (y_46_re <= 9.6e+87) {
tmp = t_0;
} else {
tmp = x_46_im / hypot(y_46_im, y_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.3e+135) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -1.8e-135) {
tmp = t_1;
} else if (y_46_re <= 2e-29) {
tmp = t_0;
} else if (y_46_re <= 1.75e+44) {
tmp = t_1;
} else if (y_46_re <= 9.6e+87) {
tmp = t_0;
} else {
tmp = x_46_im / Math.hypot(y_46_im, y_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -1.3e+135: tmp = x_46_im / y_46_re elif y_46_re <= -1.8e-135: tmp = t_1 elif y_46_re <= 2e-29: tmp = t_0 elif y_46_re <= 1.75e+44: tmp = t_1 elif y_46_re <= 9.6e+87: tmp = t_0 else: tmp = x_46_im / math.hypot(y_46_im, y_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) t_1 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -1.3e+135) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -1.8e-135) tmp = t_1; elseif (y_46_re <= 2e-29) tmp = t_0; elseif (y_46_re <= 1.75e+44) tmp = t_1; elseif (y_46_re <= 9.6e+87) tmp = t_0; else tmp = Float64(x_46_im / hypot(y_46_im, y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -1.3e+135) tmp = x_46_im / y_46_re; elseif (y_46_re <= -1.8e-135) tmp = t_1; elseif (y_46_re <= 2e-29) tmp = t_0; elseif (y_46_re <= 1.75e+44) tmp = t_1; elseif (y_46_re <= 9.6e+87) tmp = t_0; else tmp = x_46_im / hypot(y_46_im, y_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{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]}, Block[{t$95$1 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.3e+135], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -1.8e-135], t$95$1, If[LessEqual[y$46$re, 2e-29], t$95$0, If[LessEqual[y$46$re, 1.75e+44], t$95$1, If[LessEqual[y$46$re, 9.6e+87], t$95$0, N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
t_1 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.3 \cdot 10^{+135}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -1.8 \cdot 10^{-135}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 9.6 \cdot 10^{+87}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\end{array}
\end{array}
if y.re < -1.3e135Initial program 30.2%
Taylor expanded in y.re around inf 77.3%
if -1.3e135 < y.re < -1.79999999999999989e-135 or 1.99999999999999989e-29 < y.re < 1.75e44Initial program 90.3%
if -1.79999999999999989e-135 < y.re < 1.99999999999999989e-29 or 1.75e44 < y.re < 9.59999999999999926e87Initial program 65.9%
div-sub60.9%
*-commutative60.9%
add-sqr-sqrt60.9%
times-frac61.9%
fma-neg61.9%
hypot-define61.9%
hypot-define64.6%
associate-/l*70.3%
add-sqr-sqrt70.3%
pow270.3%
hypot-define70.3%
Applied egg-rr70.3%
*-un-lft-identity70.3%
unpow270.3%
times-frac99.8%
add-sqr-sqrt48.7%
sqrt-prod47.9%
sqr-neg47.9%
sqrt-unprod21.7%
add-sqr-sqrt38.6%
hypot-undefine33.3%
+-commutative33.3%
hypot-define38.6%
add-sqr-sqrt21.7%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-prod48.7%
add-sqr-sqrt99.8%
hypot-undefine70.3%
+-commutative70.3%
hypot-define99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around 0 82.1%
neg-mul-182.1%
associate-*r/82.7%
+-commutative82.7%
unsub-neg82.7%
*-lft-identity82.7%
unpow282.7%
times-frac88.7%
*-commutative88.7%
associate-*r/88.7%
*-rgt-identity88.7%
associate-/l*90.4%
div-sub91.4%
Simplified91.4%
if 9.59999999999999926e87 < y.re Initial program 37.7%
Taylor expanded in x.im around inf 38.1%
rem-square-sqrt38.1%
+-commutative38.1%
unpow238.1%
unpow238.1%
hypot-undefine38.1%
+-commutative38.1%
unpow238.1%
unpow238.1%
hypot-undefine38.1%
unpow238.1%
*-commutative38.1%
associate-*r/39.1%
hypot-undefine39.1%
unpow239.1%
unpow239.1%
+-commutative39.1%
unpow239.1%
unpow239.1%
hypot-define39.1%
Simplified39.1%
associate-*r/38.1%
unpow238.1%
hypot-undefine38.1%
unpow238.1%
hypot-undefine38.1%
unpow238.1%
add-sqr-sqrt38.1%
+-commutative38.1%
unpow238.1%
rem-square-sqrt38.1%
hypot-undefine38.1%
hypot-undefine38.1%
frac-times80.5%
associate-*l/80.5%
Applied egg-rr80.5%
Taylor expanded in y.re around inf 78.3%
Final simplification86.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* y.re x.im) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.re -2.9e+92)
(/ x.im y.re)
(if (<= y.re -3.1e-84)
t_0
(if (<= y.re -6.6e-128)
(/ (* y.im x.re) (- (* y.re (- y.re)) (* y.im y.im)))
(if (<= y.re 7.2e-26)
t_1
(if (<= y.re 2.7e+39)
t_0
(if (<= y.re 3.8e+89) t_1 (/ x.im y.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_re <= -2.9e+92) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -3.1e-84) {
tmp = t_0;
} else if (y_46_re <= -6.6e-128) {
tmp = (y_46_im * x_46_re) / ((y_46_re * -y_46_re) - (y_46_im * y_46_im));
} else if (y_46_re <= 7.2e-26) {
tmp = t_1;
} else if (y_46_re <= 2.7e+39) {
tmp = t_0;
} else if (y_46_re <= 3.8e+89) {
tmp = t_1;
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (y_46re * x_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
if (y_46re <= (-2.9d+92)) then
tmp = x_46im / y_46re
else if (y_46re <= (-3.1d-84)) then
tmp = t_0
else if (y_46re <= (-6.6d-128)) then
tmp = (y_46im * x_46re) / ((y_46re * -y_46re) - (y_46im * y_46im))
else if (y_46re <= 7.2d-26) then
tmp = t_1
else if (y_46re <= 2.7d+39) then
tmp = t_0
else if (y_46re <= 3.8d+89) then
tmp = t_1
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 t_0 = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_re <= -2.9e+92) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -3.1e-84) {
tmp = t_0;
} else if (y_46_re <= -6.6e-128) {
tmp = (y_46_im * x_46_re) / ((y_46_re * -y_46_re) - (y_46_im * y_46_im));
} else if (y_46_re <= 7.2e-26) {
tmp = t_1;
} else if (y_46_re <= 2.7e+39) {
tmp = t_0;
} else if (y_46_re <= 3.8e+89) {
tmp = t_1;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im tmp = 0 if y_46_re <= -2.9e+92: tmp = x_46_im / y_46_re elif y_46_re <= -3.1e-84: tmp = t_0 elif y_46_re <= -6.6e-128: tmp = (y_46_im * x_46_re) / ((y_46_re * -y_46_re) - (y_46_im * y_46_im)) elif y_46_re <= 7.2e-26: tmp = t_1 elif y_46_re <= 2.7e+39: tmp = t_0 elif y_46_re <= 3.8e+89: tmp = t_1 else: tmp = x_46_im / y_46_re 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(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_re <= -2.9e+92) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -3.1e-84) tmp = t_0; elseif (y_46_re <= -6.6e-128) tmp = Float64(Float64(y_46_im * x_46_re) / Float64(Float64(y_46_re * Float64(-y_46_re)) - Float64(y_46_im * y_46_im))); elseif (y_46_re <= 7.2e-26) tmp = t_1; elseif (y_46_re <= 2.7e+39) tmp = t_0; elseif (y_46_re <= 3.8e+89) tmp = t_1; 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) t_0 = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_re <= -2.9e+92) tmp = x_46_im / y_46_re; elseif (y_46_re <= -3.1e-84) tmp = t_0; elseif (y_46_re <= -6.6e-128) tmp = (y_46_im * x_46_re) / ((y_46_re * -y_46_re) - (y_46_im * y_46_im)); elseif (y_46_re <= 7.2e-26) tmp = t_1; elseif (y_46_re <= 2.7e+39) tmp = t_0; elseif (y_46_re <= 3.8e+89) tmp = t_1; 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_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -2.9e+92], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -3.1e-84], t$95$0, If[LessEqual[y$46$re, -6.6e-128], N[(N[(y$46$im * x$46$re), $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, 7.2e-26], t$95$1, If[LessEqual[y$46$re, 2.7e+39], t$95$0, If[LessEqual[y$46$re, 3.8e+89], t$95$1, N[(x$46$im / y$46$re), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.re \leq -2.9 \cdot 10^{+92}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -3.1 \cdot 10^{-84}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -6.6 \cdot 10^{-128}:\\
\;\;\;\;\frac{y.im \cdot x.re}{y.re \cdot \left(-y.re\right) - y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 7.2 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 2.7 \cdot 10^{+39}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3.8 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -2.9000000000000001e92 or 3.80000000000000023e89 < y.re Initial program 38.6%
Taylor expanded in y.re around inf 78.2%
if -2.9000000000000001e92 < y.re < -3.10000000000000002e-84 or 7.2000000000000003e-26 < y.re < 2.70000000000000003e39Initial program 87.6%
Taylor expanded in x.im around inf 65.4%
*-commutative65.4%
Simplified65.4%
if -3.10000000000000002e-84 < y.re < -6.6e-128Initial program 99.6%
Taylor expanded in x.im around 0 85.5%
mul-1-neg85.5%
distribute-rgt-neg-out85.5%
Simplified85.5%
if -6.6e-128 < y.re < 7.2000000000000003e-26 or 2.70000000000000003e39 < y.re < 3.80000000000000023e89Initial program 66.8%
div-sub62.0%
*-commutative62.0%
add-sqr-sqrt62.0%
times-frac62.9%
fma-neg62.9%
hypot-define62.9%
hypot-define65.6%
associate-/l*71.1%
add-sqr-sqrt71.1%
pow271.1%
hypot-define71.1%
Applied egg-rr71.1%
*-un-lft-identity71.1%
unpow271.1%
times-frac99.8%
add-sqr-sqrt49.2%
sqrt-prod48.4%
sqr-neg48.4%
sqrt-unprod21.1%
add-sqr-sqrt38.4%
hypot-undefine33.3%
+-commutative33.3%
hypot-define38.4%
add-sqr-sqrt21.1%
sqrt-unprod48.4%
sqr-neg48.4%
sqrt-prod49.2%
add-sqr-sqrt99.8%
hypot-undefine71.1%
+-commutative71.1%
hypot-define99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around 0 81.7%
neg-mul-181.7%
associate-*r/82.2%
+-commutative82.2%
unsub-neg82.2%
*-lft-identity82.2%
unpow282.2%
times-frac88.1%
*-commutative88.1%
associate-*r/88.1%
*-rgt-identity88.1%
associate-/l*89.8%
div-sub90.8%
Simplified90.8%
Final simplification80.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (* x.im (/ y.re y.im)) x.re) y.im))
(t_1
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -2.25e+135)
(/ x.im y.re)
(if (<= y.re -5.2e-132)
t_1
(if (<= y.re 2.4e-29)
t_0
(if (<= y.re 1.75e+44)
t_1
(if (<= y.re 9.6e+87) t_0 (/ x.im y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -2.25e+135) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -5.2e-132) {
tmp = t_1;
} else if (y_46_re <= 2.4e-29) {
tmp = t_0;
} else if (y_46_re <= 1.75e+44) {
tmp = t_1;
} else if (y_46_re <= 9.6e+87) {
tmp = t_0;
} 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
t_1 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46re <= (-2.25d+135)) then
tmp = x_46im / y_46re
else if (y_46re <= (-5.2d-132)) then
tmp = t_1
else if (y_46re <= 2.4d-29) then
tmp = t_0
else if (y_46re <= 1.75d+44) then
tmp = t_1
else if (y_46re <= 9.6d+87) then
tmp = t_0
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 t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -2.25e+135) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -5.2e-132) {
tmp = t_1;
} else if (y_46_re <= 2.4e-29) {
tmp = t_0;
} else if (y_46_re <= 1.75e+44) {
tmp = t_1;
} else if (y_46_re <= 9.6e+87) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -2.25e+135: tmp = x_46_im / y_46_re elif y_46_re <= -5.2e-132: tmp = t_1 elif y_46_re <= 2.4e-29: tmp = t_0 elif y_46_re <= 1.75e+44: tmp = t_1 elif y_46_re <= 9.6e+87: tmp = t_0 else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) t_1 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -2.25e+135) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -5.2e-132) tmp = t_1; elseif (y_46_re <= 2.4e-29) tmp = t_0; elseif (y_46_re <= 1.75e+44) tmp = t_1; elseif (y_46_re <= 9.6e+87) tmp = t_0; 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) t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -2.25e+135) tmp = x_46_im / y_46_re; elseif (y_46_re <= -5.2e-132) tmp = t_1; elseif (y_46_re <= 2.4e-29) tmp = t_0; elseif (y_46_re <= 1.75e+44) tmp = t_1; elseif (y_46_re <= 9.6e+87) tmp = t_0; 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_] := Block[{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]}, Block[{t$95$1 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.25e+135], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -5.2e-132], t$95$1, If[LessEqual[y$46$re, 2.4e-29], t$95$0, If[LessEqual[y$46$re, 1.75e+44], t$95$1, If[LessEqual[y$46$re, 9.6e+87], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
t_1 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -2.25 \cdot 10^{+135}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -5.2 \cdot 10^{-132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 2.4 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 9.6 \cdot 10^{+87}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -2.25000000000000004e135 or 9.59999999999999926e87 < y.re Initial program 34.0%
Taylor expanded in y.re around inf 77.7%
if -2.25000000000000004e135 < y.re < -5.2000000000000002e-132 or 2.39999999999999992e-29 < y.re < 1.75e44Initial program 90.3%
if -5.2000000000000002e-132 < y.re < 2.39999999999999992e-29 or 1.75e44 < y.re < 9.59999999999999926e87Initial program 65.9%
div-sub60.9%
*-commutative60.9%
add-sqr-sqrt60.9%
times-frac61.9%
fma-neg61.9%
hypot-define61.9%
hypot-define64.6%
associate-/l*70.3%
add-sqr-sqrt70.3%
pow270.3%
hypot-define70.3%
Applied egg-rr70.3%
*-un-lft-identity70.3%
unpow270.3%
times-frac99.8%
add-sqr-sqrt48.7%
sqrt-prod47.9%
sqr-neg47.9%
sqrt-unprod21.7%
add-sqr-sqrt38.6%
hypot-undefine33.3%
+-commutative33.3%
hypot-define38.6%
add-sqr-sqrt21.7%
sqrt-unprod47.9%
sqr-neg47.9%
sqrt-prod48.7%
add-sqr-sqrt99.8%
hypot-undefine70.3%
+-commutative70.3%
hypot-define99.8%
Applied egg-rr99.8%
*-commutative99.8%
associate-*l/99.8%
*-un-lft-identity99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around 0 82.1%
neg-mul-182.1%
associate-*r/82.7%
+-commutative82.7%
unsub-neg82.7%
*-lft-identity82.7%
unpow282.7%
times-frac88.7%
*-commutative88.7%
associate-*r/88.7%
*-rgt-identity88.7%
associate-/l*90.4%
div-sub91.4%
Simplified91.4%
Final simplification86.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.re -4.2e+90)
(/ x.im y.re)
(if (<= y.re 4.7e-26)
t_0
(if (<= y.re 5.3e+39)
(/ (* y.re x.im) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 1.6e+88) t_0 (/ x.im y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_re <= -4.2e+90) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= 4.7e-26) {
tmp = t_0;
} else if (y_46_re <= 5.3e+39) {
tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 1.6e+88) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
if (y_46re <= (-4.2d+90)) then
tmp = x_46im / y_46re
else if (y_46re <= 4.7d-26) then
tmp = t_0
else if (y_46re <= 5.3d+39) then
tmp = (y_46re * x_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46re <= 1.6d+88) then
tmp = t_0
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 t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_re <= -4.2e+90) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= 4.7e-26) {
tmp = t_0;
} else if (y_46_re <= 5.3e+39) {
tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 1.6e+88) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im tmp = 0 if y_46_re <= -4.2e+90: tmp = x_46_im / y_46_re elif y_46_re <= 4.7e-26: tmp = t_0 elif y_46_re <= 5.3e+39: tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_re <= 1.6e+88: tmp = t_0 else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_re <= -4.2e+90) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= 4.7e-26) tmp = t_0; elseif (y_46_re <= 5.3e+39) 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 <= 1.6e+88) tmp = t_0; 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) t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_re <= -4.2e+90) tmp = x_46_im / y_46_re; elseif (y_46_re <= 4.7e-26) tmp = t_0; elseif (y_46_re <= 5.3e+39) tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_re <= 1.6e+88) tmp = t_0; 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_] := Block[{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]}, If[LessEqual[y$46$re, -4.2e+90], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 4.7e-26], t$95$0, If[LessEqual[y$46$re, 5.3e+39], 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, 1.6e+88], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.re \leq -4.2 \cdot 10^{+90}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq 4.7 \cdot 10^{-26}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5.3 \cdot 10^{+39}:\\
\;\;\;\;\frac{y.re \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{+88}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -4.19999999999999961e90 or 1.5999999999999999e88 < y.re Initial program 39.4%
Taylor expanded in y.re around inf 78.5%
if -4.19999999999999961e90 < y.re < 4.69999999999999989e-26 or 5.29999999999999979e39 < y.re < 1.5999999999999999e88Initial program 73.3%
div-sub69.9%
*-commutative69.9%
add-sqr-sqrt69.9%
times-frac70.7%
fma-neg70.7%
hypot-define70.7%
hypot-define73.7%
associate-/l*77.7%
add-sqr-sqrt77.7%
pow277.7%
hypot-define77.7%
Applied egg-rr77.7%
*-un-lft-identity77.7%
unpow277.7%
times-frac99.7%
add-sqr-sqrt46.5%
sqrt-prod51.4%
sqr-neg51.4%
sqrt-unprod26.1%
add-sqr-sqrt44.9%
hypot-undefine41.4%
+-commutative41.4%
hypot-define44.9%
add-sqr-sqrt26.1%
sqrt-unprod51.4%
sqr-neg51.4%
sqrt-prod46.5%
add-sqr-sqrt99.7%
hypot-undefine77.6%
+-commutative77.6%
hypot-define99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.8%
*-un-lft-identity99.8%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around 0 72.5%
neg-mul-172.5%
associate-*r/73.3%
+-commutative73.3%
unsub-neg73.3%
*-lft-identity73.3%
unpow273.3%
times-frac77.5%
*-commutative77.5%
associate-*r/77.5%
*-rgt-identity77.5%
associate-/l*80.1%
div-sub80.9%
Simplified80.9%
if 4.69999999999999989e-26 < y.re < 5.29999999999999979e39Initial program 87.8%
Taylor expanded in x.im around inf 65.4%
*-commutative65.4%
Simplified65.4%
Final simplification79.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.45e+91) (not (<= y.re 9.6e+87))) (/ x.im y.re) (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.45e+91) || !(y_46_re <= 9.6e+87)) {
tmp = x_46_im / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.45d+91)) .or. (.not. (y_46re <= 9.6d+87))) then
tmp = x_46im / y_46re
else
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.45e+91) || !(y_46_re <= 9.6e+87)) {
tmp = x_46_im / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.45e+91) or not (y_46_re <= 9.6e+87): tmp = x_46_im / y_46_re else: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.45e+91) || !(y_46_re <= 9.6e+87)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.45e+91) || ~((y_46_re <= 9.6e+87))) tmp = x_46_im / y_46_re; else tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.45e+91], N[Not[LessEqual[y$46$re, 9.6e+87]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.45 \cdot 10^{+91} \lor \neg \left(y.re \leq 9.6 \cdot 10^{+87}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -1.45000000000000007e91 or 9.59999999999999926e87 < y.re Initial program 39.4%
Taylor expanded in y.re around inf 78.5%
if -1.45000000000000007e91 < y.re < 9.59999999999999926e87Initial program 74.8%
div-sub71.7%
*-commutative71.7%
add-sqr-sqrt71.7%
times-frac72.4%
fma-neg72.4%
hypot-define72.4%
hypot-define75.7%
associate-/l*79.3%
add-sqr-sqrt79.3%
pow279.3%
hypot-define79.3%
Applied egg-rr79.3%
*-un-lft-identity79.3%
unpow279.3%
times-frac99.7%
add-sqr-sqrt47.7%
sqrt-prod51.6%
sqr-neg51.6%
sqrt-unprod25.9%
add-sqr-sqrt47.5%
hypot-undefine44.3%
+-commutative44.3%
hypot-define47.5%
add-sqr-sqrt25.9%
sqrt-unprod51.6%
sqr-neg51.6%
sqrt-prod47.7%
add-sqr-sqrt99.7%
hypot-undefine79.3%
+-commutative79.3%
hypot-define99.7%
Applied egg-rr99.7%
*-commutative99.7%
associate-*l/99.7%
*-un-lft-identity99.7%
associate-*l/99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around 0 67.9%
neg-mul-167.9%
associate-*r/68.8%
+-commutative68.8%
unsub-neg68.8%
*-lft-identity68.8%
unpow268.8%
times-frac72.5%
*-commutative72.5%
associate-*r/72.5%
*-rgt-identity72.5%
associate-/l*75.4%
div-sub76.7%
Simplified76.7%
Final simplification77.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.02e+61) (not (<= y.im 1.56e-58))) (/ 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.02e+61) || !(y_46_im <= 1.56e-58)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-1.02d+61)) .or. (.not. (y_46im <= 1.56d-58))) then
tmp = x_46re / -y_46im
else
tmp = x_46im / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.02e+61) || !(y_46_im <= 1.56e-58)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.02e+61) or not (y_46_im <= 1.56e-58): tmp = x_46_re / -y_46_im else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.02e+61) || !(y_46_im <= 1.56e-58)) 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 <= -1.02e+61) || ~((y_46_im <= 1.56e-58))) tmp = x_46_re / -y_46_im; else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.02e+61], N[Not[LessEqual[y$46$im, 1.56e-58]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.02 \cdot 10^{+61} \lor \neg \left(y.im \leq 1.56 \cdot 10^{-58}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.01999999999999999e61 or 1.56000000000000008e-58 < y.im Initial program 55.1%
Taylor expanded in y.re around 0 65.3%
associate-*r/65.3%
neg-mul-165.3%
Simplified65.3%
if -1.01999999999999999e61 < y.im < 1.56000000000000008e-58Initial program 71.6%
Taylor expanded in y.re around inf 70.5%
Final simplification67.8%
(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 63.0%
Taylor expanded in y.re around inf 44.4%
Final simplification44.4%
herbie shell --seed 2024043
(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))))