
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im) :precision binary64 (fma (/ y.re (hypot y.re y.im)) (/ x.im (hypot y.re y.im)) (* (/ x.re (/ (hypot y.re y.im) y.im)) (/ -1.0 (hypot y.re y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), ((x_46_re / (hypot(y_46_re, y_46_im) / y_46_im)) * (-1.0 / hypot(y_46_re, y_46_im))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(x_46_re / Float64(hypot(y_46_re, y_46_im) / y_46_im)) * Float64(-1.0 / hypot(y_46_re, y_46_im)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\right)
\end{array}
Initial program 60.8%
div-sub57.9%
sub-neg57.9%
*-commutative57.9%
add-sqr-sqrt57.9%
times-frac60.3%
fma-def60.3%
hypot-def60.3%
hypot-def75.7%
associate-/l*78.7%
add-sqr-sqrt78.7%
pow278.7%
hypot-def78.7%
Applied egg-rr78.7%
unpow278.7%
*-un-lft-identity78.7%
times-frac96.4%
Applied egg-rr96.4%
/-rgt-identity96.4%
*-un-lft-identity96.4%
times-frac97.4%
Applied egg-rr97.4%
Final simplification97.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (fma (/ y.re (hypot y.re y.im)) (/ x.im (hypot y.re y.im)) (* (/ x.re (hypot y.re y.im)) (/ (- y.im) (hypot y.re y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), ((x_46_re / hypot(y_46_re, y_46_im)) * (-y_46_im / hypot(y_46_re, y_46_im))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(x_46_re / hypot(y_46_re, y_46_im)) * Float64(Float64(-y_46_im) / hypot(y_46_re, y_46_im)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[((-y$46$im) / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{-y.im}{\mathsf{hypot}\left(y.re, y.im\right)}\right)
\end{array}
Initial program 60.8%
div-sub57.9%
sub-neg57.9%
*-commutative57.9%
add-sqr-sqrt57.9%
times-frac60.3%
fma-def60.3%
hypot-def60.3%
hypot-def75.7%
associate-/l*78.7%
add-sqr-sqrt78.7%
pow278.7%
hypot-def78.7%
Applied egg-rr78.7%
unpow278.7%
*-un-lft-identity78.7%
times-frac96.4%
Applied egg-rr96.4%
/-rgt-identity96.4%
*-un-lft-identity96.4%
*-commutative96.4%
frac-times97.1%
clear-num97.1%
Applied egg-rr97.1%
Final simplification97.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 5e+280)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(/ (- x.re) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+280) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), (-x_46_re / y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 5e+280) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); else tmp = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(-x_46_re) / y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+280], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[((-x$46$re) / y$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 5 \cdot 10^{+280}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{-x.re}{y.im}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 5.0000000000000002e280Initial program 76.2%
*-un-lft-identity76.2%
add-sqr-sqrt76.2%
times-frac76.2%
hypot-def76.2%
hypot-def96.4%
Applied egg-rr96.4%
if 5.0000000000000002e280 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 13.6%
div-sub10.0%
sub-neg10.0%
*-commutative10.0%
add-sqr-sqrt10.0%
times-frac17.5%
fma-def17.5%
hypot-def17.5%
hypot-def51.1%
associate-/l*61.8%
add-sqr-sqrt61.8%
pow261.8%
hypot-def61.8%
Applied egg-rr61.8%
Taylor expanded in y.re around 0 72.6%
Final simplification90.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 4e+263)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(/ x.im (* (hypot y.re y.im) (/ (hypot y.re y.im) y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 4e+263) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = x_46_im / (hypot(y_46_re, y_46_im) * (hypot(y_46_re, y_46_im) / y_46_re));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 4e+263) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (t_0 / Math.hypot(y_46_re, y_46_im));
} else {
tmp = x_46_im / (Math.hypot(y_46_re, y_46_im) * (Math.hypot(y_46_re, y_46_im) / y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 4e+263: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (t_0 / math.hypot(y_46_re, y_46_im)) else: tmp = x_46_im / (math.hypot(y_46_re, y_46_im) * (math.hypot(y_46_re, y_46_im) / y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 4e+263) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); else tmp = Float64(x_46_im / Float64(hypot(y_46_re, y_46_im) * Float64(hypot(y_46_re, y_46_im) / y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 4e+263) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im)); else tmp = x_46_im / (hypot(y_46_re, y_46_im) * (hypot(y_46_re, y_46_im) / y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 4e+263], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] * N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 4 \cdot 10^{+263}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 4.00000000000000006e263Initial program 76.1%
*-un-lft-identity76.1%
add-sqr-sqrt76.1%
times-frac76.0%
hypot-def76.1%
hypot-def96.4%
Applied egg-rr96.4%
if 4.00000000000000006e263 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 14.9%
Taylor expanded in x.im around inf 14.3%
associate-/l*22.0%
unpow222.0%
fma-udef22.0%
Simplified22.0%
add-sqr-sqrt6.0%
sqrt-div5.9%
fma-udef5.9%
+-commutative5.9%
pow25.9%
hypot-udef5.9%
sqrt-div5.9%
fma-udef5.9%
+-commutative5.9%
pow25.9%
hypot-udef19.2%
times-frac5.9%
add-sqr-sqrt22.0%
*-un-lft-identity22.0%
times-frac55.0%
Applied egg-rr55.0%
Final simplification86.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -5.6e+51)
(/ x.im (* (hypot y.re y.im) (/ (hypot y.re y.im) y.re)))
(if (<= y.re -7.2e-133)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 5000.0)
(- (/ x.im (/ (pow y.im 2.0) y.re)) (/ x.re y.im))
(- (/ x.im y.re) (* y.im (/ x.re (pow y.re 2.0))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -5.6e+51) {
tmp = x_46_im / (hypot(y_46_re, y_46_im) * (hypot(y_46_re, y_46_im) / y_46_re));
} else if (y_46_re <= -7.2e-133) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 5000.0) {
tmp = (x_46_im / (pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im);
} else {
tmp = (x_46_im / y_46_re) - (y_46_im * (x_46_re / pow(y_46_re, 2.0)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -5.6e+51) {
tmp = x_46_im / (Math.hypot(y_46_re, y_46_im) * (Math.hypot(y_46_re, y_46_im) / y_46_re));
} else if (y_46_re <= -7.2e-133) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 5000.0) {
tmp = (x_46_im / (Math.pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im);
} else {
tmp = (x_46_im / y_46_re) - (y_46_im * (x_46_re / Math.pow(y_46_re, 2.0)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -5.6e+51: tmp = x_46_im / (math.hypot(y_46_re, y_46_im) * (math.hypot(y_46_re, y_46_im) / y_46_re)) elif y_46_re <= -7.2e-133: tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_re <= 5000.0: tmp = (x_46_im / (math.pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im) else: tmp = (x_46_im / y_46_re) - (y_46_im * (x_46_re / math.pow(y_46_re, 2.0))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -5.6e+51) tmp = Float64(x_46_im / Float64(hypot(y_46_re, y_46_im) * Float64(hypot(y_46_re, y_46_im) / y_46_re))); elseif (y_46_re <= -7.2e-133) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_re <= 5000.0) tmp = Float64(Float64(x_46_im / Float64((y_46_im ^ 2.0) / y_46_re)) - Float64(x_46_re / y_46_im)); else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(x_46_re / (y_46_re ^ 2.0)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -5.6e+51) tmp = x_46_im / (hypot(y_46_re, y_46_im) * (hypot(y_46_re, y_46_im) / y_46_re)); elseif (y_46_re <= -7.2e-133) tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_re <= 5000.0) tmp = (x_46_im / ((y_46_im ^ 2.0) / y_46_re)) - (x_46_re / y_46_im); else tmp = (x_46_im / y_46_re) - (y_46_im * (x_46_re / (y_46_re ^ 2.0))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -5.6e+51], N[(x$46$im / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] * N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -7.2e-133], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5000.0], N[(N[(x$46$im / N[(N[Power[y$46$im, 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(x$46$re / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -5.6 \cdot 10^{+51}:\\
\;\;\;\;\frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}}\\
\mathbf{elif}\;y.re \leq -7.2 \cdot 10^{-133}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 5000:\\
\;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\
\end{array}
\end{array}
if y.re < -5.60000000000000009e51Initial program 39.1%
Taylor expanded in x.im around inf 37.8%
associate-/l*46.1%
unpow246.1%
fma-udef46.1%
Simplified46.1%
add-sqr-sqrt0.0%
sqrt-div0.0%
fma-udef0.0%
+-commutative0.0%
pow20.0%
hypot-udef0.0%
sqrt-div0.0%
fma-udef0.0%
+-commutative0.0%
pow20.0%
hypot-udef0.0%
times-frac0.0%
add-sqr-sqrt46.1%
*-un-lft-identity46.1%
times-frac79.5%
Applied egg-rr79.5%
if -5.60000000000000009e51 < y.re < -7.2000000000000008e-133Initial program 74.5%
if -7.2000000000000008e-133 < y.re < 5e3Initial program 71.0%
Taylor expanded in y.re around 0 81.0%
+-commutative81.0%
mul-1-neg81.0%
unsub-neg81.0%
associate-/l*81.0%
Simplified81.0%
if 5e3 < y.re Initial program 56.4%
Taylor expanded in y.re around inf 79.5%
+-commutative79.5%
mul-1-neg79.5%
unsub-neg79.5%
associate-/l*75.5%
associate-/r/79.5%
Simplified79.5%
Final simplification79.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (- (/ x.im y.re) (* y.im (/ x.re (pow y.re 2.0))))))
(if (<= y.re -1.2e+48)
t_1
(if (<= y.re -1.2e-132)
t_0
(if (<= y.re 1.75e-224)
(/ (- x.re) y.im)
(if (<= y.re 1.7e+72) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / pow(y_46_re, 2.0)));
double tmp;
if (y_46_re <= -1.2e+48) {
tmp = t_1;
} else if (y_46_re <= -1.2e-132) {
tmp = t_0;
} else if (y_46_re <= 1.75e-224) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 1.7e+72) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im / y_46re) - (y_46im * (x_46re / (y_46re ** 2.0d0)))
if (y_46re <= (-1.2d+48)) then
tmp = t_1
else if (y_46re <= (-1.2d-132)) then
tmp = t_0
else if (y_46re <= 1.75d-224) then
tmp = -x_46re / y_46im
else if (y_46re <= 1.7d+72) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / Math.pow(y_46_re, 2.0)));
double tmp;
if (y_46_re <= -1.2e+48) {
tmp = t_1;
} else if (y_46_re <= -1.2e-132) {
tmp = t_0;
} else if (y_46_re <= 1.75e-224) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 1.7e+72) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / math.pow(y_46_re, 2.0))) tmp = 0 if y_46_re <= -1.2e+48: tmp = t_1 elif y_46_re <= -1.2e-132: tmp = t_0 elif y_46_re <= 1.75e-224: tmp = -x_46_re / y_46_im elif y_46_re <= 1.7e+72: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(x_46_re / (y_46_re ^ 2.0)))) tmp = 0.0 if (y_46_re <= -1.2e+48) tmp = t_1; elseif (y_46_re <= -1.2e-132) tmp = t_0; elseif (y_46_re <= 1.75e-224) tmp = Float64(Float64(-x_46_re) / y_46_im); elseif (y_46_re <= 1.7e+72) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / (y_46_re ^ 2.0))); tmp = 0.0; if (y_46_re <= -1.2e+48) tmp = t_1; elseif (y_46_re <= -1.2e-132) tmp = t_0; elseif (y_46_re <= 1.75e-224) tmp = -x_46_re / y_46_im; elseif (y_46_re <= 1.7e+72) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(x$46$re / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.2e+48], t$95$1, If[LessEqual[y$46$re, -1.2e-132], t$95$0, If[LessEqual[y$46$re, 1.75e-224], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.7e+72], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\
\mathbf{if}\;y.re \leq -1.2 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -1.2 \cdot 10^{-132}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.75 \cdot 10^{-224}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.7 \cdot 10^{+72}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.2000000000000001e48 or 1.6999999999999999e72 < y.re Initial program 42.0%
Taylor expanded in y.re around inf 75.9%
+-commutative75.9%
mul-1-neg75.9%
unsub-neg75.9%
associate-/l*77.1%
associate-/r/78.0%
Simplified78.0%
if -1.2000000000000001e48 < y.re < -1.20000000000000008e-132 or 1.75000000000000009e-224 < y.re < 1.6999999999999999e72Initial program 77.2%
if -1.20000000000000008e-132 < y.re < 1.75000000000000009e-224Initial program 65.5%
Taylor expanded in y.re around 0 79.3%
associate-*r/79.3%
neg-mul-179.3%
Simplified79.3%
Final simplification78.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -3.6e+130)
(/ x.re (hypot y.re y.im))
(if (<= y.im -9e-245)
t_0
(if (<= y.im 4.5e-26)
(/ x.im y.re)
(if (<= y.im 3.45e+146) t_0 (/ x.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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -3.6e+130) {
tmp = x_46_re / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -9e-245) {
tmp = t_0;
} else if (y_46_im <= 4.5e-26) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 3.45e+146) {
tmp = t_0;
} else {
tmp = x_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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -3.6e+130) {
tmp = x_46_re / Math.hypot(y_46_re, y_46_im);
} else if (y_46_im <= -9e-245) {
tmp = t_0;
} else if (y_46_im <= 4.5e-26) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 3.45e+146) {
tmp = t_0;
} else {
tmp = x_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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -3.6e+130: tmp = x_46_re / math.hypot(y_46_re, y_46_im) elif y_46_im <= -9e-245: tmp = t_0 elif y_46_im <= 4.5e-26: tmp = x_46_im / y_46_re elif y_46_im <= 3.45e+146: tmp = t_0 else: tmp = x_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(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -3.6e+130) tmp = Float64(x_46_re / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -9e-245) tmp = t_0; elseif (y_46_im <= 4.5e-26) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 3.45e+146) tmp = t_0; else tmp = Float64(x_46_re / Float64(-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_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -3.6e+130) tmp = x_46_re / hypot(y_46_re, y_46_im); elseif (y_46_im <= -9e-245) tmp = t_0; elseif (y_46_im <= 4.5e-26) tmp = x_46_im / y_46_re; elseif (y_46_im <= 3.45e+146) tmp = t_0; else tmp = x_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[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.6e+130], N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -9e-245], t$95$0, If[LessEqual[y$46$im, 4.5e-26], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 3.45e+146], t$95$0, N[(x$46$re / (-N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -3.6 \cdot 10^{+130}:\\
\;\;\;\;\frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -9 \cdot 10^{-245}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 3.45 \cdot 10^{+146}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -3.6000000000000001e130Initial program 32.7%
Taylor expanded in x.im around 0 28.5%
associate-*r*28.5%
neg-mul-128.5%
*-commutative28.5%
Simplified28.5%
fma-def28.5%
add-sqr-sqrt28.5%
fma-def28.5%
hypot-udef28.5%
fma-def28.5%
hypot-udef28.5%
times-frac82.0%
add-sqr-sqrt31.2%
sqrt-unprod38.0%
sqr-neg38.0%
sqrt-unprod11.3%
add-sqr-sqrt22.0%
Applied egg-rr22.0%
clear-num22.0%
frac-2neg22.0%
frac-times22.0%
*-un-lft-identity22.0%
add-sqr-sqrt10.7%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod48.0%
add-sqr-sqrt79.7%
Applied egg-rr79.7%
Taylor expanded in y.im around -inf 77.6%
if -3.6000000000000001e130 < y.im < -8.99999999999999937e-245 or 4.4999999999999999e-26 < y.im < 3.44999999999999978e146Initial program 78.7%
if -8.99999999999999937e-245 < y.im < 4.4999999999999999e-26Initial program 69.5%
Taylor expanded in y.re around inf 81.1%
if 3.44999999999999978e146 < y.im Initial program 13.5%
Taylor expanded in x.im around 0 14.8%
associate-*r*14.8%
neg-mul-114.8%
*-commutative14.8%
Simplified14.8%
fma-def14.8%
add-sqr-sqrt14.8%
fma-def14.8%
hypot-udef14.8%
fma-def14.8%
hypot-udef14.8%
times-frac68.5%
add-sqr-sqrt30.9%
sqrt-unprod34.0%
sqr-neg34.0%
sqrt-unprod9.6%
add-sqr-sqrt15.1%
Applied egg-rr15.1%
clear-num15.1%
frac-2neg15.1%
frac-times15.1%
*-un-lft-identity15.1%
add-sqr-sqrt5.5%
sqrt-unprod30.0%
sqr-neg30.0%
sqrt-unprod37.4%
add-sqr-sqrt68.5%
Applied egg-rr68.5%
Taylor expanded in y.re around 0 65.6%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (/ x.im y.re) (* y.im (/ x.re (pow y.re 2.0))))))
(if (<= y.re -6.5e+51)
t_0
(if (<= y.re -1.1e-132)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 0.0058)
(- (/ x.im (/ (pow y.im 2.0) y.re)) (/ x.re y.im))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / pow(y_46_re, 2.0)));
double tmp;
if (y_46_re <= -6.5e+51) {
tmp = t_0;
} else if (y_46_re <= -1.1e-132) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 0.0058) {
tmp = (x_46_im / (pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (x_46im / y_46re) - (y_46im * (x_46re / (y_46re ** 2.0d0)))
if (y_46re <= (-6.5d+51)) then
tmp = t_0
else if (y_46re <= (-1.1d-132)) then
tmp = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46re <= 0.0058d0) then
tmp = (x_46im / ((y_46im ** 2.0d0) / y_46re)) - (x_46re / y_46im)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / Math.pow(y_46_re, 2.0)));
double tmp;
if (y_46_re <= -6.5e+51) {
tmp = t_0;
} else if (y_46_re <= -1.1e-132) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 0.0058) {
tmp = (x_46_im / (Math.pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im);
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / math.pow(y_46_re, 2.0))) tmp = 0 if y_46_re <= -6.5e+51: tmp = t_0 elif y_46_re <= -1.1e-132: tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_re <= 0.0058: tmp = (x_46_im / (math.pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(x_46_re / (y_46_re ^ 2.0)))) tmp = 0.0 if (y_46_re <= -6.5e+51) tmp = t_0; elseif (y_46_re <= -1.1e-132) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_re <= 0.0058) tmp = Float64(Float64(x_46_im / Float64((y_46_im ^ 2.0) / y_46_re)) - Float64(x_46_re / y_46_im)); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / (y_46_re ^ 2.0))); tmp = 0.0; if (y_46_re <= -6.5e+51) tmp = t_0; elseif (y_46_re <= -1.1e-132) tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_re <= 0.0058) tmp = (x_46_im / ((y_46_im ^ 2.0) / y_46_re)) - (x_46_re / y_46_im); else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(x$46$re / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -6.5e+51], t$95$0, If[LessEqual[y$46$re, -1.1e-132], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 0.0058], N[(N[(x$46$im / N[(N[Power[y$46$im, 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\
\mathbf{if}\;y.re \leq -6.5 \cdot 10^{+51}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -1.1 \cdot 10^{-132}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 0.0058:\\
\;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -6.5e51 or 0.0058 < y.re Initial program 46.3%
Taylor expanded in y.re around inf 76.3%
+-commutative76.3%
mul-1-neg76.3%
unsub-neg76.3%
associate-/l*76.5%
associate-/r/78.2%
Simplified78.2%
if -6.5e51 < y.re < -1.09999999999999995e-132Initial program 74.5%
if -1.09999999999999995e-132 < y.re < 0.0058Initial program 71.0%
Taylor expanded in y.re around 0 81.0%
+-commutative81.0%
mul-1-neg81.0%
unsub-neg81.0%
associate-/l*81.0%
Simplified81.0%
Final simplification78.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -5.5e+130)
(/ x.re (hypot y.re y.im))
(if (<= y.im -2.2e-243)
t_0
(if (<= y.im 4.5e-26)
(/ x.im y.re)
(if (<= y.im 5.3e+150) t_0 (/ (- x.re) y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -5.5e+130) {
tmp = x_46_re / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -2.2e-243) {
tmp = t_0;
} else if (y_46_im <= 4.5e-26) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 5.3e+150) {
tmp = t_0;
} else {
tmp = -x_46_re / y_46_im;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -5.5e+130) {
tmp = x_46_re / Math.hypot(y_46_re, y_46_im);
} else if (y_46_im <= -2.2e-243) {
tmp = t_0;
} else if (y_46_im <= 4.5e-26) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 5.3e+150) {
tmp = t_0;
} else {
tmp = -x_46_re / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -5.5e+130: tmp = x_46_re / math.hypot(y_46_re, y_46_im) elif y_46_im <= -2.2e-243: tmp = t_0 elif y_46_im <= 4.5e-26: tmp = x_46_im / y_46_re elif y_46_im <= 5.3e+150: tmp = t_0 else: tmp = -x_46_re / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -5.5e+130) tmp = Float64(x_46_re / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -2.2e-243) tmp = t_0; elseif (y_46_im <= 4.5e-26) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 5.3e+150) tmp = t_0; else tmp = Float64(Float64(-x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -5.5e+130) tmp = x_46_re / hypot(y_46_re, y_46_im); elseif (y_46_im <= -2.2e-243) tmp = t_0; elseif (y_46_im <= 4.5e-26) tmp = x_46_im / y_46_re; elseif (y_46_im <= 5.3e+150) tmp = t_0; else tmp = -x_46_re / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -5.5e+130], N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -2.2e-243], t$95$0, If[LessEqual[y$46$im, 4.5e-26], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5.3e+150], t$95$0, N[((-x$46$re) / y$46$im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -5.5 \cdot 10^{+130}:\\
\;\;\;\;\frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -2.2 \cdot 10^{-243}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 5.3 \cdot 10^{+150}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -5.4999999999999997e130Initial program 32.7%
Taylor expanded in x.im around 0 28.5%
associate-*r*28.5%
neg-mul-128.5%
*-commutative28.5%
Simplified28.5%
fma-def28.5%
add-sqr-sqrt28.5%
fma-def28.5%
hypot-udef28.5%
fma-def28.5%
hypot-udef28.5%
times-frac82.0%
add-sqr-sqrt31.2%
sqrt-unprod38.0%
sqr-neg38.0%
sqrt-unprod11.3%
add-sqr-sqrt22.0%
Applied egg-rr22.0%
clear-num22.0%
frac-2neg22.0%
frac-times22.0%
*-un-lft-identity22.0%
add-sqr-sqrt10.7%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod48.0%
add-sqr-sqrt79.7%
Applied egg-rr79.7%
Taylor expanded in y.im around -inf 77.6%
if -5.4999999999999997e130 < y.im < -2.1999999999999999e-243 or 4.4999999999999999e-26 < y.im < 5.30000000000000013e150Initial program 78.7%
if -2.1999999999999999e-243 < y.im < 4.4999999999999999e-26Initial program 69.5%
Taylor expanded in y.re around inf 81.1%
if 5.30000000000000013e150 < y.im Initial program 13.5%
Taylor expanded in y.re around 0 65.5%
associate-*r/65.5%
neg-mul-165.5%
Simplified65.5%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im))
(t_1
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -3.9e+130)
t_0
(if (<= y.im -6e-239)
t_1
(if (<= y.im 4.5e-26) (/ x.im y.re) (if (<= y.im 1e+150) t_1 t_0))))))
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;
double t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -3.9e+130) {
tmp = t_0;
} else if (y_46_im <= -6e-239) {
tmp = t_1;
} else if (y_46_im <= 4.5e-26) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 1e+150) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = -x_46re / y_46im
t_1 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46im <= (-3.9d+130)) then
tmp = t_0
else if (y_46im <= (-6d-239)) then
tmp = t_1
else if (y_46im <= 4.5d-26) then
tmp = x_46im / y_46re
else if (y_46im <= 1d+150) then
tmp = t_1
else
tmp = t_0
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_re / y_46_im;
double t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -3.9e+130) {
tmp = t_0;
} else if (y_46_im <= -6e-239) {
tmp = t_1;
} else if (y_46_im <= 4.5e-26) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 1e+150) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = -x_46_re / y_46_im t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -3.9e+130: tmp = t_0 elif y_46_im <= -6e-239: tmp = t_1 elif y_46_im <= 4.5e-26: tmp = x_46_im / y_46_re elif y_46_im <= 1e+150: tmp = t_1 else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(-x_46_re) / y_46_im) t_1 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -3.9e+130) tmp = t_0; elseif (y_46_im <= -6e-239) tmp = t_1; elseif (y_46_im <= 4.5e-26) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 1e+150) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = -x_46_re / y_46_im; t_1 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -3.9e+130) tmp = t_0; elseif (y_46_im <= -6e-239) tmp = t_1; elseif (y_46_im <= 4.5e-26) tmp = x_46_im / y_46_re; elseif (y_46_im <= 1e+150) tmp = t_1; else tmp = t_0; 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$re) / y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.9e+130], t$95$0, If[LessEqual[y$46$im, -6e-239], t$95$1, If[LessEqual[y$46$im, 4.5e-26], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1e+150], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x.re}{y.im}\\
t_1 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -3.9 \cdot 10^{+130}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -6 \cdot 10^{-239}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 10^{+150}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -3.9000000000000002e130 or 9.99999999999999981e149 < y.im Initial program 24.7%
Taylor expanded in y.re around 0 72.5%
associate-*r/72.5%
neg-mul-172.5%
Simplified72.5%
if -3.9000000000000002e130 < y.im < -5.9999999999999996e-239 or 4.4999999999999999e-26 < y.im < 9.99999999999999981e149Initial program 78.7%
if -5.9999999999999996e-239 < y.im < 4.4999999999999999e-26Initial program 69.5%
Taylor expanded in y.re around inf 81.1%
Final simplification77.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.re -1.22e+48)
(/ x.im y.re)
(if (<= y.re 6.2e-29)
(/ (- x.re) y.im)
(if (<= y.re 2.05e+17)
(/ (* y.re x.im) t_0)
(if (<= y.re 1.5e+42) (/ (* y.im (- x.re)) t_0) (/ x.im y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_re <= -1.22e+48) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= 6.2e-29) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 2.05e+17) {
tmp = (y_46_re * x_46_im) / t_0;
} else if (y_46_re <= 1.5e+42) {
tmp = (y_46_im * -x_46_re) / t_0;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (y_46re * y_46re) + (y_46im * y_46im)
if (y_46re <= (-1.22d+48)) then
tmp = x_46im / y_46re
else if (y_46re <= 6.2d-29) then
tmp = -x_46re / y_46im
else if (y_46re <= 2.05d+17) then
tmp = (y_46re * x_46im) / t_0
else if (y_46re <= 1.5d+42) then
tmp = (y_46im * -x_46re) / t_0
else
tmp = x_46im / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_re <= -1.22e+48) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= 6.2e-29) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 2.05e+17) {
tmp = (y_46_re * x_46_im) / t_0;
} else if (y_46_re <= 1.5e+42) {
tmp = (y_46_im * -x_46_re) / t_0;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im) tmp = 0 if y_46_re <= -1.22e+48: tmp = x_46_im / y_46_re elif y_46_re <= 6.2e-29: tmp = -x_46_re / y_46_im elif y_46_re <= 2.05e+17: tmp = (y_46_re * x_46_im) / t_0 elif y_46_re <= 1.5e+42: tmp = (y_46_im * -x_46_re) / t_0 else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) tmp = 0.0 if (y_46_re <= -1.22e+48) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= 6.2e-29) tmp = Float64(Float64(-x_46_re) / y_46_im); elseif (y_46_re <= 2.05e+17) tmp = Float64(Float64(y_46_re * x_46_im) / t_0); elseif (y_46_re <= 1.5e+42) tmp = Float64(Float64(y_46_im * Float64(-x_46_re)) / t_0); else tmp = Float64(x_46_im / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im); tmp = 0.0; if (y_46_re <= -1.22e+48) tmp = x_46_im / y_46_re; elseif (y_46_re <= 6.2e-29) tmp = -x_46_re / y_46_im; elseif (y_46_re <= 2.05e+17) tmp = (y_46_re * x_46_im) / t_0; elseif (y_46_re <= 1.5e+42) tmp = (y_46_im * -x_46_re) / t_0; else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.22e+48], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 6.2e-29], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.05e+17], N[(N[(y$46$re * x$46$im), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$re, 1.5e+42], N[(N[(y$46$im * (-x$46$re)), $MachinePrecision] / t$95$0), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
\mathbf{if}\;y.re \leq -1.22 \cdot 10^{+48}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 2.05 \cdot 10^{+17}:\\
\;\;\;\;\frac{y.re \cdot x.im}{t\_0}\\
\mathbf{elif}\;y.re \leq 1.5 \cdot 10^{+42}:\\
\;\;\;\;\frac{y.im \cdot \left(-x.re\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -1.22000000000000004e48 or 1.50000000000000014e42 < y.re Initial program 42.8%
Taylor expanded in y.re around inf 74.2%
if -1.22000000000000004e48 < y.re < 6.20000000000000052e-29Initial program 71.1%
Taylor expanded in y.re around 0 65.4%
associate-*r/65.4%
neg-mul-165.4%
Simplified65.4%
if 6.20000000000000052e-29 < y.re < 2.05e17Initial program 99.5%
Taylor expanded in x.im around inf 99.5%
*-commutative99.5%
Simplified99.5%
if 2.05e17 < y.re < 1.50000000000000014e42Initial program 99.5%
Taylor expanded in x.im around 0 88.5%
associate-*r*88.5%
neg-mul-188.5%
*-commutative88.5%
Simplified88.5%
Final simplification70.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -9.2e+49)
(/ x.im y.re)
(if (<= y.re 5.2e-26)
(/ (- x.re) y.im)
(if (<= y.re 1.05e+71)
(/ (* y.re x.im) (+ (* y.re y.re) (* y.im y.im)))
(/ x.im y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -9.2e+49) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= 5.2e-26) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 1.05e+71) {
tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46re <= (-9.2d+49)) then
tmp = x_46im / y_46re
else if (y_46re <= 5.2d-26) then
tmp = -x_46re / y_46im
else if (y_46re <= 1.05d+71) then
tmp = (y_46re * x_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
else
tmp = x_46im / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -9.2e+49) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= 5.2e-26) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 1.05e+71) {
tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -9.2e+49: tmp = x_46_im / y_46_re elif y_46_re <= 5.2e-26: tmp = -x_46_re / y_46_im elif y_46_re <= 1.05e+71: tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -9.2e+49) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= 5.2e-26) tmp = Float64(Float64(-x_46_re) / y_46_im); elseif (y_46_re <= 1.05e+71) tmp = Float64(Float64(y_46_re * x_46_im) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = Float64(x_46_im / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -9.2e+49) tmp = x_46_im / y_46_re; elseif (y_46_re <= 5.2e-26) tmp = -x_46_re / y_46_im; elseif (y_46_re <= 1.05e+71) tmp = (y_46_re * x_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -9.2e+49], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 5.2e-26], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.05e+71], N[(N[(y$46$re * x$46$im), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -9.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{-26}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.05 \cdot 10^{+71}:\\
\;\;\;\;\frac{y.re \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -9.20000000000000008e49 or 1.04999999999999995e71 < y.re Initial program 42.0%
Taylor expanded in y.re around inf 74.3%
if -9.20000000000000008e49 < y.re < 5.2000000000000002e-26Initial program 71.1%
Taylor expanded in y.re around 0 65.4%
associate-*r/65.4%
neg-mul-165.4%
Simplified65.4%
if 5.2000000000000002e-26 < y.re < 1.04999999999999995e71Initial program 93.3%
Taylor expanded in x.im around inf 60.8%
*-commutative60.8%
Simplified60.8%
Final simplification68.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -6.5e+44) (not (<= y.re 1.4e-26))) (/ x.im y.re) (/ (- x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -6.5e+44) || !(y_46_re <= 1.4e-26)) {
tmp = x_46_im / y_46_re;
} else {
tmp = -x_46_re / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-6.5d+44)) .or. (.not. (y_46re <= 1.4d-26))) then
tmp = x_46im / y_46re
else
tmp = -x_46re / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -6.5e+44) || !(y_46_re <= 1.4e-26)) {
tmp = x_46_im / y_46_re;
} else {
tmp = -x_46_re / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -6.5e+44) or not (y_46_re <= 1.4e-26): tmp = x_46_im / y_46_re else: tmp = -x_46_re / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -6.5e+44) || !(y_46_re <= 1.4e-26)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(-x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -6.5e+44) || ~((y_46_re <= 1.4e-26))) tmp = x_46_im / y_46_re; else tmp = -x_46_re / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -6.5e+44], N[Not[LessEqual[y$46$re, 1.4e-26]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[((-x$46$re) / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -6.5 \cdot 10^{+44} \lor \neg \left(y.re \leq 1.4 \cdot 10^{-26}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -6.50000000000000018e44 or 1.4000000000000001e-26 < y.re Initial program 48.6%
Taylor expanded in y.re around inf 68.5%
if -6.50000000000000018e44 < y.re < 1.4000000000000001e-26Initial program 71.1%
Taylor expanded in y.re around 0 65.4%
associate-*r/65.4%
neg-mul-165.4%
Simplified65.4%
Final simplification66.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46re
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.re}
\end{array}
Initial program 60.8%
Taylor expanded in y.re around inf 43.7%
Final simplification43.7%
herbie shell --seed 2024027
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
:precision binary64
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))