
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im 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_re * y_46_re) + (x_46_im * 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_46re * y_46re) + (x_46im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + Float64(x_46_im * 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_re * y_46_re) + (x_46_im * 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$re * y$46$re), $MachinePrecision] + N[(x$46$im * 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.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im 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_re * y_46_re) + (x_46_im * 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_46re * y_46re) + (x_46im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + Float64(x_46_im * 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_re * y_46_re) + (x_46_im * 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$re * y$46$re), $MachinePrecision] + N[(x$46$im * 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.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/
(/ (fma x.re y.re (* y.im x.im)) (hypot y.re y.im))
(hypot y.re y.im))))
(if (<= y.im -8.6e+122)
(/ (- (- x.im) (* y.re (/ x.re y.im))) (hypot y.re y.im))
(if (<= y.im -6.4e-204)
t_0
(if (<= y.im 7.8e-140)
(+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im))))
(if (<= y.im 7.6e+129)
t_0
(/ (+ x.im (/ (* y.re x.re) 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 = (fma(x_46_re, y_46_re, (y_46_im * x_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
double tmp;
if (y_46_im <= -8.6e+122) {
tmp = (-x_46_im - (y_46_re * (x_46_re / y_46_im))) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -6.4e-204) {
tmp = t_0;
} else if (y_46_im <= 7.8e-140) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 7.6e+129) {
tmp = t_0;
} else {
tmp = (x_46_im + ((y_46_re * x_46_re) / 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(fma(x_46_re, y_46_re, Float64(y_46_im * x_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)) tmp = 0.0 if (y_46_im <= -8.6e+122) tmp = Float64(Float64(Float64(-x_46_im) - Float64(y_46_re * Float64(x_46_re / y_46_im))) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -6.4e-204) tmp = t_0; elseif (y_46_im <= 7.8e-140) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 7.6e+129) tmp = t_0; else tmp = Float64(Float64(x_46_im + Float64(Float64(y_46_re * x_46_re) / y_46_im)) / 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[(N[(x$46$re * y$46$re + N[(y$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -8.6e+122], N[(N[((-x$46$im) - N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -6.4e-204], t$95$0, If[LessEqual[y$46$im, 7.8e-140], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7.6e+129], t$95$0, N[(N[(x$46$im + N[(N[(y$46$re * x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{if}\;y.im \leq -8.6 \cdot 10^{+122}:\\
\;\;\;\;\frac{\left(-x.im\right) - y.re \cdot \frac{x.re}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -6.4 \cdot 10^{-204}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 7.8 \cdot 10^{-140}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{elif}\;y.im \leq 7.6 \cdot 10^{+129}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + \frac{y.re \cdot x.re}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -8.59999999999999943e122Initial program 32.9%
*-un-lft-identity32.9%
+-commutative32.9%
fma-udef32.9%
add-sqr-sqrt32.9%
times-frac32.9%
fma-udef32.9%
+-commutative32.9%
hypot-def32.9%
fma-def32.9%
fma-udef32.9%
+-commutative32.9%
hypot-def51.3%
Applied egg-rr51.3%
associate-*l/51.4%
*-un-lft-identity51.4%
Applied egg-rr51.4%
clear-num51.3%
inv-pow51.3%
Applied egg-rr51.3%
unpow-151.3%
fma-udef51.3%
+-commutative51.3%
fma-def51.3%
*-commutative51.3%
Simplified51.3%
Taylor expanded in y.im around -inf 82.3%
distribute-lft-out82.3%
*-commutative82.3%
associate-*r/90.3%
Simplified90.3%
if -8.59999999999999943e122 < y.im < -6.4e-204 or 7.80000000000000038e-140 < y.im < 7.60000000000000011e129Initial program 82.9%
*-un-lft-identity82.9%
+-commutative82.9%
fma-udef82.9%
add-sqr-sqrt82.9%
times-frac82.9%
fma-udef82.9%
+-commutative82.9%
hypot-def82.9%
fma-def82.9%
fma-udef82.9%
+-commutative82.9%
hypot-def93.0%
Applied egg-rr93.0%
associate-*l/93.1%
*-un-lft-identity93.1%
Applied egg-rr93.1%
if -6.4e-204 < y.im < 7.80000000000000038e-140Initial program 65.4%
Taylor expanded in y.re around inf 83.7%
associate-/l*90.0%
Simplified90.0%
pow290.0%
*-un-lft-identity90.0%
times-frac92.1%
Applied egg-rr92.1%
if 7.60000000000000011e129 < y.im Initial program 41.1%
*-un-lft-identity41.1%
+-commutative41.1%
fma-udef41.1%
add-sqr-sqrt41.1%
times-frac41.0%
fma-udef41.0%
+-commutative41.0%
hypot-def41.0%
fma-def41.0%
fma-udef41.0%
+-commutative41.0%
hypot-def58.9%
Applied egg-rr58.9%
associate-*l/59.0%
*-un-lft-identity59.0%
Applied egg-rr59.0%
Taylor expanded in y.re around 0 90.7%
Final simplification92.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.im x.im) (* y.re x.re))))
(if (<= y.im -3.7e+64)
(/ (- (- x.im) (* y.re (/ x.re y.im))) (hypot y.re y.im))
(if (<= y.im -3.4e-145)
(/ t_0 (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 4.7e-139)
(+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im))))
(if (<= y.im 1.4e+37)
(/ t_0 (fma y.im y.im (* y.re y.re)))
(/ (+ x.im (/ (* y.re x.re) 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_im * x_46_im) + (y_46_re * x_46_re);
double tmp;
if (y_46_im <= -3.7e+64) {
tmp = (-x_46_im - (y_46_re * (x_46_re / y_46_im))) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -3.4e-145) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 4.7e-139) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 1.4e+37) {
tmp = t_0 / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
} else {
tmp = (x_46_im + ((y_46_re * x_46_re) / 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_im * x_46_im) + Float64(y_46_re * x_46_re)) tmp = 0.0 if (y_46_im <= -3.7e+64) tmp = Float64(Float64(Float64(-x_46_im) - Float64(y_46_re * Float64(x_46_re / y_46_im))) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -3.4e-145) tmp = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 4.7e-139) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 1.4e+37) tmp = Float64(t_0 / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))); else tmp = Float64(Float64(x_46_im + Float64(Float64(y_46_re * x_46_re) / y_46_im)) / 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$im * x$46$im), $MachinePrecision] + N[(y$46$re * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.7e+64], N[(N[((-x$46$im) - N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -3.4e-145], 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[y$46$im, 4.7e-139], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.4e+37], N[(t$95$0 / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + N[(N[(y$46$re * x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.im \cdot x.im + y.re \cdot x.re\\
\mathbf{if}\;y.im \leq -3.7 \cdot 10^{+64}:\\
\;\;\;\;\frac{\left(-x.im\right) - y.re \cdot \frac{x.re}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -3.4 \cdot 10^{-145}:\\
\;\;\;\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 4.7 \cdot 10^{-139}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{+37}:\\
\;\;\;\;\frac{t_0}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + \frac{y.re \cdot x.re}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -3.69999999999999983e64Initial program 39.8%
*-un-lft-identity39.8%
+-commutative39.8%
fma-udef39.8%
add-sqr-sqrt39.8%
times-frac39.8%
fma-udef39.8%
+-commutative39.8%
hypot-def39.8%
fma-def39.8%
fma-udef39.8%
+-commutative39.8%
hypot-def57.8%
Applied egg-rr57.8%
associate-*l/57.9%
*-un-lft-identity57.9%
Applied egg-rr57.9%
clear-num57.9%
inv-pow57.9%
Applied egg-rr57.9%
unpow-157.9%
fma-udef57.9%
+-commutative57.9%
fma-def57.9%
*-commutative57.9%
Simplified57.9%
Taylor expanded in y.im around -inf 82.6%
distribute-lft-out82.6%
*-commutative82.6%
associate-*r/89.5%
Simplified89.5%
if -3.69999999999999983e64 < y.im < -3.3999999999999999e-145Initial program 81.2%
if -3.3999999999999999e-145 < y.im < 4.70000000000000027e-139Initial program 69.0%
Taylor expanded in y.re around inf 84.4%
associate-/l*89.8%
Simplified89.8%
pow289.8%
*-un-lft-identity89.8%
times-frac91.6%
Applied egg-rr91.6%
if 4.70000000000000027e-139 < y.im < 1.3999999999999999e37Initial program 87.4%
fma-def87.4%
+-commutative87.4%
fma-def87.4%
Simplified87.4%
fma-def87.4%
Applied egg-rr87.4%
if 1.3999999999999999e37 < y.im Initial program 48.4%
*-un-lft-identity48.4%
+-commutative48.4%
fma-udef48.4%
add-sqr-sqrt48.4%
times-frac48.4%
fma-udef48.4%
+-commutative48.4%
hypot-def48.4%
fma-def48.4%
fma-udef48.4%
+-commutative48.4%
hypot-def63.5%
Applied egg-rr63.5%
associate-*l/63.7%
*-un-lft-identity63.7%
Applied egg-rr63.7%
Taylor expanded in y.re around 0 85.5%
Final simplification87.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.im x.im) (* y.re x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -2.25e+123)
(* x.im (/ -1.0 (hypot y.re y.im)))
(if (<= y.im -2.35e-150)
t_0
(if (<= y.im 7e-140)
(+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im))))
(if (<= y.im 1.4e+37)
t_0
(+ (/ x.im y.im) (/ x.re (/ (pow y.im 2.0) 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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -2.25e+123) {
tmp = x_46_im * (-1.0 / hypot(y_46_re, y_46_im));
} else if (y_46_im <= -2.35e-150) {
tmp = t_0;
} else if (y_46_im <= 7e-140) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 1.4e+37) {
tmp = t_0;
} else {
tmp = (x_46_im / y_46_im) + (x_46_re / (pow(y_46_im, 2.0) / y_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -2.25e+123) {
tmp = x_46_im * (-1.0 / Math.hypot(y_46_re, y_46_im));
} else if (y_46_im <= -2.35e-150) {
tmp = t_0;
} else if (y_46_im <= 7e-140) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 1.4e+37) {
tmp = t_0;
} else {
tmp = (x_46_im / y_46_im) + (x_46_re / (Math.pow(y_46_im, 2.0) / y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -2.25e+123: tmp = x_46_im * (-1.0 / math.hypot(y_46_re, y_46_im)) elif y_46_im <= -2.35e-150: tmp = t_0 elif y_46_im <= 7e-140: tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))) elif y_46_im <= 1.4e+37: tmp = t_0 else: tmp = (x_46_im / y_46_im) + (x_46_re / (math.pow(y_46_im, 2.0) / y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_im * x_46_im) + Float64(y_46_re * 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 <= -2.25e+123) tmp = Float64(x_46_im * Float64(-1.0 / hypot(y_46_re, y_46_im))); elseif (y_46_im <= -2.35e-150) tmp = t_0; elseif (y_46_im <= 7e-140) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 1.4e+37) tmp = t_0; else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64((y_46_im ^ 2.0) / 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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -2.25e+123) tmp = x_46_im * (-1.0 / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -2.35e-150) tmp = t_0; elseif (y_46_im <= 7e-140) tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))); elseif (y_46_im <= 1.4e+37) tmp = t_0; else tmp = (x_46_im / y_46_im) + (x_46_re / ((y_46_im ^ 2.0) / y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$im * x$46$im), $MachinePrecision] + N[(y$46$re * 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, -2.25e+123], N[(x$46$im * N[(-1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -2.35e-150], t$95$0, If[LessEqual[y$46$im, 7e-140], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.4e+37], t$95$0, N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(N[Power[y$46$im, 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.im \cdot x.im + y.re \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -2.25 \cdot 10^{+123}:\\
\;\;\;\;x.im \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -2.35 \cdot 10^{-150}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 7 \cdot 10^{-140}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{+37}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{\frac{{y.im}^{2}}{y.re}}\\
\end{array}
\end{array}
if y.im < -2.24999999999999991e123Initial program 32.9%
*-un-lft-identity32.9%
+-commutative32.9%
fma-udef32.9%
add-sqr-sqrt32.9%
times-frac32.9%
fma-udef32.9%
+-commutative32.9%
hypot-def32.9%
fma-def32.9%
fma-udef32.9%
+-commutative32.9%
hypot-def51.3%
Applied egg-rr51.3%
Taylor expanded in y.im around -inf 78.2%
neg-mul-178.2%
Simplified78.2%
if -2.24999999999999991e123 < y.im < -2.3499999999999999e-150 or 6.9999999999999996e-140 < y.im < 1.3999999999999999e37Initial program 84.0%
if -2.3499999999999999e-150 < y.im < 6.9999999999999996e-140Initial program 69.0%
Taylor expanded in y.re around inf 84.4%
associate-/l*89.8%
Simplified89.8%
pow289.8%
*-un-lft-identity89.8%
times-frac91.6%
Applied egg-rr91.6%
if 1.3999999999999999e37 < y.im Initial program 48.4%
Taylor expanded in y.re around 0 81.4%
associate-/l*81.7%
Simplified81.7%
Final simplification84.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.im x.im) (* y.re x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -1.95e+123)
(* x.im (/ -1.0 (hypot y.re y.im)))
(if (<= y.im -1.1e-144)
t_0
(if (<= y.im 5.4e-139)
(+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im))))
(if (<= y.im 1.4e+37)
t_0
(/ (+ x.im (/ (* y.re x.re) 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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.95e+123) {
tmp = x_46_im * (-1.0 / hypot(y_46_re, y_46_im));
} else if (y_46_im <= -1.1e-144) {
tmp = t_0;
} else if (y_46_im <= 5.4e-139) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 1.4e+37) {
tmp = t_0;
} else {
tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / hypot(y_46_re, y_46_im);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.95e+123) {
tmp = x_46_im * (-1.0 / Math.hypot(y_46_re, y_46_im));
} else if (y_46_im <= -1.1e-144) {
tmp = t_0;
} else if (y_46_im <= 5.4e-139) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 1.4e+37) {
tmp = t_0;
} else {
tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / Math.hypot(y_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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -1.95e+123: tmp = x_46_im * (-1.0 / math.hypot(y_46_re, y_46_im)) elif y_46_im <= -1.1e-144: tmp = t_0 elif y_46_im <= 5.4e-139: tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))) elif y_46_im <= 1.4e+37: tmp = t_0 else: tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / math.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(Float64(y_46_im * x_46_im) + Float64(y_46_re * 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.95e+123) tmp = Float64(x_46_im * Float64(-1.0 / hypot(y_46_re, y_46_im))); elseif (y_46_im <= -1.1e-144) tmp = t_0; elseif (y_46_im <= 5.4e-139) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 1.4e+37) tmp = t_0; else tmp = Float64(Float64(x_46_im + Float64(Float64(y_46_re * x_46_re) / y_46_im)) / hypot(y_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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -1.95e+123) tmp = x_46_im * (-1.0 / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -1.1e-144) tmp = t_0; elseif (y_46_im <= 5.4e-139) tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))); elseif (y_46_im <= 1.4e+37) tmp = t_0; else tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / hypot(y_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$im * x$46$im), $MachinePrecision] + N[(y$46$re * 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.95e+123], N[(x$46$im * N[(-1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.1e-144], t$95$0, If[LessEqual[y$46$im, 5.4e-139], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.4e+37], t$95$0, N[(N[(x$46$im + N[(N[(y$46$re * x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.im \cdot x.im + y.re \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.95 \cdot 10^{+123}:\\
\;\;\;\;x.im \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -1.1 \cdot 10^{-144}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 5.4 \cdot 10^{-139}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{+37}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + \frac{y.re \cdot x.re}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -1.94999999999999996e123Initial program 32.9%
*-un-lft-identity32.9%
+-commutative32.9%
fma-udef32.9%
add-sqr-sqrt32.9%
times-frac32.9%
fma-udef32.9%
+-commutative32.9%
hypot-def32.9%
fma-def32.9%
fma-udef32.9%
+-commutative32.9%
hypot-def51.3%
Applied egg-rr51.3%
Taylor expanded in y.im around -inf 78.2%
neg-mul-178.2%
Simplified78.2%
if -1.94999999999999996e123 < y.im < -1.10000000000000003e-144 or 5.3999999999999997e-139 < y.im < 1.3999999999999999e37Initial program 84.0%
if -1.10000000000000003e-144 < y.im < 5.3999999999999997e-139Initial program 69.0%
Taylor expanded in y.re around inf 84.4%
associate-/l*89.8%
Simplified89.8%
pow289.8%
*-un-lft-identity89.8%
times-frac91.6%
Applied egg-rr91.6%
if 1.3999999999999999e37 < y.im Initial program 48.4%
*-un-lft-identity48.4%
+-commutative48.4%
fma-udef48.4%
add-sqr-sqrt48.4%
times-frac48.4%
fma-udef48.4%
+-commutative48.4%
hypot-def48.4%
fma-def48.4%
fma-udef48.4%
+-commutative48.4%
hypot-def63.5%
Applied egg-rr63.5%
associate-*l/63.7%
*-un-lft-identity63.7%
Applied egg-rr63.7%
Taylor expanded in y.re around 0 85.5%
Final simplification85.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.im x.im) (* y.re x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -5.1e+67)
(/ (- (/ (- x.re) (/ y.im y.re)) x.im) (hypot y.re y.im))
(if (<= y.im -7e-148)
t_0
(if (<= y.im 4.8e-138)
(+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im))))
(if (<= y.im 1.4e+37)
t_0
(/ (+ x.im (/ (* y.re x.re) 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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -5.1e+67) {
tmp = ((-x_46_re / (y_46_im / y_46_re)) - x_46_im) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -7e-148) {
tmp = t_0;
} else if (y_46_im <= 4.8e-138) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 1.4e+37) {
tmp = t_0;
} else {
tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / hypot(y_46_re, y_46_im);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -5.1e+67) {
tmp = ((-x_46_re / (y_46_im / y_46_re)) - x_46_im) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_im <= -7e-148) {
tmp = t_0;
} else if (y_46_im <= 4.8e-138) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 1.4e+37) {
tmp = t_0;
} else {
tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / Math.hypot(y_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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -5.1e+67: tmp = ((-x_46_re / (y_46_im / y_46_re)) - x_46_im) / math.hypot(y_46_re, y_46_im) elif y_46_im <= -7e-148: tmp = t_0 elif y_46_im <= 4.8e-138: tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))) elif y_46_im <= 1.4e+37: tmp = t_0 else: tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / math.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(Float64(y_46_im * x_46_im) + Float64(y_46_re * 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 <= -5.1e+67) tmp = Float64(Float64(Float64(Float64(-x_46_re) / Float64(y_46_im / y_46_re)) - x_46_im) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -7e-148) tmp = t_0; elseif (y_46_im <= 4.8e-138) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 1.4e+37) tmp = t_0; else tmp = Float64(Float64(x_46_im + Float64(Float64(y_46_re * x_46_re) / y_46_im)) / hypot(y_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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -5.1e+67) tmp = ((-x_46_re / (y_46_im / y_46_re)) - x_46_im) / hypot(y_46_re, y_46_im); elseif (y_46_im <= -7e-148) tmp = t_0; elseif (y_46_im <= 4.8e-138) tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))); elseif (y_46_im <= 1.4e+37) tmp = t_0; else tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / hypot(y_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$im * x$46$im), $MachinePrecision] + N[(y$46$re * 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, -5.1e+67], N[(N[(N[((-x$46$re) / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -7e-148], t$95$0, If[LessEqual[y$46$im, 4.8e-138], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.4e+37], t$95$0, N[(N[(x$46$im + N[(N[(y$46$re * x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.im \cdot x.im + y.re \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -5.1 \cdot 10^{+67}:\\
\;\;\;\;\frac{\frac{-x.re}{\frac{y.im}{y.re}} - x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -7 \cdot 10^{-148}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 4.8 \cdot 10^{-138}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{+37}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + \frac{y.re \cdot x.re}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -5.1000000000000002e67Initial program 39.8%
*-un-lft-identity39.8%
+-commutative39.8%
fma-udef39.8%
add-sqr-sqrt39.8%
times-frac39.8%
fma-udef39.8%
+-commutative39.8%
hypot-def39.8%
fma-def39.8%
fma-udef39.8%
+-commutative39.8%
hypot-def57.8%
Applied egg-rr57.8%
associate-*l/57.9%
*-un-lft-identity57.9%
Applied egg-rr57.9%
Taylor expanded in y.im around -inf 82.6%
neg-mul-182.6%
+-commutative82.6%
unsub-neg82.6%
mul-1-neg82.6%
associate-/l*87.5%
distribute-neg-frac87.5%
Simplified87.5%
if -5.1000000000000002e67 < y.im < -7.0000000000000001e-148 or 4.7999999999999998e-138 < y.im < 1.3999999999999999e37Initial program 84.0%
if -7.0000000000000001e-148 < y.im < 4.7999999999999998e-138Initial program 69.0%
Taylor expanded in y.re around inf 84.4%
associate-/l*89.8%
Simplified89.8%
pow289.8%
*-un-lft-identity89.8%
times-frac91.6%
Applied egg-rr91.6%
if 1.3999999999999999e37 < y.im Initial program 48.4%
*-un-lft-identity48.4%
+-commutative48.4%
fma-udef48.4%
add-sqr-sqrt48.4%
times-frac48.4%
fma-udef48.4%
+-commutative48.4%
hypot-def48.4%
fma-def48.4%
fma-udef48.4%
+-commutative48.4%
hypot-def63.5%
Applied egg-rr63.5%
associate-*l/63.7%
*-un-lft-identity63.7%
Applied egg-rr63.7%
Taylor expanded in y.re around 0 85.5%
Final simplification86.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.im x.im) (* y.re x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -3e+62)
(/ (- (- x.im) (* y.re (/ x.re y.im))) (hypot y.re y.im))
(if (<= y.im -3.8e-155)
t_0
(if (<= y.im 1e-138)
(+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im))))
(if (<= y.im 6.4e+34)
t_0
(/ (+ x.im (/ (* y.re x.re) 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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -3e+62) {
tmp = (-x_46_im - (y_46_re * (x_46_re / y_46_im))) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -3.8e-155) {
tmp = t_0;
} else if (y_46_im <= 1e-138) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 6.4e+34) {
tmp = t_0;
} else {
tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / hypot(y_46_re, y_46_im);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -3e+62) {
tmp = (-x_46_im - (y_46_re * (x_46_re / y_46_im))) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_im <= -3.8e-155) {
tmp = t_0;
} else if (y_46_im <= 1e-138) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 6.4e+34) {
tmp = t_0;
} else {
tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / Math.hypot(y_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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -3e+62: tmp = (-x_46_im - (y_46_re * (x_46_re / y_46_im))) / math.hypot(y_46_re, y_46_im) elif y_46_im <= -3.8e-155: tmp = t_0 elif y_46_im <= 1e-138: tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))) elif y_46_im <= 6.4e+34: tmp = t_0 else: tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / math.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(Float64(y_46_im * x_46_im) + Float64(y_46_re * 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 <= -3e+62) tmp = Float64(Float64(Float64(-x_46_im) - Float64(y_46_re * Float64(x_46_re / y_46_im))) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -3.8e-155) tmp = t_0; elseif (y_46_im <= 1e-138) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 6.4e+34) tmp = t_0; else tmp = Float64(Float64(x_46_im + Float64(Float64(y_46_re * x_46_re) / y_46_im)) / hypot(y_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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -3e+62) tmp = (-x_46_im - (y_46_re * (x_46_re / y_46_im))) / hypot(y_46_re, y_46_im); elseif (y_46_im <= -3.8e-155) tmp = t_0; elseif (y_46_im <= 1e-138) tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))); elseif (y_46_im <= 6.4e+34) tmp = t_0; else tmp = (x_46_im + ((y_46_re * x_46_re) / y_46_im)) / hypot(y_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$im * x$46$im), $MachinePrecision] + N[(y$46$re * 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, -3e+62], N[(N[((-x$46$im) - N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -3.8e-155], t$95$0, If[LessEqual[y$46$im, 1e-138], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.4e+34], t$95$0, N[(N[(x$46$im + N[(N[(y$46$re * x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.im \cdot x.im + y.re \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -3 \cdot 10^{+62}:\\
\;\;\;\;\frac{\left(-x.im\right) - y.re \cdot \frac{x.re}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -3.8 \cdot 10^{-155}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 10^{-138}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{elif}\;y.im \leq 6.4 \cdot 10^{+34}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + \frac{y.re \cdot x.re}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -3e62Initial program 39.8%
*-un-lft-identity39.8%
+-commutative39.8%
fma-udef39.8%
add-sqr-sqrt39.8%
times-frac39.8%
fma-udef39.8%
+-commutative39.8%
hypot-def39.8%
fma-def39.8%
fma-udef39.8%
+-commutative39.8%
hypot-def57.8%
Applied egg-rr57.8%
associate-*l/57.9%
*-un-lft-identity57.9%
Applied egg-rr57.9%
clear-num57.9%
inv-pow57.9%
Applied egg-rr57.9%
unpow-157.9%
fma-udef57.9%
+-commutative57.9%
fma-def57.9%
*-commutative57.9%
Simplified57.9%
Taylor expanded in y.im around -inf 82.6%
distribute-lft-out82.6%
*-commutative82.6%
associate-*r/89.5%
Simplified89.5%
if -3e62 < y.im < -3.7999999999999998e-155 or 1.00000000000000007e-138 < y.im < 6.3999999999999997e34Initial program 84.0%
if -3.7999999999999998e-155 < y.im < 1.00000000000000007e-138Initial program 69.0%
Taylor expanded in y.re around inf 84.4%
associate-/l*89.8%
Simplified89.8%
pow289.8%
*-un-lft-identity89.8%
times-frac91.6%
Applied egg-rr91.6%
if 6.3999999999999997e34 < y.im Initial program 48.4%
*-un-lft-identity48.4%
+-commutative48.4%
fma-udef48.4%
add-sqr-sqrt48.4%
times-frac48.4%
fma-udef48.4%
+-commutative48.4%
hypot-def48.4%
fma-def48.4%
fma-udef48.4%
+-commutative48.4%
hypot-def63.5%
Applied egg-rr63.5%
associate-*l/63.7%
*-un-lft-identity63.7%
Applied egg-rr63.7%
Taylor expanded in y.re around 0 85.5%
Final simplification86.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.im x.im) (* y.re x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -1.9e+123)
(* x.im (/ -1.0 (hypot y.re y.im)))
(if (<= y.im -3.5e-148)
t_0
(if (<= y.im 1.6e-139)
(+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im))))
(if (<= y.im 3.2e+134) t_0 (/ x.im 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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.9e+123) {
tmp = x_46_im * (-1.0 / hypot(y_46_re, y_46_im));
} else if (y_46_im <= -3.5e-148) {
tmp = t_0;
} else if (y_46_im <= 1.6e-139) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 3.2e+134) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.9e+123) {
tmp = x_46_im * (-1.0 / Math.hypot(y_46_re, y_46_im));
} else if (y_46_im <= -3.5e-148) {
tmp = t_0;
} else if (y_46_im <= 1.6e-139) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 3.2e+134) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -1.9e+123: tmp = x_46_im * (-1.0 / math.hypot(y_46_re, y_46_im)) elif y_46_im <= -3.5e-148: tmp = t_0 elif y_46_im <= 1.6e-139: tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))) elif y_46_im <= 3.2e+134: tmp = t_0 else: tmp = x_46_im / 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_im * x_46_im) + Float64(y_46_re * 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.9e+123) tmp = Float64(x_46_im * Float64(-1.0 / hypot(y_46_re, y_46_im))); elseif (y_46_im <= -3.5e-148) tmp = t_0; elseif (y_46_im <= 1.6e-139) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 3.2e+134) tmp = t_0; else tmp = Float64(x_46_im / 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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -1.9e+123) tmp = x_46_im * (-1.0 / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -3.5e-148) tmp = t_0; elseif (y_46_im <= 1.6e-139) tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))); elseif (y_46_im <= 3.2e+134) tmp = t_0; else tmp = x_46_im / 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$im * x$46$im), $MachinePrecision] + N[(y$46$re * 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.9e+123], N[(x$46$im * N[(-1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -3.5e-148], t$95$0, If[LessEqual[y$46$im, 1.6e-139], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.2e+134], t$95$0, N[(x$46$im / y$46$im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.im \cdot x.im + y.re \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.9 \cdot 10^{+123}:\\
\;\;\;\;x.im \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -3.5 \cdot 10^{-148}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{-139}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{+134}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -1.89999999999999997e123Initial program 32.9%
*-un-lft-identity32.9%
+-commutative32.9%
fma-udef32.9%
add-sqr-sqrt32.9%
times-frac32.9%
fma-udef32.9%
+-commutative32.9%
hypot-def32.9%
fma-def32.9%
fma-udef32.9%
+-commutative32.9%
hypot-def51.3%
Applied egg-rr51.3%
Taylor expanded in y.im around -inf 78.2%
neg-mul-178.2%
Simplified78.2%
if -1.89999999999999997e123 < y.im < -3.5e-148 or 1.6e-139 < y.im < 3.2000000000000001e134Initial program 82.5%
if -3.5e-148 < y.im < 1.6e-139Initial program 69.0%
Taylor expanded in y.re around inf 84.4%
associate-/l*89.8%
Simplified89.8%
pow289.8%
*-un-lft-identity89.8%
times-frac91.6%
Applied egg-rr91.6%
if 3.2000000000000001e134 < y.im Initial program 41.1%
Taylor expanded in y.re around 0 85.5%
Final simplification84.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.im x.im) (* y.re x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -1.16e+123)
(/ x.im y.im)
(if (<= y.im -5.8e-145)
t_0
(if (<= y.im 1.35e-139)
(+ (/ x.re y.re) (/ x.im (* y.re (/ y.re y.im))))
(if (<= y.im 9.5e+134) t_0 (/ x.im 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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.16e+123) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -5.8e-145) {
tmp = t_0;
} else if (y_46_im <= 1.35e-139) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 9.5e+134) {
tmp = t_0;
} else {
tmp = x_46_im / 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_46im * x_46im) + (y_46re * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46im <= (-1.16d+123)) then
tmp = x_46im / y_46im
else if (y_46im <= (-5.8d-145)) then
tmp = t_0
else if (y_46im <= 1.35d-139) then
tmp = (x_46re / y_46re) + (x_46im / (y_46re * (y_46re / y_46im)))
else if (y_46im <= 9.5d+134) then
tmp = t_0
else
tmp = x_46im / 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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.16e+123) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -5.8e-145) {
tmp = t_0;
} else if (y_46_im <= 1.35e-139) {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im)));
} else if (y_46_im <= 9.5e+134) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -1.16e+123: tmp = x_46_im / y_46_im elif y_46_im <= -5.8e-145: tmp = t_0 elif y_46_im <= 1.35e-139: tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))) elif y_46_im <= 9.5e+134: tmp = t_0 else: tmp = x_46_im / 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_im * x_46_im) + Float64(y_46_re * 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.16e+123) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -5.8e-145) tmp = t_0; elseif (y_46_im <= 1.35e-139) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 9.5e+134) tmp = t_0; else tmp = Float64(x_46_im / 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_im * x_46_im) + (y_46_re * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -1.16e+123) tmp = x_46_im / y_46_im; elseif (y_46_im <= -5.8e-145) tmp = t_0; elseif (y_46_im <= 1.35e-139) tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_46_re / y_46_im))); elseif (y_46_im <= 9.5e+134) tmp = t_0; else tmp = x_46_im / 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$im * x$46$im), $MachinePrecision] + N[(y$46$re * 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.16e+123], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -5.8e-145], t$95$0, If[LessEqual[y$46$im, 1.35e-139], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.5e+134], t$95$0, N[(x$46$im / y$46$im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.im \cdot x.im + y.re \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.16 \cdot 10^{+123}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -5.8 \cdot 10^{-145}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.35 \cdot 10^{-139}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{elif}\;y.im \leq 9.5 \cdot 10^{+134}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -1.16e123 or 9.5000000000000004e134 < y.im Initial program 37.0%
Taylor expanded in y.re around 0 81.8%
if -1.16e123 < y.im < -5.79999999999999968e-145 or 1.3499999999999999e-139 < y.im < 9.5000000000000004e134Initial program 82.5%
if -5.79999999999999968e-145 < y.im < 1.3499999999999999e-139Initial program 69.0%
Taylor expanded in y.re around inf 84.4%
associate-/l*89.8%
Simplified89.8%
pow289.8%
*-un-lft-identity89.8%
times-frac91.6%
Applied egg-rr91.6%
Final simplification84.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* y.im x.im) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -1.85e+67)
(/ x.im y.im)
(if (<= y.im -2.4e-232)
t_0
(if (<= y.im 6e-82)
(/ x.re y.re)
(if (<= y.im 1.1e+147) t_0 (/ x.im 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_im * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.85e+67) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -2.4e-232) {
tmp = t_0;
} else if (y_46_im <= 6e-82) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 1.1e+147) {
tmp = t_0;
} else {
tmp = x_46_im / 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_46im * x_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46im <= (-1.85d+67)) then
tmp = x_46im / y_46im
else if (y_46im <= (-2.4d-232)) then
tmp = t_0
else if (y_46im <= 6d-82) then
tmp = x_46re / y_46re
else if (y_46im <= 1.1d+147) then
tmp = t_0
else
tmp = x_46im / 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_im * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.85e+67) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -2.4e-232) {
tmp = t_0;
} else if (y_46_im <= 6e-82) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 1.1e+147) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_im * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -1.85e+67: tmp = x_46_im / y_46_im elif y_46_im <= -2.4e-232: tmp = t_0 elif y_46_im <= 6e-82: tmp = x_46_re / y_46_re elif y_46_im <= 1.1e+147: tmp = t_0 else: tmp = x_46_im / 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_im * x_46_im) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -1.85e+67) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -2.4e-232) tmp = t_0; elseif (y_46_im <= 6e-82) tmp = Float64(x_46_re / y_46_re); elseif (y_46_im <= 1.1e+147) tmp = t_0; else tmp = Float64(x_46_im / 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_im * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -1.85e+67) tmp = x_46_im / y_46_im; elseif (y_46_im <= -2.4e-232) tmp = t_0; elseif (y_46_im <= 6e-82) tmp = x_46_re / y_46_re; elseif (y_46_im <= 1.1e+147) tmp = t_0; else tmp = x_46_im / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$im * 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$im, -1.85e+67], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -2.4e-232], t$95$0, If[LessEqual[y$46$im, 6e-82], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.1e+147], t$95$0, N[(x$46$im / y$46$im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.85 \cdot 10^{+67}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -2.4 \cdot 10^{-232}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 6 \cdot 10^{-82}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.im \leq 1.1 \cdot 10^{+147}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -1.8499999999999999e67 or 1.1000000000000001e147 < y.im Initial program 38.6%
Taylor expanded in y.re around 0 81.1%
if -1.8499999999999999e67 < y.im < -2.39999999999999999e-232 or 5.9999999999999998e-82 < y.im < 1.1000000000000001e147Initial program 82.9%
Taylor expanded in x.re around 0 54.9%
if -2.39999999999999999e-232 < y.im < 5.9999999999999998e-82Initial program 68.6%
Taylor expanded in y.re around inf 77.2%
Final simplification68.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -29000000000.0) (not (<= y.im 950000.0))) (/ x.im y.im) (+ (/ x.re y.re) (/ x.im (* y.re (/ y.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 <= -29000000000.0) || !(y_46_im <= 950000.0)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_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 <= (-29000000000.0d0)) .or. (.not. (y_46im <= 950000.0d0))) then
tmp = x_46im / y_46im
else
tmp = (x_46re / y_46re) + (x_46im / (y_46re * (y_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 <= -29000000000.0) || !(y_46_im <= 950000.0)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_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 <= -29000000000.0) or not (y_46_im <= 950000.0): tmp = x_46_im / y_46_im else: tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_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 <= -29000000000.0) || !(y_46_im <= 950000.0)) tmp = Float64(x_46_im / y_46_im); else tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im / Float64(y_46_re * Float64(y_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 <= -29000000000.0) || ~((y_46_im <= 950000.0))) tmp = x_46_im / y_46_im; else tmp = (x_46_re / y_46_re) + (x_46_im / (y_46_re * (y_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$im, -29000000000.0], N[Not[LessEqual[y$46$im, 950000.0]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im / N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -29000000000 \lor \neg \left(y.im \leq 950000\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{x.im}{y.re \cdot \frac{y.re}{y.im}}\\
\end{array}
\end{array}
if y.im < -2.9e10 or 9.5e5 < y.im Initial program 51.6%
Taylor expanded in y.re around 0 72.9%
if -2.9e10 < y.im < 9.5e5Initial program 77.6%
Taylor expanded in y.re around inf 69.9%
associate-/l*71.5%
Simplified71.5%
pow271.5%
*-un-lft-identity71.5%
times-frac72.3%
Applied egg-rr72.3%
Final simplification72.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -1.5e+20)
(not
(or (<= y.im -2.2e-94)
(and (not (<= y.im -4.3e-107)) (<= y.im 4.3e-41)))))
(/ x.im y.im)
(/ x.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 <= -1.5e+20) || !((y_46_im <= -2.2e-94) || (!(y_46_im <= -4.3e-107) && (y_46_im <= 4.3e-41)))) {
tmp = x_46_im / y_46_im;
} else {
tmp = x_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 <= (-1.5d+20)) .or. (.not. (y_46im <= (-2.2d-94)) .or. (.not. (y_46im <= (-4.3d-107))) .and. (y_46im <= 4.3d-41))) then
tmp = x_46im / y_46im
else
tmp = x_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 <= -1.5e+20) || !((y_46_im <= -2.2e-94) || (!(y_46_im <= -4.3e-107) && (y_46_im <= 4.3e-41)))) {
tmp = x_46_im / y_46_im;
} else {
tmp = x_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 <= -1.5e+20) or not ((y_46_im <= -2.2e-94) or (not (y_46_im <= -4.3e-107) and (y_46_im <= 4.3e-41))): tmp = x_46_im / y_46_im else: tmp = x_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 <= -1.5e+20) || !((y_46_im <= -2.2e-94) || (!(y_46_im <= -4.3e-107) && (y_46_im <= 4.3e-41)))) tmp = Float64(x_46_im / y_46_im); else tmp = Float64(x_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 <= -1.5e+20) || ~(((y_46_im <= -2.2e-94) || (~((y_46_im <= -4.3e-107)) && (y_46_im <= 4.3e-41))))) tmp = x_46_im / y_46_im; else tmp = x_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, -1.5e+20], N[Not[Or[LessEqual[y$46$im, -2.2e-94], And[N[Not[LessEqual[y$46$im, -4.3e-107]], $MachinePrecision], LessEqual[y$46$im, 4.3e-41]]]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.5 \cdot 10^{+20} \lor \neg \left(y.im \leq -2.2 \cdot 10^{-94} \lor \neg \left(y.im \leq -4.3 \cdot 10^{-107}\right) \land y.im \leq 4.3 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -1.5e20 or -2.20000000000000001e-94 < y.im < -4.2999999999999997e-107 or 4.2999999999999999e-41 < y.im Initial program 57.0%
Taylor expanded in y.re around 0 69.9%
if -1.5e20 < y.im < -2.20000000000000001e-94 or -4.2999999999999997e-107 < y.im < 4.2999999999999999e-41Initial program 75.3%
Taylor expanded in y.re around inf 63.1%
Final simplification66.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.im))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46im
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_im) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 65.9%
Taylor expanded in y.re around 0 43.9%
Final simplification43.9%
herbie shell --seed 2023298
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
:precision binary64
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))