
(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 13 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 y.im y.im (pow y.re 2.0))) (t_1 (/ x.re (/ y.im y.re))))
(if (<= y.im -3.7e+151)
(/ (- (- x.im) t_1) (hypot y.re y.im))
(if (<= y.im -7.5e-185)
(/
(/ (fma x.re y.re (* y.im x.im)) (hypot y.re y.im))
(hypot y.re y.im))
(if (<= y.im 1.55e-133)
(* (/ -1.0 y.re) (- (- x.re) (/ (* y.im x.im) y.re)))
(if (<= y.im 1.65e+101)
(fma (/ x.im t_0) y.im (/ x.re (/ t_0 y.re)))
(/ (+ x.im t_1) (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(y_46_im, y_46_im, pow(y_46_re, 2.0));
double t_1 = x_46_re / (y_46_im / y_46_re);
double tmp;
if (y_46_im <= -3.7e+151) {
tmp = (-x_46_im - t_1) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -7.5e-185) {
tmp = (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);
} else if (y_46_im <= 1.55e-133) {
tmp = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
} else if (y_46_im <= 1.65e+101) {
tmp = fma((x_46_im / t_0), y_46_im, (x_46_re / (t_0 / y_46_re)));
} else {
tmp = (x_46_im + t_1) / 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 = fma(y_46_im, y_46_im, (y_46_re ^ 2.0)) t_1 = Float64(x_46_re / Float64(y_46_im / y_46_re)) tmp = 0.0 if (y_46_im <= -3.7e+151) tmp = Float64(Float64(Float64(-x_46_im) - t_1) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -7.5e-185) tmp = 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)); elseif (y_46_im <= 1.55e-133) tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(-x_46_re) - Float64(Float64(y_46_im * x_46_im) / y_46_re))); elseif (y_46_im <= 1.65e+101) tmp = fma(Float64(x_46_im / t_0), y_46_im, Float64(x_46_re / Float64(t_0 / y_46_re))); else tmp = Float64(Float64(x_46_im + t_1) / 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[(y$46$im * y$46$im + N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.7e+151], N[(N[((-x$46$im) - t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -7.5e-185], 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, 1.55e-133], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[((-x$46$re) - N[(N[(y$46$im * x$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.65e+101], N[(N[(x$46$im / t$95$0), $MachinePrecision] * y$46$im + N[(x$46$re / N[(t$95$0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, y.im, {y.re}^{2}\right)\\
t_1 := \frac{x.re}{\frac{y.im}{y.re}}\\
\mathbf{if}\;y.im \leq -3.7 \cdot 10^{+151}:\\
\;\;\;\;\frac{\left(-x.im\right) - t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -7.5 \cdot 10^{-185}:\\
\;\;\;\;\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{elif}\;y.im \leq 1.55 \cdot 10^{-133}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(\left(-x.re\right) - \frac{y.im \cdot x.im}{y.re}\right)\\
\mathbf{elif}\;y.im \leq 1.65 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x.im}{t_0}, y.im, \frac{x.re}{\frac{t_0}{y.re}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -3.6999999999999997e151Initial program 21.5%
*-un-lft-identity21.5%
add-sqr-sqrt21.5%
times-frac21.5%
hypot-def21.5%
fma-def21.5%
hypot-def50.0%
Applied egg-rr50.0%
associate-*l/50.0%
*-un-lft-identity50.0%
Applied egg-rr50.0%
Taylor expanded in y.im around -inf 78.9%
mul-1-neg78.9%
unsub-neg78.9%
mul-1-neg78.9%
associate-/l*93.2%
Simplified93.2%
if -3.6999999999999997e151 < y.im < -7.49999999999999978e-185Initial program 69.0%
*-un-lft-identity69.0%
add-sqr-sqrt68.9%
times-frac69.0%
hypot-def69.1%
fma-def69.1%
hypot-def83.2%
Applied egg-rr83.2%
associate-*l/83.4%
*-un-lft-identity83.4%
Applied egg-rr83.4%
if -7.49999999999999978e-185 < y.im < 1.55000000000000008e-133Initial program 72.7%
*-un-lft-identity72.7%
add-sqr-sqrt72.7%
times-frac72.8%
hypot-def72.9%
fma-def72.9%
hypot-def87.0%
Applied egg-rr87.0%
Taylor expanded in y.re around -inf 46.5%
Taylor expanded in y.re around -inf 98.1%
if 1.55000000000000008e-133 < y.im < 1.65000000000000006e101Initial program 74.6%
Taylor expanded in x.re around 0 74.6%
associate-/l*79.6%
associate-/r/79.5%
fma-def79.5%
unpow279.5%
fma-def79.5%
associate-/l*81.8%
unpow281.8%
fma-def81.8%
Simplified81.8%
if 1.65000000000000006e101 < y.im Initial program 35.4%
*-un-lft-identity35.4%
add-sqr-sqrt35.4%
times-frac35.3%
hypot-def35.3%
fma-def35.3%
hypot-def44.3%
Applied egg-rr44.3%
associate-*l/44.5%
*-un-lft-identity44.5%
Applied egg-rr44.5%
Taylor expanded in y.re around 0 86.2%
associate-/l*97.3%
Simplified97.3%
Final simplification90.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
(/ (+ (* y.im x.im) (* x.re y.re)) (+ (* y.re y.re) (* y.im y.im)))
5e+293)
(/ (/ (fma x.re y.re (* y.im x.im)) (hypot y.re y.im)) (hypot y.re y.im))
(+ (/ x.im y.im) (/ x.re (* y.im (/ y.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+293) {
tmp = (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);
} else {
tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (Float64(Float64(Float64(y_46_im * x_46_im) + Float64(x_46_re * y_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 5e+293) tmp = 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)); else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64(y_46_im * Float64(y_46_im / y_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[N[(N[(N[(y$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+293], 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], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(y$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y.im \cdot x.im + x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} \leq 5 \cdot 10^{+293}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{y.im \cdot \frac{y.im}{y.re}}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 5.00000000000000033e293Initial program 78.3%
*-un-lft-identity78.3%
add-sqr-sqrt78.3%
times-frac78.3%
hypot-def78.3%
fma-def78.3%
hypot-def95.4%
Applied egg-rr95.4%
associate-*l/95.7%
*-un-lft-identity95.7%
Applied egg-rr95.7%
if 5.00000000000000033e293 < (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 9.1%
Taylor expanded in y.re around 0 49.8%
associate-/l*52.1%
Simplified52.1%
unpow252.1%
*-un-lft-identity52.1%
times-frac58.7%
Applied egg-rr58.7%
Final simplification85.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.re (/ y.im y.re))))
(if (<= y.im -3.2e+29)
(/ (- (- x.im) t_0) (hypot y.re y.im))
(if (<= y.im -1.7e-97)
(/ (+ (* y.im x.im) (* x.re y.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 9.2e-88)
(* (/ -1.0 y.re) (- (- x.re) (/ (* y.im x.im) y.re)))
(if (<= y.im 1.25e+100)
(*
(fma x.re y.re (* y.im x.im))
(/ 1.0 (pow (hypot y.re y.im) 2.0)))
(/ (+ x.im t_0) (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = x_46_re / (y_46_im / y_46_re);
double tmp;
if (y_46_im <= -3.2e+29) {
tmp = (-x_46_im - t_0) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -1.7e-97) {
tmp = ((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 9.2e-88) {
tmp = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
} else if (y_46_im <= 1.25e+100) {
tmp = fma(x_46_re, y_46_re, (y_46_im * x_46_im)) * (1.0 / pow(hypot(y_46_re, y_46_im), 2.0));
} else {
tmp = (x_46_im + t_0) / hypot(y_46_re, y_46_im);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_re / Float64(y_46_im / y_46_re)) tmp = 0.0 if (y_46_im <= -3.2e+29) tmp = Float64(Float64(Float64(-x_46_im) - t_0) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -1.7e-97) tmp = Float64(Float64(Float64(y_46_im * x_46_im) + Float64(x_46_re * y_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 9.2e-88) tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(-x_46_re) - Float64(Float64(y_46_im * x_46_im) / y_46_re))); elseif (y_46_im <= 1.25e+100) tmp = Float64(fma(x_46_re, y_46_re, Float64(y_46_im * x_46_im)) * Float64(1.0 / (hypot(y_46_re, y_46_im) ^ 2.0))); else tmp = Float64(Float64(x_46_im + t_0) / hypot(y_46_re, y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.2e+29], N[(N[((-x$46$im) - t$95$0), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.7e-97], N[(N[(N[(y$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * y$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, 9.2e-88], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[((-x$46$re) - N[(N[(y$46$im * x$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.25e+100], N[(N[(x$46$re * y$46$re + N[(y$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + t$95$0), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{\frac{y.im}{y.re}}\\
\mathbf{if}\;y.im \leq -3.2 \cdot 10^{+29}:\\
\;\;\;\;\frac{\left(-x.im\right) - t_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-97}:\\
\;\;\;\;\frac{y.im \cdot x.im + x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 9.2 \cdot 10^{-88}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(\left(-x.re\right) - \frac{y.im \cdot x.im}{y.re}\right)\\
\mathbf{elif}\;y.im \leq 1.25 \cdot 10^{+100}:\\
\;\;\;\;\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right) \cdot \frac{1}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + t_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -3.19999999999999987e29Initial program 30.3%
*-un-lft-identity30.3%
add-sqr-sqrt30.3%
times-frac30.3%
hypot-def30.3%
fma-def30.3%
hypot-def54.4%
Applied egg-rr54.4%
associate-*l/54.4%
*-un-lft-identity54.4%
Applied egg-rr54.4%
Taylor expanded in y.im around -inf 68.7%
mul-1-neg68.7%
unsub-neg68.7%
mul-1-neg68.7%
associate-/l*79.4%
Simplified79.4%
if -3.19999999999999987e29 < y.im < -1.6999999999999999e-97Initial program 86.1%
if -1.6999999999999999e-97 < y.im < 9.19999999999999945e-88Initial program 73.5%
*-un-lft-identity73.5%
add-sqr-sqrt73.5%
times-frac73.6%
hypot-def73.6%
fma-def73.6%
hypot-def87.0%
Applied egg-rr87.0%
Taylor expanded in y.re around -inf 49.4%
Taylor expanded in y.re around -inf 94.0%
if 9.19999999999999945e-88 < y.im < 1.25e100Initial program 75.0%
div-inv75.1%
fma-def75.1%
add-sqr-sqrt75.1%
pow275.1%
hypot-def75.1%
Applied egg-rr75.1%
if 1.25e100 < y.im Initial program 35.4%
*-un-lft-identity35.4%
add-sqr-sqrt35.4%
times-frac35.3%
hypot-def35.3%
fma-def35.3%
hypot-def44.3%
Applied egg-rr44.3%
associate-*l/44.5%
*-un-lft-identity44.5%
Applied egg-rr44.5%
Taylor expanded in y.re around 0 86.2%
associate-/l*97.3%
Simplified97.3%
Final simplification86.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (/ -1.0 y.re) (- (- x.re) (/ (* y.im x.im) y.re))))
(t_1
(/ (+ (* y.im x.im) (* x.re y.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -5.2e+143)
(+ (/ x.im y.im) (/ x.re (* y.im (/ y.im y.re))))
(if (<= y.im -8.8e+80)
t_0
(if (<= y.im -3.8e+29)
(+ (/ x.im y.im) (* y.re (* x.re (pow y.im -2.0))))
(if (<= y.im -1.72e-97)
t_1
(if (<= y.im 9.6e-88)
t_0
(if (<= y.im 1.6e+100)
t_1
(/ (+ x.im (/ x.re (/ y.im y.re))) (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 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
double t_1 = ((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -5.2e+143) {
tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
} else if (y_46_im <= -8.8e+80) {
tmp = t_0;
} else if (y_46_im <= -3.8e+29) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re * pow(y_46_im, -2.0)));
} else if (y_46_im <= -1.72e-97) {
tmp = t_1;
} else if (y_46_im <= 9.6e-88) {
tmp = t_0;
} else if (y_46_im <= 1.6e+100) {
tmp = t_1;
} else {
tmp = (x_46_im + (x_46_re / (y_46_im / y_46_re))) / 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 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
double t_1 = ((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -5.2e+143) {
tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
} else if (y_46_im <= -8.8e+80) {
tmp = t_0;
} else if (y_46_im <= -3.8e+29) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re * Math.pow(y_46_im, -2.0)));
} else if (y_46_im <= -1.72e-97) {
tmp = t_1;
} else if (y_46_im <= 9.6e-88) {
tmp = t_0;
} else if (y_46_im <= 1.6e+100) {
tmp = t_1;
} else {
tmp = (x_46_im + (x_46_re / (y_46_im / y_46_re))) / 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 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re)) t_1 = ((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -5.2e+143: tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))) elif y_46_im <= -8.8e+80: tmp = t_0 elif y_46_im <= -3.8e+29: tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re * math.pow(y_46_im, -2.0))) elif y_46_im <= -1.72e-97: tmp = t_1 elif y_46_im <= 9.6e-88: tmp = t_0 elif y_46_im <= 1.6e+100: tmp = t_1 else: tmp = (x_46_im + (x_46_re / (y_46_im / y_46_re))) / 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(-1.0 / y_46_re) * Float64(Float64(-x_46_re) - Float64(Float64(y_46_im * x_46_im) / y_46_re))) t_1 = Float64(Float64(Float64(y_46_im * x_46_im) + Float64(x_46_re * y_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.2e+143) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64(y_46_im * Float64(y_46_im / y_46_re)))); elseif (y_46_im <= -8.8e+80) tmp = t_0; elseif (y_46_im <= -3.8e+29) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(y_46_re * Float64(x_46_re * (y_46_im ^ -2.0)))); elseif (y_46_im <= -1.72e-97) tmp = t_1; elseif (y_46_im <= 9.6e-88) tmp = t_0; elseif (y_46_im <= 1.6e+100) tmp = t_1; else tmp = Float64(Float64(x_46_im + Float64(x_46_re / Float64(y_46_im / y_46_re))) / 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 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re)); t_1 = ((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -5.2e+143) tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))); elseif (y_46_im <= -8.8e+80) tmp = t_0; elseif (y_46_im <= -3.8e+29) tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re * (y_46_im ^ -2.0))); elseif (y_46_im <= -1.72e-97) tmp = t_1; elseif (y_46_im <= 9.6e-88) tmp = t_0; elseif (y_46_im <= 1.6e+100) tmp = t_1; else tmp = (x_46_im + (x_46_re / (y_46_im / y_46_re))) / 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[(-1.0 / y$46$re), $MachinePrecision] * N[((-x$46$re) - N[(N[(y$46$im * x$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(y$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * y$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.2e+143], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(y$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -8.8e+80], t$95$0, If[LessEqual[y$46$im, -3.8e+29], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(y$46$re * N[(x$46$re * N[Power[y$46$im, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.72e-97], t$95$1, If[LessEqual[y$46$im, 9.6e-88], t$95$0, If[LessEqual[y$46$im, 1.6e+100], t$95$1, N[(N[(x$46$im + N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{y.re} \cdot \left(\left(-x.re\right) - \frac{y.im \cdot x.im}{y.re}\right)\\
t_1 := \frac{y.im \cdot x.im + x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -5.2 \cdot 10^{+143}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{y.im \cdot \frac{y.im}{y.re}}\\
\mathbf{elif}\;y.im \leq -8.8 \cdot 10^{+80}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -3.8 \cdot 10^{+29}:\\
\;\;\;\;\frac{x.im}{y.im} + y.re \cdot \left(x.re \cdot {y.im}^{-2}\right)\\
\mathbf{elif}\;y.im \leq -1.72 \cdot 10^{-97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 9.6 \cdot 10^{-88}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.6 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + \frac{x.re}{\frac{y.im}{y.re}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -5.1999999999999998e143Initial program 24.8%
Taylor expanded in y.re around 0 69.4%
associate-/l*70.2%
Simplified70.2%
unpow270.2%
*-un-lft-identity70.2%
times-frac80.9%
Applied egg-rr80.9%
if -5.1999999999999998e143 < y.im < -8.80000000000000011e80 or -1.71999999999999995e-97 < y.im < 9.5999999999999998e-88Initial program 67.7%
*-un-lft-identity67.7%
add-sqr-sqrt67.7%
times-frac67.8%
hypot-def67.8%
fma-def67.8%
hypot-def82.4%
Applied egg-rr82.4%
Taylor expanded in y.re around -inf 47.2%
Taylor expanded in y.re around -inf 90.7%
if -8.80000000000000011e80 < y.im < -3.79999999999999971e29Initial program 66.7%
Taylor expanded in y.re around 0 78.2%
associate-/l*78.2%
associate-/r/78.2%
Simplified78.2%
expm1-log1p-u55.9%
expm1-udef55.9%
pow255.9%
div-inv55.9%
pow255.9%
pow-flip55.9%
metadata-eval55.9%
Applied egg-rr55.9%
expm1-def55.9%
expm1-log1p78.4%
Simplified78.4%
if -3.79999999999999971e29 < y.im < -1.71999999999999995e-97 or 9.5999999999999998e-88 < y.im < 1.5999999999999999e100Initial program 78.3%
if 1.5999999999999999e100 < y.im Initial program 35.4%
*-un-lft-identity35.4%
add-sqr-sqrt35.4%
times-frac35.3%
hypot-def35.3%
fma-def35.3%
hypot-def44.3%
Applied egg-rr44.3%
associate-*l/44.5%
*-un-lft-identity44.5%
Applied egg-rr44.5%
Taylor expanded in y.re around 0 86.2%
associate-/l*97.3%
Simplified97.3%
Final simplification86.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.im x.im) (* x.re y.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ x.re (/ y.im y.re))))
(if (<= y.im -3.8e+29)
(/ (- (- x.im) t_1) (hypot y.re y.im))
(if (<= y.im -1.7e-97)
t_0
(if (<= y.im 1.02e-87)
(* (/ -1.0 y.re) (- (- x.re) (/ (* y.im x.im) y.re)))
(if (<= y.im 3.8e+101) t_0 (/ (+ x.im t_1) (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) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = x_46_re / (y_46_im / y_46_re);
double tmp;
if (y_46_im <= -3.8e+29) {
tmp = (-x_46_im - t_1) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -1.7e-97) {
tmp = t_0;
} else if (y_46_im <= 1.02e-87) {
tmp = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
} else if (y_46_im <= 3.8e+101) {
tmp = t_0;
} else {
tmp = (x_46_im + t_1) / 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) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = x_46_re / (y_46_im / y_46_re);
double tmp;
if (y_46_im <= -3.8e+29) {
tmp = (-x_46_im - t_1) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_im <= -1.7e-97) {
tmp = t_0;
} else if (y_46_im <= 1.02e-87) {
tmp = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
} else if (y_46_im <= 3.8e+101) {
tmp = t_0;
} else {
tmp = (x_46_im + t_1) / 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) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = x_46_re / (y_46_im / y_46_re) tmp = 0 if y_46_im <= -3.8e+29: tmp = (-x_46_im - t_1) / math.hypot(y_46_re, y_46_im) elif y_46_im <= -1.7e-97: tmp = t_0 elif y_46_im <= 1.02e-87: tmp = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re)) elif y_46_im <= 3.8e+101: tmp = t_0 else: tmp = (x_46_im + t_1) / 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(x_46_re * y_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(x_46_re / Float64(y_46_im / y_46_re)) tmp = 0.0 if (y_46_im <= -3.8e+29) tmp = Float64(Float64(Float64(-x_46_im) - t_1) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -1.7e-97) tmp = t_0; elseif (y_46_im <= 1.02e-87) tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(-x_46_re) - Float64(Float64(y_46_im * x_46_im) / y_46_re))); elseif (y_46_im <= 3.8e+101) tmp = t_0; else tmp = Float64(Float64(x_46_im + t_1) / 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) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = x_46_re / (y_46_im / y_46_re); tmp = 0.0; if (y_46_im <= -3.8e+29) tmp = (-x_46_im - t_1) / hypot(y_46_re, y_46_im); elseif (y_46_im <= -1.7e-97) tmp = t_0; elseif (y_46_im <= 1.02e-87) tmp = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re)); elseif (y_46_im <= 3.8e+101) tmp = t_0; else tmp = (x_46_im + t_1) / 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[(x$46$re * y$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[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.8e+29], N[(N[((-x$46$im) - t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.7e-97], t$95$0, If[LessEqual[y$46$im, 1.02e-87], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[((-x$46$re) - N[(N[(y$46$im * x$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.8e+101], t$95$0, N[(N[(x$46$im + t$95$1), $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 + x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.re}{\frac{y.im}{y.re}}\\
\mathbf{if}\;y.im \leq -3.8 \cdot 10^{+29}:\\
\;\;\;\;\frac{\left(-x.im\right) - t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-97}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.02 \cdot 10^{-87}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(\left(-x.re\right) - \frac{y.im \cdot x.im}{y.re}\right)\\
\mathbf{elif}\;y.im \leq 3.8 \cdot 10^{+101}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -3.79999999999999971e29Initial program 30.3%
*-un-lft-identity30.3%
add-sqr-sqrt30.3%
times-frac30.3%
hypot-def30.3%
fma-def30.3%
hypot-def54.4%
Applied egg-rr54.4%
associate-*l/54.4%
*-un-lft-identity54.4%
Applied egg-rr54.4%
Taylor expanded in y.im around -inf 68.7%
mul-1-neg68.7%
unsub-neg68.7%
mul-1-neg68.7%
associate-/l*79.4%
Simplified79.4%
if -3.79999999999999971e29 < y.im < -1.6999999999999999e-97 or 1.02000000000000009e-87 < y.im < 3.7999999999999998e101Initial program 78.3%
if -1.6999999999999999e-97 < y.im < 1.02000000000000009e-87Initial program 73.5%
*-un-lft-identity73.5%
add-sqr-sqrt73.5%
times-frac73.6%
hypot-def73.6%
fma-def73.6%
hypot-def87.0%
Applied egg-rr87.0%
Taylor expanded in y.re around -inf 49.4%
Taylor expanded in y.re around -inf 94.0%
if 3.7999999999999998e101 < y.im Initial program 35.4%
*-un-lft-identity35.4%
add-sqr-sqrt35.4%
times-frac35.3%
hypot-def35.3%
fma-def35.3%
hypot-def44.3%
Applied egg-rr44.3%
associate-*l/44.5%
*-un-lft-identity44.5%
Applied egg-rr44.5%
Taylor expanded in y.re around 0 86.2%
associate-/l*97.3%
Simplified97.3%
Final simplification86.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (/ -1.0 y.re) (- (- x.re) (/ (* y.im x.im) y.re))))
(t_1
(/ (+ (* y.im x.im) (* x.re y.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_2 (+ (/ x.im y.im) (/ x.re (* y.im (/ y.im y.re))))))
(if (<= y.im -5.2e+143)
t_2
(if (<= y.im -1.9e+81)
t_0
(if (<= y.im -3.8e+29)
(+ (/ x.im y.im) (* y.re (* x.re (pow y.im -2.0))))
(if (<= y.im -1.75e-97)
t_1
(if (<= y.im 8e-88) t_0 (if (<= y.im 1.02e+124) t_1 t_2))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
double t_1 = ((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_2 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
double tmp;
if (y_46_im <= -5.2e+143) {
tmp = t_2;
} else if (y_46_im <= -1.9e+81) {
tmp = t_0;
} else if (y_46_im <= -3.8e+29) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re * pow(y_46_im, -2.0)));
} else if (y_46_im <= -1.75e-97) {
tmp = t_1;
} else if (y_46_im <= 8e-88) {
tmp = t_0;
} else if (y_46_im <= 1.02e+124) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = ((-1.0d0) / y_46re) * (-x_46re - ((y_46im * x_46im) / y_46re))
t_1 = ((y_46im * x_46im) + (x_46re * y_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_2 = (x_46im / y_46im) + (x_46re / (y_46im * (y_46im / y_46re)))
if (y_46im <= (-5.2d+143)) then
tmp = t_2
else if (y_46im <= (-1.9d+81)) then
tmp = t_0
else if (y_46im <= (-3.8d+29)) then
tmp = (x_46im / y_46im) + (y_46re * (x_46re * (y_46im ** (-2.0d0))))
else if (y_46im <= (-1.75d-97)) then
tmp = t_1
else if (y_46im <= 8d-88) then
tmp = t_0
else if (y_46im <= 1.02d+124) then
tmp = t_1
else
tmp = t_2
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 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
double t_1 = ((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_2 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
double tmp;
if (y_46_im <= -5.2e+143) {
tmp = t_2;
} else if (y_46_im <= -1.9e+81) {
tmp = t_0;
} else if (y_46_im <= -3.8e+29) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re * Math.pow(y_46_im, -2.0)));
} else if (y_46_im <= -1.75e-97) {
tmp = t_1;
} else if (y_46_im <= 8e-88) {
tmp = t_0;
} else if (y_46_im <= 1.02e+124) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re)) t_1 = ((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_2 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))) tmp = 0 if y_46_im <= -5.2e+143: tmp = t_2 elif y_46_im <= -1.9e+81: tmp = t_0 elif y_46_im <= -3.8e+29: tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re * math.pow(y_46_im, -2.0))) elif y_46_im <= -1.75e-97: tmp = t_1 elif y_46_im <= 8e-88: tmp = t_0 elif y_46_im <= 1.02e+124: tmp = t_1 else: tmp = t_2 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(-x_46_re) - Float64(Float64(y_46_im * x_46_im) / y_46_re))) t_1 = Float64(Float64(Float64(y_46_im * x_46_im) + Float64(x_46_re * y_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_2 = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64(y_46_im * Float64(y_46_im / y_46_re)))) tmp = 0.0 if (y_46_im <= -5.2e+143) tmp = t_2; elseif (y_46_im <= -1.9e+81) tmp = t_0; elseif (y_46_im <= -3.8e+29) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(y_46_re * Float64(x_46_re * (y_46_im ^ -2.0)))); elseif (y_46_im <= -1.75e-97) tmp = t_1; elseif (y_46_im <= 8e-88) tmp = t_0; elseif (y_46_im <= 1.02e+124) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re)); t_1 = ((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_2 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))); tmp = 0.0; if (y_46_im <= -5.2e+143) tmp = t_2; elseif (y_46_im <= -1.9e+81) tmp = t_0; elseif (y_46_im <= -3.8e+29) tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re * (y_46_im ^ -2.0))); elseif (y_46_im <= -1.75e-97) tmp = t_1; elseif (y_46_im <= 8e-88) tmp = t_0; elseif (y_46_im <= 1.02e+124) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[((-x$46$re) - N[(N[(y$46$im * x$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(y$46$im * x$46$im), $MachinePrecision] + N[(x$46$re * y$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$2 = N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(y$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5.2e+143], t$95$2, If[LessEqual[y$46$im, -1.9e+81], t$95$0, If[LessEqual[y$46$im, -3.8e+29], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(y$46$re * N[(x$46$re * N[Power[y$46$im, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.75e-97], t$95$1, If[LessEqual[y$46$im, 8e-88], t$95$0, If[LessEqual[y$46$im, 1.02e+124], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{y.re} \cdot \left(\left(-x.re\right) - \frac{y.im \cdot x.im}{y.re}\right)\\
t_1 := \frac{y.im \cdot x.im + x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_2 := \frac{x.im}{y.im} + \frac{x.re}{y.im \cdot \frac{y.im}{y.re}}\\
\mathbf{if}\;y.im \leq -5.2 \cdot 10^{+143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq -1.9 \cdot 10^{+81}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -3.8 \cdot 10^{+29}:\\
\;\;\;\;\frac{x.im}{y.im} + y.re \cdot \left(x.re \cdot {y.im}^{-2}\right)\\
\mathbf{elif}\;y.im \leq -1.75 \cdot 10^{-97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 8 \cdot 10^{-88}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.02 \cdot 10^{+124}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y.im < -5.1999999999999998e143 or 1.01999999999999994e124 < y.im Initial program 23.9%
Taylor expanded in y.re around 0 73.2%
associate-/l*74.0%
Simplified74.0%
unpow274.0%
*-un-lft-identity74.0%
times-frac83.2%
Applied egg-rr83.2%
if -5.1999999999999998e143 < y.im < -1.9e81 or -1.7500000000000001e-97 < y.im < 7.99999999999999947e-88Initial program 67.7%
*-un-lft-identity67.7%
add-sqr-sqrt67.7%
times-frac67.8%
hypot-def67.8%
fma-def67.8%
hypot-def82.4%
Applied egg-rr82.4%
Taylor expanded in y.re around -inf 47.2%
Taylor expanded in y.re around -inf 90.7%
if -1.9e81 < y.im < -3.79999999999999971e29Initial program 66.7%
Taylor expanded in y.re around 0 78.2%
associate-/l*78.2%
associate-/r/78.2%
Simplified78.2%
expm1-log1p-u55.9%
expm1-udef55.9%
pow255.9%
div-inv55.9%
pow255.9%
pow-flip55.9%
metadata-eval55.9%
Applied egg-rr55.9%
expm1-def55.9%
expm1-log1p78.4%
Simplified78.4%
if -3.79999999999999971e29 < y.im < -1.7500000000000001e-97 or 7.99999999999999947e-88 < y.im < 1.01999999999999994e124Initial program 79.0%
Final simplification84.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.im x.im) (* x.re y.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (* (/ -1.0 y.re) (- (- x.re) (/ (* y.im x.im) y.re))))
(t_2 (+ (/ x.im y.im) (/ x.re (* y.im (/ y.im y.re))))))
(if (<= y.im -5.2e+143)
t_2
(if (<= y.im -1.95e+81)
t_1
(if (<= y.im -2.05e+51)
(/ x.im y.im)
(if (<= y.im -1.8e-97)
t_0
(if (<= y.im 8.8e-88) t_1 (if (<= y.im 1.65e+123) t_0 t_2))))))))
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) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
double t_2 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
double tmp;
if (y_46_im <= -5.2e+143) {
tmp = t_2;
} else if (y_46_im <= -1.95e+81) {
tmp = t_1;
} else if (y_46_im <= -2.05e+51) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -1.8e-97) {
tmp = t_0;
} else if (y_46_im <= 8.8e-88) {
tmp = t_1;
} else if (y_46_im <= 1.65e+123) {
tmp = t_0;
} else {
tmp = t_2;
}
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_46im * x_46im) + (x_46re * y_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = ((-1.0d0) / y_46re) * (-x_46re - ((y_46im * x_46im) / y_46re))
t_2 = (x_46im / y_46im) + (x_46re / (y_46im * (y_46im / y_46re)))
if (y_46im <= (-5.2d+143)) then
tmp = t_2
else if (y_46im <= (-1.95d+81)) then
tmp = t_1
else if (y_46im <= (-2.05d+51)) then
tmp = x_46im / y_46im
else if (y_46im <= (-1.8d-97)) then
tmp = t_0
else if (y_46im <= 8.8d-88) then
tmp = t_1
else if (y_46im <= 1.65d+123) then
tmp = t_0
else
tmp = t_2
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) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
double t_2 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
double tmp;
if (y_46_im <= -5.2e+143) {
tmp = t_2;
} else if (y_46_im <= -1.95e+81) {
tmp = t_1;
} else if (y_46_im <= -2.05e+51) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -1.8e-97) {
tmp = t_0;
} else if (y_46_im <= 8.8e-88) {
tmp = t_1;
} else if (y_46_im <= 1.65e+123) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_im * x_46_im) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re)) t_2 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))) tmp = 0 if y_46_im <= -5.2e+143: tmp = t_2 elif y_46_im <= -1.95e+81: tmp = t_1 elif y_46_im <= -2.05e+51: tmp = x_46_im / y_46_im elif y_46_im <= -1.8e-97: tmp = t_0 elif y_46_im <= 8.8e-88: tmp = t_1 elif y_46_im <= 1.65e+123: tmp = t_0 else: tmp = t_2 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(x_46_re * y_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(-x_46_re) - Float64(Float64(y_46_im * x_46_im) / y_46_re))) t_2 = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64(y_46_im * Float64(y_46_im / y_46_re)))) tmp = 0.0 if (y_46_im <= -5.2e+143) tmp = t_2; elseif (y_46_im <= -1.95e+81) tmp = t_1; elseif (y_46_im <= -2.05e+51) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -1.8e-97) tmp = t_0; elseif (y_46_im <= 8.8e-88) tmp = t_1; elseif (y_46_im <= 1.65e+123) tmp = t_0; else tmp = t_2; 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) + (x_46_re * y_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re)); t_2 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))); tmp = 0.0; if (y_46_im <= -5.2e+143) tmp = t_2; elseif (y_46_im <= -1.95e+81) tmp = t_1; elseif (y_46_im <= -2.05e+51) tmp = x_46_im / y_46_im; elseif (y_46_im <= -1.8e-97) tmp = t_0; elseif (y_46_im <= 8.8e-88) tmp = t_1; elseif (y_46_im <= 1.65e+123) tmp = t_0; else tmp = t_2; 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[(x$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[((-x$46$re) - N[(N[(y$46$im * x$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(y$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5.2e+143], t$95$2, If[LessEqual[y$46$im, -1.95e+81], t$95$1, If[LessEqual[y$46$im, -2.05e+51], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -1.8e-97], t$95$0, If[LessEqual[y$46$im, 8.8e-88], t$95$1, If[LessEqual[y$46$im, 1.65e+123], t$95$0, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.im \cdot x.im + x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{-1}{y.re} \cdot \left(\left(-x.re\right) - \frac{y.im \cdot x.im}{y.re}\right)\\
t_2 := \frac{x.im}{y.im} + \frac{x.re}{y.im \cdot \frac{y.im}{y.re}}\\
\mathbf{if}\;y.im \leq -5.2 \cdot 10^{+143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y.im \leq -1.95 \cdot 10^{+81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -2.05 \cdot 10^{+51}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -1.8 \cdot 10^{-97}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 8.8 \cdot 10^{-88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 1.65 \cdot 10^{+123}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if y.im < -5.1999999999999998e143 or 1.65000000000000001e123 < y.im Initial program 23.9%
Taylor expanded in y.re around 0 73.2%
associate-/l*74.0%
Simplified74.0%
unpow274.0%
*-un-lft-identity74.0%
times-frac83.2%
Applied egg-rr83.2%
if -5.1999999999999998e143 < y.im < -1.95e81 or -1.79999999999999999e-97 < y.im < 8.8000000000000002e-88Initial program 67.7%
*-un-lft-identity67.7%
add-sqr-sqrt67.7%
times-frac67.8%
hypot-def67.8%
fma-def67.8%
hypot-def82.4%
Applied egg-rr82.4%
Taylor expanded in y.re around -inf 47.2%
Taylor expanded in y.re around -inf 90.7%
if -1.95e81 < y.im < -2.05000000000000005e51Initial program 67.0%
Taylor expanded in y.re around 0 84.4%
if -2.05000000000000005e51 < y.im < -1.79999999999999999e-97 or 8.8000000000000002e-88 < y.im < 1.65000000000000001e123Initial program 78.5%
Final simplification84.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (/ -1.0 y.re) (- (- x.re) (/ (* y.im x.im) y.re))))
(t_1 (+ (/ x.im y.im) (/ x.re (* y.im (/ y.im y.re))))))
(if (<= y.im -5.2e+143)
t_1
(if (<= y.im -1.75e+81)
t_0
(if (<= y.im -4.4e+29)
t_1
(if (<= y.im 1.7e-71)
t_0
(/ x.im (+ y.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 t_0 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
double t_1 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
double tmp;
if (y_46_im <= -5.2e+143) {
tmp = t_1;
} else if (y_46_im <= -1.75e+81) {
tmp = t_0;
} else if (y_46_im <= -4.4e+29) {
tmp = t_1;
} else if (y_46_im <= 1.7e-71) {
tmp = t_0;
} else {
tmp = x_46_im / (y_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((-1.0d0) / y_46re) * (-x_46re - ((y_46im * x_46im) / y_46re))
t_1 = (x_46im / y_46im) + (x_46re / (y_46im * (y_46im / y_46re)))
if (y_46im <= (-5.2d+143)) then
tmp = t_1
else if (y_46im <= (-1.75d+81)) then
tmp = t_0
else if (y_46im <= (-4.4d+29)) then
tmp = t_1
else if (y_46im <= 1.7d-71) then
tmp = t_0
else
tmp = x_46im / (y_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 t_0 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re));
double t_1 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
double tmp;
if (y_46_im <= -5.2e+143) {
tmp = t_1;
} else if (y_46_im <= -1.75e+81) {
tmp = t_0;
} else if (y_46_im <= -4.4e+29) {
tmp = t_1;
} else if (y_46_im <= 1.7e-71) {
tmp = t_0;
} else {
tmp = x_46_im / (y_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): t_0 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re)) t_1 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))) tmp = 0 if y_46_im <= -5.2e+143: tmp = t_1 elif y_46_im <= -1.75e+81: tmp = t_0 elif y_46_im <= -4.4e+29: tmp = t_1 elif y_46_im <= 1.7e-71: tmp = t_0 else: tmp = x_46_im / (y_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) t_0 = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(-x_46_re) - Float64(Float64(y_46_im * x_46_im) / y_46_re))) t_1 = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64(y_46_im * Float64(y_46_im / y_46_re)))) tmp = 0.0 if (y_46_im <= -5.2e+143) tmp = t_1; elseif (y_46_im <= -1.75e+81) tmp = t_0; elseif (y_46_im <= -4.4e+29) tmp = t_1; elseif (y_46_im <= 1.7e-71) tmp = t_0; else tmp = Float64(x_46_im / Float64(y_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) t_0 = (-1.0 / y_46_re) * (-x_46_re - ((y_46_im * x_46_im) / y_46_re)); t_1 = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))); tmp = 0.0; if (y_46_im <= -5.2e+143) tmp = t_1; elseif (y_46_im <= -1.75e+81) tmp = t_0; elseif (y_46_im <= -4.4e+29) tmp = t_1; elseif (y_46_im <= 1.7e-71) tmp = t_0; else tmp = x_46_im / (y_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_] := Block[{t$95$0 = N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[((-x$46$re) - N[(N[(y$46$im * x$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(y$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5.2e+143], t$95$1, If[LessEqual[y$46$im, -1.75e+81], t$95$0, If[LessEqual[y$46$im, -4.4e+29], t$95$1, If[LessEqual[y$46$im, 1.7e-71], t$95$0, N[(x$46$im / N[(y$46$im + N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{y.re} \cdot \left(\left(-x.re\right) - \frac{y.im \cdot x.im}{y.re}\right)\\
t_1 := \frac{x.im}{y.im} + \frac{x.re}{y.im \cdot \frac{y.im}{y.re}}\\
\mathbf{if}\;y.im \leq -5.2 \cdot 10^{+143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -1.75 \cdot 10^{+81}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -4.4 \cdot 10^{+29}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{-71}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im + y.re \cdot \frac{y.re}{y.im}}\\
\end{array}
\end{array}
if y.im < -5.1999999999999998e143 or -1.75e81 < y.im < -4.4000000000000003e29Initial program 32.5%
Taylor expanded in y.re around 0 72.2%
associate-/l*72.9%
Simplified72.9%
unpow272.9%
*-un-lft-identity72.9%
times-frac82.0%
Applied egg-rr82.0%
if -5.1999999999999998e143 < y.im < -1.75e81 or -4.4000000000000003e29 < y.im < 1.70000000000000002e-71Initial program 71.1%
*-un-lft-identity71.1%
add-sqr-sqrt71.1%
times-frac71.1%
hypot-def71.2%
fma-def71.2%
hypot-def85.2%
Applied egg-rr85.2%
Taylor expanded in y.re around -inf 44.6%
Taylor expanded in y.re around -inf 85.3%
if 1.70000000000000002e-71 < y.im Initial program 57.2%
Taylor expanded in x.re around 0 46.1%
associate-/l*54.6%
Simplified54.6%
Taylor expanded in y.im around 0 69.8%
unpow269.8%
*-un-lft-identity69.8%
times-frac72.2%
Applied egg-rr72.2%
Final simplification80.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.im (+ y.im (* y.re (/ y.re y.im))))))
(if (<= y.im -9.5e-15)
t_0
(if (<= y.im -1.7e-55)
(/ (* x.re y.re) (+ (* y.re y.re) (* y.im y.im)))
(if (or (<= y.im -8.2e-70) (not (<= y.im 4e-71))) t_0 (/ x.re 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_im + (y_46_re * (y_46_re / y_46_im)));
double tmp;
if (y_46_im <= -9.5e-15) {
tmp = t_0;
} else if (y_46_im <= -1.7e-55) {
tmp = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if ((y_46_im <= -8.2e-70) || !(y_46_im <= 4e-71)) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = x_46im / (y_46im + (y_46re * (y_46re / y_46im)))
if (y_46im <= (-9.5d-15)) then
tmp = t_0
else if (y_46im <= (-1.7d-55)) then
tmp = (x_46re * y_46re) / ((y_46re * y_46re) + (y_46im * y_46im))
else if ((y_46im <= (-8.2d-70)) .or. (.not. (y_46im <= 4d-71))) then
tmp = t_0
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 t_0 = x_46_im / (y_46_im + (y_46_re * (y_46_re / y_46_im)));
double tmp;
if (y_46_im <= -9.5e-15) {
tmp = t_0;
} else if (y_46_im <= -1.7e-55) {
tmp = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if ((y_46_im <= -8.2e-70) || !(y_46_im <= 4e-71)) {
tmp = t_0;
} else {
tmp = x_46_re / 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_im + (y_46_re * (y_46_re / y_46_im))) tmp = 0 if y_46_im <= -9.5e-15: tmp = t_0 elif y_46_im <= -1.7e-55: tmp = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif (y_46_im <= -8.2e-70) or not (y_46_im <= 4e-71): tmp = t_0 else: tmp = x_46_re / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_im / Float64(y_46_im + Float64(y_46_re * Float64(y_46_re / y_46_im)))) tmp = 0.0 if (y_46_im <= -9.5e-15) tmp = t_0; elseif (y_46_im <= -1.7e-55) tmp = Float64(Float64(x_46_re * y_46_re) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif ((y_46_im <= -8.2e-70) || !(y_46_im <= 4e-71)) tmp = t_0; 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) t_0 = x_46_im / (y_46_im + (y_46_re * (y_46_re / y_46_im))); tmp = 0.0; if (y_46_im <= -9.5e-15) tmp = t_0; elseif (y_46_im <= -1.7e-55) tmp = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif ((y_46_im <= -8.2e-70) || ~((y_46_im <= 4e-71))) tmp = t_0; 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_] := Block[{t$95$0 = N[(x$46$im / N[(y$46$im + N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -9.5e-15], t$95$0, If[LessEqual[y$46$im, -1.7e-55], N[(N[(x$46$re * y$46$re), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, -8.2e-70], N[Not[LessEqual[y$46$im, 4e-71]], $MachinePrecision]], t$95$0, N[(x$46$re / y$46$re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{y.im + y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{if}\;y.im \leq -9.5 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-55}:\\
\;\;\;\;\frac{x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq -8.2 \cdot 10^{-70} \lor \neg \left(y.im \leq 4 \cdot 10^{-71}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -9.5000000000000005e-15 or -1.69999999999999986e-55 < y.im < -8.19999999999999955e-70 or 3.9999999999999997e-71 < y.im Initial program 47.9%
Taylor expanded in x.re around 0 40.7%
associate-/l*46.9%
Simplified46.9%
Taylor expanded in y.im around 0 66.7%
unpow266.7%
*-un-lft-identity66.7%
times-frac70.3%
Applied egg-rr70.3%
if -9.5000000000000005e-15 < y.im < -1.69999999999999986e-55Initial program 83.6%
Taylor expanded in x.re around inf 83.6%
*-commutative83.6%
Simplified83.6%
if -8.19999999999999955e-70 < y.im < 3.9999999999999997e-71Initial program 75.0%
Taylor expanded in y.re around inf 69.3%
Final simplification70.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.9e-13) (not (<= y.im 3.5e-73))) (/ x.im (+ y.im (* y.re (/ y.re 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 <= -2.9e-13) || !(y_46_im <= 3.5e-73)) {
tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re / 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 <= (-2.9d-13)) .or. (.not. (y_46im <= 3.5d-73))) then
tmp = x_46im / (y_46im + (y_46re * (y_46re / 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 <= -2.9e-13) || !(y_46_im <= 3.5e-73)) {
tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re / 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 <= -2.9e-13) or not (y_46_im <= 3.5e-73): tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re / 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 <= -2.9e-13) || !(y_46_im <= 3.5e-73)) tmp = Float64(x_46_im / Float64(y_46_im + Float64(y_46_re * Float64(y_46_re / 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 <= -2.9e-13) || ~((y_46_im <= 3.5e-73))) tmp = x_46_im / (y_46_im + (y_46_re * (y_46_re / 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, -2.9e-13], N[Not[LessEqual[y$46$im, 3.5e-73]], $MachinePrecision]], N[(x$46$im / N[(y$46$im + N[(y$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.9 \cdot 10^{-13} \lor \neg \left(y.im \leq 3.5 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{x.im}{y.im + y.re \cdot \frac{y.re}{y.im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -2.8999999999999998e-13 or 3.4999999999999998e-73 < y.im Initial program 47.2%
Taylor expanded in x.re around 0 40.0%
associate-/l*46.2%
Simplified46.2%
Taylor expanded in y.im around 0 66.2%
unpow266.2%
*-un-lft-identity66.2%
times-frac69.9%
Applied egg-rr69.9%
if -2.8999999999999998e-13 < y.im < 3.4999999999999998e-73Initial program 76.0%
Taylor expanded in y.re around inf 66.1%
Final simplification68.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -3.1e-58)
(+ (/ x.im y.im) (/ x.re (* y.im (/ y.im y.re))))
(if (<= y.im 3.2e-71)
(/ x.re y.re)
(/ x.im (+ y.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 <= -3.1e-58) {
tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
} else if (y_46_im <= 3.2e-71) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / (y_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 <= (-3.1d-58)) then
tmp = (x_46im / y_46im) + (x_46re / (y_46im * (y_46im / y_46re)))
else if (y_46im <= 3.2d-71) then
tmp = x_46re / y_46re
else
tmp = x_46im / (y_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 <= -3.1e-58) {
tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
} else if (y_46_im <= 3.2e-71) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / (y_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 <= -3.1e-58: tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))) elif y_46_im <= 3.2e-71: tmp = x_46_re / y_46_re else: tmp = x_46_im / (y_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 <= -3.1e-58) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64(y_46_im * Float64(y_46_im / y_46_re)))); elseif (y_46_im <= 3.2e-71) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(x_46_im / Float64(y_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 <= -3.1e-58) tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))); elseif (y_46_im <= 3.2e-71) tmp = x_46_re / y_46_re; else tmp = x_46_im / (y_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[LessEqual[y$46$im, -3.1e-58], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(y$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.2e-71], N[(x$46$re / y$46$re), $MachinePrecision], N[(x$46$im / N[(y$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 -3.1 \cdot 10^{-58}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{y.im \cdot \frac{y.im}{y.re}}\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{-71}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im + y.re \cdot \frac{y.re}{y.im}}\\
\end{array}
\end{array}
if y.im < -3.0999999999999999e-58Initial program 40.2%
Taylor expanded in y.re around 0 60.6%
associate-/l*61.8%
Simplified61.8%
unpow261.8%
*-un-lft-identity61.8%
times-frac67.8%
Applied egg-rr67.8%
if -3.0999999999999999e-58 < y.im < 3.1999999999999999e-71Initial program 75.3%
Taylor expanded in y.re around inf 68.6%
if 3.1999999999999999e-71 < y.im Initial program 57.2%
Taylor expanded in x.re around 0 46.1%
associate-/l*54.6%
Simplified54.6%
Taylor expanded in y.im around 0 69.8%
unpow269.8%
*-un-lft-identity69.8%
times-frac72.2%
Applied egg-rr72.2%
Final simplification69.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.56e+38) (not (<= y.im 4.5e-71))) (/ 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.56e+38) || !(y_46_im <= 4.5e-71)) {
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.56d+38)) .or. (.not. (y_46im <= 4.5d-71))) 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.56e+38) || !(y_46_im <= 4.5e-71)) {
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.56e+38) or not (y_46_im <= 4.5e-71): 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.56e+38) || !(y_46_im <= 4.5e-71)) 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.56e+38) || ~((y_46_im <= 4.5e-71))) 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.56e+38], N[Not[LessEqual[y$46$im, 4.5e-71]], $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.56 \cdot 10^{+38} \lor \neg \left(y.im \leq 4.5 \cdot 10^{-71}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -1.5599999999999999e38 or 4.5000000000000002e-71 < y.im Initial program 45.3%
Taylor expanded in y.re around 0 61.6%
if -1.5599999999999999e38 < y.im < 4.5000000000000002e-71Initial program 76.1%
Taylor expanded in y.re around inf 64.2%
Final simplification62.7%
(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 58.8%
Taylor expanded in y.re around 0 40.3%
Final simplification40.3%
herbie shell --seed 2023333
(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))))