
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
1e+299)
(/ (/ (fma x.im y.im (* x.re y.re)) (hypot y.re y.im)) (hypot y.re y.im))
(+ (/ x.re y.re) (/ (* y.im (/ 1.0 y.re)) (/ y.re x.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+299) {
tmp = (fma(x_46_im, y_46_im, (x_46_re * y_46_re)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
} else {
tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (Float64(Float64(Float64(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))) <= 1e+299) tmp = Float64(Float64(fma(x_46_im, y_46_im, Float64(x_46_re * y_46_re)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)); else tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im * Float64(1.0 / y_46_re)) / Float64(y_46_re / x_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[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], 1e+299], N[(N[(N[(x$46$im * y$46$im + N[(x$46$re * y$46$re), $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$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leq 10^{+299}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.im, y.im, x.re \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{y.im \cdot \frac{1}{y.re}}{\frac{y.re}{x.im}}\\
\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))) < 1.0000000000000001e299Initial program 76.4%
add-sqr-sqrt76.4%
*-un-lft-identity76.4%
times-frac76.4%
hypot-def76.4%
fma-def76.4%
hypot-def95.2%
Applied egg-rr95.2%
fma-def95.2%
*-commutative95.2%
associate-*l/95.2%
div-inv95.3%
+-commutative95.3%
fma-def95.3%
Applied egg-rr95.3%
if 1.0000000000000001e299 < (/.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 13.1%
Taylor expanded in y.re around inf 49.4%
+-commutative49.4%
associate-/l*53.4%
associate-/r/51.9%
fma-def51.9%
Simplified51.9%
fma-udef51.9%
+-commutative51.9%
pow251.9%
div-inv51.9%
associate-*l*53.4%
pow253.4%
pow-flip53.4%
metadata-eval53.4%
Applied egg-rr53.4%
associate-*r*51.9%
*-commutative51.9%
metadata-eval51.9%
pow-div51.9%
inv-pow51.9%
pow151.9%
associate-/r/55.0%
associate-*l/61.0%
Applied egg-rr61.0%
Final simplification86.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re y.re) (* x.im y.im))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 1e+299)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(+ (/ x.re y.re) (/ (* y.im (/ 1.0 y.re)) (/ y.re x.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_re) + (x_46_im * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+299) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_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 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+299) {
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_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+299: 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_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)) 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_re) + Float64(x_46_im * y_46_im)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 1e+299) 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(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im * Float64(1.0 / y_46_re)) / Float64(y_46_re / x_46_im))); 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_re) + (x_46_im * y_46_im); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+299) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im)); else tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_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[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $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], 1e+299], 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[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot y.re + x.im \cdot y.im\\
\mathbf{if}\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 10^{+299}:\\
\;\;\;\;\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.re}{y.re} + \frac{y.im \cdot \frac{1}{y.re}}{\frac{y.re}{x.im}}\\
\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))) < 1.0000000000000001e299Initial program 76.4%
add-sqr-sqrt76.4%
*-un-lft-identity76.4%
times-frac76.4%
hypot-def76.4%
fma-def76.4%
hypot-def95.2%
Applied egg-rr95.2%
fma-def95.2%
Applied egg-rr95.2%
if 1.0000000000000001e299 < (/.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 13.1%
Taylor expanded in y.re around inf 49.4%
+-commutative49.4%
associate-/l*53.4%
associate-/r/51.9%
fma-def51.9%
Simplified51.9%
fma-udef51.9%
+-commutative51.9%
pow251.9%
div-inv51.9%
associate-*l*53.4%
pow253.4%
pow-flip53.4%
metadata-eval53.4%
Applied egg-rr53.4%
associate-*r*51.9%
*-commutative51.9%
metadata-eval51.9%
pow-div51.9%
inv-pow51.9%
pow151.9%
associate-/r/55.0%
associate-*l/61.0%
Applied egg-rr61.0%
Final simplification86.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re y.re) (* x.im y.im))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 1e+299)
(/ (* t_0 (/ 1.0 (hypot y.re y.im))) (hypot y.re y.im))
(+ (/ x.re y.re) (/ (* y.im (/ 1.0 y.re)) (/ y.re x.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_re) + (x_46_im * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+299) {
tmp = (t_0 * (1.0 / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im);
} else {
tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_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 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+299) {
tmp = (t_0 * (1.0 / Math.hypot(y_46_re, y_46_im))) / Math.hypot(y_46_re, y_46_im);
} else {
tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+299: tmp = (t_0 * (1.0 / math.hypot(y_46_re, y_46_im))) / math.hypot(y_46_re, y_46_im) else: tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)) 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_re) + Float64(x_46_im * y_46_im)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 1e+299) tmp = Float64(Float64(t_0 * Float64(1.0 / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im)); else tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im * Float64(1.0 / y_46_re)) / Float64(y_46_re / x_46_im))); 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_re) + (x_46_im * y_46_im); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+299) tmp = (t_0 * (1.0 / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im); else tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_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[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $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], 1e+299], N[(N[(t$95$0 * N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot y.re + x.im \cdot y.im\\
\mathbf{if}\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 10^{+299}:\\
\;\;\;\;\frac{t_0 \cdot \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{y.im \cdot \frac{1}{y.re}}{\frac{y.re}{x.im}}\\
\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))) < 1.0000000000000001e299Initial program 76.4%
add-sqr-sqrt76.4%
*-un-lft-identity76.4%
times-frac76.4%
hypot-def76.4%
fma-def76.4%
hypot-def95.2%
Applied egg-rr95.2%
fma-def95.2%
*-commutative95.2%
associate-*l/95.2%
div-inv95.3%
+-commutative95.3%
fma-def95.3%
Applied egg-rr95.3%
div-inv95.2%
fma-udef95.2%
+-commutative95.2%
fma-def95.2%
Applied egg-rr95.2%
fma-def95.2%
Applied egg-rr95.2%
if 1.0000000000000001e299 < (/.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 13.1%
Taylor expanded in y.re around inf 49.4%
+-commutative49.4%
associate-/l*53.4%
associate-/r/51.9%
fma-def51.9%
Simplified51.9%
fma-udef51.9%
+-commutative51.9%
pow251.9%
div-inv51.9%
associate-*l*53.4%
pow253.4%
pow-flip53.4%
metadata-eval53.4%
Applied egg-rr53.4%
associate-*r*51.9%
*-commutative51.9%
metadata-eval51.9%
pow-div51.9%
inv-pow51.9%
pow151.9%
associate-/r/55.0%
associate-*l/61.0%
Applied egg-rr61.0%
Final simplification86.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -3.3e+127)
(/ (- x.im) (hypot y.re y.im))
(if (<= y.im -1.3e+77)
(+ (/ x.re y.re) (/ (* y.im (/ 1.0 y.re)) (/ y.re x.im)))
(if (<= y.im -2.65e-129)
(/ (fma x.re y.re (* x.im y.im)) (fma y.re y.re (* y.im y.im)))
(if (<= y.im 8e+50)
(+ (/ x.re y.re) (* x.im (/ (* y.im (/ -1.0 y.re)) (- y.re))))
(/ (+ 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 tmp;
if (y_46_im <= -3.3e+127) {
tmp = -x_46_im / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -1.3e+77) {
tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
} else if (y_46_im <= -2.65e-129) {
tmp = fma(x_46_re, y_46_re, (x_46_im * y_46_im)) / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
} else if (y_46_im <= 8e+50) {
tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im * (-1.0 / y_46_re)) / -y_46_re));
} else {
tmp = (x_46_im + (x_46_re / (y_46_im / y_46_re))) / hypot(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.3e+127) tmp = Float64(Float64(-x_46_im) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -1.3e+77) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im * Float64(1.0 / y_46_re)) / Float64(y_46_re / x_46_im))); elseif (y_46_im <= -2.65e-129) tmp = Float64(fma(x_46_re, y_46_re, Float64(x_46_im * y_46_im)) / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im))); elseif (y_46_im <= 8e+50) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im * Float64(Float64(y_46_im * Float64(-1.0 / y_46_re)) / Float64(-y_46_re)))); 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
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -3.3e+127], N[((-x$46$im) / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.3e+77], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -2.65e-129], N[(N[(x$46$re * y$46$re + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8e+50], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im * N[(N[(y$46$im * N[(-1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / (-y$46$re)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;y.im \leq -3.3 \cdot 10^{+127}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -1.3 \cdot 10^{+77}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{y.im \cdot \frac{1}{y.re}}{\frac{y.re}{x.im}}\\
\mathbf{elif}\;y.im \leq -2.65 \cdot 10^{-129}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\
\mathbf{elif}\;y.im \leq 8 \cdot 10^{+50}:\\
\;\;\;\;\frac{x.re}{y.re} + x.im \cdot \frac{y.im \cdot \frac{-1}{y.re}}{-y.re}\\
\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 < -3.29999999999999977e127Initial program 45.1%
add-sqr-sqrt45.1%
*-un-lft-identity45.1%
times-frac45.1%
hypot-def45.1%
fma-def45.1%
hypot-def73.0%
Applied egg-rr73.0%
fma-def73.0%
*-commutative73.0%
associate-*l/73.1%
div-inv73.2%
+-commutative73.2%
fma-def73.2%
Applied egg-rr73.2%
Taylor expanded in y.im around -inf 83.9%
neg-mul-183.9%
Simplified83.9%
if -3.29999999999999977e127 < y.im < -1.3000000000000001e77Initial program 34.6%
Taylor expanded in y.re around inf 68.3%
+-commutative68.3%
associate-/l*79.4%
associate-/r/79.4%
fma-def79.4%
Simplified79.4%
fma-udef79.4%
+-commutative79.4%
pow279.4%
div-inv79.4%
associate-*l*79.4%
pow279.4%
pow-flip79.4%
metadata-eval79.4%
Applied egg-rr79.4%
associate-*r*79.4%
*-commutative79.4%
metadata-eval79.4%
pow-div79.4%
inv-pow79.4%
pow179.4%
associate-/r/79.4%
associate-*l/79.4%
Applied egg-rr79.4%
if -1.3000000000000001e77 < y.im < -2.64999999999999987e-129Initial program 92.5%
fma-def92.5%
fma-def92.5%
Simplified92.5%
if -2.64999999999999987e-129 < y.im < 8.0000000000000006e50Initial program 67.8%
Taylor expanded in y.re around inf 83.6%
+-commutative83.6%
associate-/l*84.6%
associate-/r/79.9%
fma-def79.9%
Simplified79.9%
fma-udef79.9%
+-commutative79.9%
pow279.9%
div-inv79.9%
associate-*l*84.6%
pow284.6%
pow-flip84.6%
metadata-eval84.6%
Applied egg-rr84.6%
associate-*r*79.9%
*-commutative79.9%
metadata-eval79.9%
pow-div79.9%
inv-pow79.9%
pow179.9%
associate-/r/80.9%
clear-num80.9%
clear-num80.9%
frac-2neg80.9%
associate-*l/88.5%
distribute-neg-frac88.5%
metadata-eval88.5%
distribute-neg-frac88.5%
Applied egg-rr88.5%
associate-/r/89.3%
*-commutative89.3%
Simplified89.3%
if 8.0000000000000006e50 < y.im Initial program 42.7%
add-sqr-sqrt42.7%
*-un-lft-identity42.7%
times-frac42.7%
hypot-def42.7%
fma-def42.7%
hypot-def58.1%
Applied egg-rr58.1%
fma-def58.1%
*-commutative58.1%
associate-*l/58.1%
div-inv58.1%
+-commutative58.1%
fma-def58.2%
Applied egg-rr58.2%
Taylor expanded in y.im around inf 69.3%
associate-/l*78.5%
Simplified78.5%
Final simplification85.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -6.4e+125)
(/ (- x.im) (hypot y.re y.im))
(if (<= y.im -4.8e+74)
(+ (/ x.re y.re) (/ (* y.im (/ 1.0 y.re)) (/ y.re x.im)))
(if (<= y.im -7e-128)
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 2.5e+49)
(+ (/ x.re y.re) (* x.im (/ (* y.im (/ -1.0 y.re)) (- y.re))))
(/ (+ 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 tmp;
if (y_46_im <= -6.4e+125) {
tmp = -x_46_im / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -4.8e+74) {
tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
} else if (y_46_im <= -7e-128) {
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));
} else if (y_46_im <= 2.5e+49) {
tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im * (-1.0 / y_46_re)) / -y_46_re));
} 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 tmp;
if (y_46_im <= -6.4e+125) {
tmp = -x_46_im / Math.hypot(y_46_re, y_46_im);
} else if (y_46_im <= -4.8e+74) {
tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
} else if (y_46_im <= -7e-128) {
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));
} else if (y_46_im <= 2.5e+49) {
tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im * (-1.0 / y_46_re)) / -y_46_re));
} 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): tmp = 0 if y_46_im <= -6.4e+125: tmp = -x_46_im / math.hypot(y_46_re, y_46_im) elif y_46_im <= -4.8e+74: tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)) elif y_46_im <= -7e-128: 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)) elif y_46_im <= 2.5e+49: tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im * (-1.0 / y_46_re)) / -y_46_re)) 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) tmp = 0.0 if (y_46_im <= -6.4e+125) tmp = Float64(Float64(-x_46_im) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -4.8e+74) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im * Float64(1.0 / y_46_re)) / Float64(y_46_re / x_46_im))); elseif (y_46_im <= -7e-128) tmp = 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))); elseif (y_46_im <= 2.5e+49) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im * Float64(Float64(y_46_im * Float64(-1.0 / y_46_re)) / Float64(-y_46_re)))); 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) tmp = 0.0; if (y_46_im <= -6.4e+125) tmp = -x_46_im / hypot(y_46_re, y_46_im); elseif (y_46_im <= -4.8e+74) tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)); elseif (y_46_im <= -7e-128) 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)); elseif (y_46_im <= 2.5e+49) tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im * (-1.0 / y_46_re)) / -y_46_re)); 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_] := If[LessEqual[y$46$im, -6.4e+125], N[((-x$46$im) / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -4.8e+74], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -7e-128], 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], If[LessEqual[y$46$im, 2.5e+49], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im * N[(N[(y$46$im * N[(-1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / (-y$46$re)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;y.im \leq -6.4 \cdot 10^{+125}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -4.8 \cdot 10^{+74}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{y.im \cdot \frac{1}{y.re}}{\frac{y.re}{x.im}}\\
\mathbf{elif}\;y.im \leq -7 \cdot 10^{-128}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 2.5 \cdot 10^{+49}:\\
\;\;\;\;\frac{x.re}{y.re} + x.im \cdot \frac{y.im \cdot \frac{-1}{y.re}}{-y.re}\\
\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 < -6.39999999999999967e125Initial program 45.1%
add-sqr-sqrt45.1%
*-un-lft-identity45.1%
times-frac45.1%
hypot-def45.1%
fma-def45.1%
hypot-def73.0%
Applied egg-rr73.0%
fma-def73.0%
*-commutative73.0%
associate-*l/73.1%
div-inv73.2%
+-commutative73.2%
fma-def73.2%
Applied egg-rr73.2%
Taylor expanded in y.im around -inf 83.9%
neg-mul-183.9%
Simplified83.9%
if -6.39999999999999967e125 < y.im < -4.80000000000000017e74Initial program 34.6%
Taylor expanded in y.re around inf 68.3%
+-commutative68.3%
associate-/l*79.4%
associate-/r/79.4%
fma-def79.4%
Simplified79.4%
fma-udef79.4%
+-commutative79.4%
pow279.4%
div-inv79.4%
associate-*l*79.4%
pow279.4%
pow-flip79.4%
metadata-eval79.4%
Applied egg-rr79.4%
associate-*r*79.4%
*-commutative79.4%
metadata-eval79.4%
pow-div79.4%
inv-pow79.4%
pow179.4%
associate-/r/79.4%
associate-*l/79.4%
Applied egg-rr79.4%
if -4.80000000000000017e74 < y.im < -6.99999999999999999e-128Initial program 92.5%
if -6.99999999999999999e-128 < y.im < 2.5000000000000002e49Initial program 67.8%
Taylor expanded in y.re around inf 83.6%
+-commutative83.6%
associate-/l*84.6%
associate-/r/79.9%
fma-def79.9%
Simplified79.9%
fma-udef79.9%
+-commutative79.9%
pow279.9%
div-inv79.9%
associate-*l*84.6%
pow284.6%
pow-flip84.6%
metadata-eval84.6%
Applied egg-rr84.6%
associate-*r*79.9%
*-commutative79.9%
metadata-eval79.9%
pow-div79.9%
inv-pow79.9%
pow179.9%
associate-/r/80.9%
clear-num80.9%
clear-num80.9%
frac-2neg80.9%
associate-*l/88.5%
distribute-neg-frac88.5%
metadata-eval88.5%
distribute-neg-frac88.5%
Applied egg-rr88.5%
associate-/r/89.3%
*-commutative89.3%
Simplified89.3%
if 2.5000000000000002e49 < y.im Initial program 42.7%
add-sqr-sqrt42.7%
*-un-lft-identity42.7%
times-frac42.7%
hypot-def42.7%
fma-def42.7%
hypot-def58.1%
Applied egg-rr58.1%
fma-def58.1%
*-commutative58.1%
associate-*l/58.1%
div-inv58.1%
+-commutative58.1%
fma-def58.2%
Applied egg-rr58.2%
Taylor expanded in y.im around inf 69.3%
associate-/l*78.5%
Simplified78.5%
Final simplification85.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (+ (/ x.re y.re) (/ (* y.im (/ 1.0 y.re)) (/ y.re x.im)))))
(if (<= y.re -9.6e+137)
t_1
(if (<= y.re -3.1e-112)
t_0
(if (<= y.re 5.8e-140)
(+ (/ x.im y.im) (* y.re (/ x.re (pow y.im 2.0))))
(if (<= y.re 1.65e+86) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
double tmp;
if (y_46_re <= -9.6e+137) {
tmp = t_1;
} else if (y_46_re <= -3.1e-112) {
tmp = t_0;
} else if (y_46_re <= 5.8e-140) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / pow(y_46_im, 2.0)));
} else if (y_46_re <= 1.65e+86) {
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 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46re / y_46re) + ((y_46im * (1.0d0 / y_46re)) / (y_46re / x_46im))
if (y_46re <= (-9.6d+137)) then
tmp = t_1
else if (y_46re <= (-3.1d-112)) then
tmp = t_0
else if (y_46re <= 5.8d-140) then
tmp = (x_46im / y_46im) + (y_46re * (x_46re / (y_46im ** 2.0d0)))
else if (y_46re <= 1.65d+86) 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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
double tmp;
if (y_46_re <= -9.6e+137) {
tmp = t_1;
} else if (y_46_re <= -3.1e-112) {
tmp = t_0;
} else if (y_46_re <= 5.8e-140) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / Math.pow(y_46_im, 2.0)));
} else if (y_46_re <= 1.65e+86) {
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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)) tmp = 0 if y_46_re <= -9.6e+137: tmp = t_1 elif y_46_re <= -3.1e-112: tmp = t_0 elif y_46_re <= 5.8e-140: tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / math.pow(y_46_im, 2.0))) elif y_46_re <= 1.65e+86: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_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))) t_1 = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im * Float64(1.0 / y_46_re)) / Float64(y_46_re / x_46_im))) tmp = 0.0 if (y_46_re <= -9.6e+137) tmp = t_1; elseif (y_46_re <= -3.1e-112) tmp = t_0; elseif (y_46_re <= 5.8e-140) 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_re <= 1.65e+86) 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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)); tmp = 0.0; if (y_46_re <= -9.6e+137) tmp = t_1; elseif (y_46_re <= -3.1e-112) tmp = t_0; elseif (y_46_re <= 5.8e-140) tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / (y_46_im ^ 2.0))); elseif (y_46_re <= 1.65e+86) 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[(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]}, Block[{t$95$1 = N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -9.6e+137], t$95$1, If[LessEqual[y$46$re, -3.1e-112], t$95$0, If[LessEqual[y$46$re, 5.8e-140], 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$re, 1.65e+86], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.re}{y.re} + \frac{y.im \cdot \frac{1}{y.re}}{\frac{y.re}{x.im}}\\
\mathbf{if}\;y.re \leq -9.6 \cdot 10^{+137}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq -3.1 \cdot 10^{-112}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 5.8 \cdot 10^{-140}:\\
\;\;\;\;\frac{x.im}{y.im} + y.re \cdot \frac{x.re}{{y.im}^{2}}\\
\mathbf{elif}\;y.re \leq 1.65 \cdot 10^{+86}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.re < -9.59999999999999932e137 or 1.65e86 < y.re Initial program 33.6%
Taylor expanded in y.re around inf 74.4%
+-commutative74.4%
associate-/l*75.0%
associate-/r/76.0%
fma-def76.0%
Simplified76.0%
fma-udef76.0%
+-commutative76.0%
pow276.0%
div-inv76.1%
associate-*l*75.0%
pow275.0%
pow-flip74.0%
metadata-eval74.0%
Applied egg-rr74.0%
associate-*r*76.1%
*-commutative76.1%
metadata-eval76.1%
pow-div76.0%
inv-pow76.0%
pow176.0%
associate-/r/79.2%
associate-*l/84.2%
Applied egg-rr84.2%
if -9.59999999999999932e137 < y.re < -3.0999999999999998e-112 or 5.79999999999999995e-140 < y.re < 1.65e86Initial program 84.0%
if -3.0999999999999998e-112 < y.re < 5.79999999999999995e-140Initial program 63.9%
Taylor expanded in y.re around 0 86.4%
associate-/l*88.0%
associate-/r/85.2%
Simplified85.2%
Final simplification84.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (+ (/ x.re y.re) (/ (* y.im (/ 1.0 y.re)) (/ y.re x.im)))))
(if (<= y.re -3.6e+133)
t_1
(if (<= y.re -1.01e-162)
t_0
(if (<= y.re 1.6e-207) (/ x.im y.im) (if (<= y.re 4.1e+86) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
double tmp;
if (y_46_re <= -3.6e+133) {
tmp = t_1;
} else if (y_46_re <= -1.01e-162) {
tmp = t_0;
} else if (y_46_re <= 1.6e-207) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 4.1e+86) {
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 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46re / y_46re) + ((y_46im * (1.0d0 / y_46re)) / (y_46re / x_46im))
if (y_46re <= (-3.6d+133)) then
tmp = t_1
else if (y_46re <= (-1.01d-162)) then
tmp = t_0
else if (y_46re <= 1.6d-207) then
tmp = x_46im / y_46im
else if (y_46re <= 4.1d+86) 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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
double tmp;
if (y_46_re <= -3.6e+133) {
tmp = t_1;
} else if (y_46_re <= -1.01e-162) {
tmp = t_0;
} else if (y_46_re <= 1.6e-207) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 4.1e+86) {
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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)) tmp = 0 if y_46_re <= -3.6e+133: tmp = t_1 elif y_46_re <= -1.01e-162: tmp = t_0 elif y_46_re <= 1.6e-207: tmp = x_46_im / y_46_im elif y_46_re <= 4.1e+86: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_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))) t_1 = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im * Float64(1.0 / y_46_re)) / Float64(y_46_re / x_46_im))) tmp = 0.0 if (y_46_re <= -3.6e+133) tmp = t_1; elseif (y_46_re <= -1.01e-162) tmp = t_0; elseif (y_46_re <= 1.6e-207) tmp = Float64(x_46_im / y_46_im); elseif (y_46_re <= 4.1e+86) 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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)); tmp = 0.0; if (y_46_re <= -3.6e+133) tmp = t_1; elseif (y_46_re <= -1.01e-162) tmp = t_0; elseif (y_46_re <= 1.6e-207) tmp = x_46_im / y_46_im; elseif (y_46_re <= 4.1e+86) 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[(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]}, Block[{t$95$1 = N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.6e+133], t$95$1, If[LessEqual[y$46$re, -1.01e-162], t$95$0, If[LessEqual[y$46$re, 1.6e-207], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 4.1e+86], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.re}{y.re} + \frac{y.im \cdot \frac{1}{y.re}}{\frac{y.re}{x.im}}\\
\mathbf{if}\;y.re \leq -3.6 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq -1.01 \cdot 10^{-162}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.6 \cdot 10^{-207}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.re \leq 4.1 \cdot 10^{+86}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.re < -3.59999999999999978e133 or 4.0999999999999999e86 < y.re Initial program 33.6%
Taylor expanded in y.re around inf 74.4%
+-commutative74.4%
associate-/l*75.0%
associate-/r/76.0%
fma-def76.0%
Simplified76.0%
fma-udef76.0%
+-commutative76.0%
pow276.0%
div-inv76.1%
associate-*l*75.0%
pow275.0%
pow-flip74.0%
metadata-eval74.0%
Applied egg-rr74.0%
associate-*r*76.1%
*-commutative76.1%
metadata-eval76.1%
pow-div76.0%
inv-pow76.0%
pow176.0%
associate-/r/79.2%
associate-*l/84.2%
Applied egg-rr84.2%
if -3.59999999999999978e133 < y.re < -1.01e-162 or 1.6000000000000002e-207 < y.re < 4.0999999999999999e86Initial program 82.0%
if -1.01e-162 < y.re < 1.6000000000000002e-207Initial program 62.0%
Taylor expanded in y.re around 0 84.3%
Final simplification83.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -2.1e+127)
(/ x.im y.im)
(if (<= y.im -6.8e+76)
(+ (/ x.re y.re) (/ (* y.im (/ 1.0 y.re)) (/ y.re x.im)))
(if (<= y.im -2.3e-23)
(/ (* x.im y.im) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 1.8e+65)
(+ (/ x.re y.re) (* x.im (/ (* y.im (/ -1.0 y.re)) (- y.re))))
(/ x.im 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 <= -2.1e+127) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -6.8e+76) {
tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
} else if (y_46_im <= -2.3e-23) {
tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 1.8e+65) {
tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im * (-1.0 / y_46_re)) / -y_46_re));
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46im <= (-2.1d+127)) then
tmp = x_46im / y_46im
else if (y_46im <= (-6.8d+76)) then
tmp = (x_46re / y_46re) + ((y_46im * (1.0d0 / y_46re)) / (y_46re / x_46im))
else if (y_46im <= (-2.3d-23)) then
tmp = (x_46im * y_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46im <= 1.8d+65) then
tmp = (x_46re / y_46re) + (x_46im * ((y_46im * ((-1.0d0) / y_46re)) / -y_46re))
else
tmp = x_46im / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -2.1e+127) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -6.8e+76) {
tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
} else if (y_46_im <= -2.3e-23) {
tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 1.8e+65) {
tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im * (-1.0 / y_46_re)) / -y_46_re));
} else {
tmp = x_46_im / 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 <= -2.1e+127: tmp = x_46_im / y_46_im elif y_46_im <= -6.8e+76: tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)) elif y_46_im <= -2.3e-23: tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_im <= 1.8e+65: tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im * (-1.0 / y_46_re)) / -y_46_re)) else: tmp = x_46_im / 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 <= -2.1e+127) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -6.8e+76) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im * Float64(1.0 / y_46_re)) / Float64(y_46_re / x_46_im))); elseif (y_46_im <= -2.3e-23) tmp = Float64(Float64(x_46_im * y_46_im) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 1.8e+65) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im * Float64(Float64(y_46_im * Float64(-1.0 / y_46_re)) / Float64(-y_46_re)))); else tmp = Float64(x_46_im / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -2.1e+127) tmp = x_46_im / y_46_im; elseif (y_46_im <= -6.8e+76) tmp = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)); elseif (y_46_im <= -2.3e-23) tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_im <= 1.8e+65) tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im * (-1.0 / y_46_re)) / -y_46_re)); else tmp = x_46_im / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -2.1e+127], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -6.8e+76], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -2.3e-23], N[(N[(x$46$im * y$46$im), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.8e+65], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im * N[(N[(y$46$im * N[(-1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / (-y$46$re)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.1 \cdot 10^{+127}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -6.8 \cdot 10^{+76}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{y.im \cdot \frac{1}{y.re}}{\frac{y.re}{x.im}}\\
\mathbf{elif}\;y.im \leq -2.3 \cdot 10^{-23}:\\
\;\;\;\;\frac{x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+65}:\\
\;\;\;\;\frac{x.re}{y.re} + x.im \cdot \frac{y.im \cdot \frac{-1}{y.re}}{-y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -2.09999999999999992e127 or 1.79999999999999989e65 < y.im Initial program 43.1%
Taylor expanded in y.re around 0 71.1%
if -2.09999999999999992e127 < y.im < -6.7999999999999994e76Initial program 34.6%
Taylor expanded in y.re around inf 68.3%
+-commutative68.3%
associate-/l*79.4%
associate-/r/79.4%
fma-def79.4%
Simplified79.4%
fma-udef79.4%
+-commutative79.4%
pow279.4%
div-inv79.4%
associate-*l*79.4%
pow279.4%
pow-flip79.4%
metadata-eval79.4%
Applied egg-rr79.4%
associate-*r*79.4%
*-commutative79.4%
metadata-eval79.4%
pow-div79.4%
inv-pow79.4%
pow179.4%
associate-/r/79.4%
associate-*l/79.4%
Applied egg-rr79.4%
if -6.7999999999999994e76 < y.im < -2.3000000000000001e-23Initial program 91.0%
Taylor expanded in x.re around 0 59.7%
if -2.3000000000000001e-23 < y.im < 1.79999999999999989e65Initial program 72.2%
Taylor expanded in y.re around inf 80.9%
+-commutative80.9%
associate-/l*81.7%
associate-/r/77.8%
fma-def77.8%
Simplified77.8%
fma-udef77.8%
+-commutative77.8%
pow277.8%
div-inv77.8%
associate-*l*81.7%
pow281.7%
pow-flip81.7%
metadata-eval81.7%
Applied egg-rr81.7%
associate-*r*77.8%
*-commutative77.8%
metadata-eval77.8%
pow-div77.8%
inv-pow77.8%
pow177.8%
associate-/r/78.6%
clear-num78.6%
clear-num78.6%
frac-2neg78.6%
associate-*l/85.0%
distribute-neg-frac85.0%
metadata-eval85.0%
distribute-neg-frac85.0%
Applied egg-rr85.0%
associate-/r/85.7%
*-commutative85.7%
Simplified85.7%
Final simplification77.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (/ x.re y.re) (/ (* y.im (/ 1.0 y.re)) (/ y.re x.im)))))
(if (<= y.im -6.4e+125)
(/ x.im y.im)
(if (<= y.im -4.8e+74)
t_0
(if (<= y.im -9e-23)
(/ (* x.im y.im) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 2.7e+65) t_0 (/ x.im y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
double tmp;
if (y_46_im <= -6.4e+125) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -4.8e+74) {
tmp = t_0;
} else if (y_46_im <= -9e-23) {
tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 2.7e+65) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (x_46re / y_46re) + ((y_46im * (1.0d0 / y_46re)) / (y_46re / x_46im))
if (y_46im <= (-6.4d+125)) then
tmp = x_46im / y_46im
else if (y_46im <= (-4.8d+74)) then
tmp = t_0
else if (y_46im <= (-9d-23)) then
tmp = (x_46im * y_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46im <= 2.7d+65) then
tmp = t_0
else
tmp = x_46im / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im));
double tmp;
if (y_46_im <= -6.4e+125) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -4.8e+74) {
tmp = t_0;
} else if (y_46_im <= -9e-23) {
tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 2.7e+65) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)) tmp = 0 if y_46_im <= -6.4e+125: tmp = x_46_im / y_46_im elif y_46_im <= -4.8e+74: tmp = t_0 elif y_46_im <= -9e-23: tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_im <= 2.7e+65: tmp = t_0 else: tmp = x_46_im / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im * Float64(1.0 / y_46_re)) / Float64(y_46_re / x_46_im))) tmp = 0.0 if (y_46_im <= -6.4e+125) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -4.8e+74) tmp = t_0; elseif (y_46_im <= -9e-23) tmp = Float64(Float64(x_46_im * y_46_im) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 2.7e+65) tmp = t_0; else tmp = Float64(x_46_im / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_re / y_46_re) + ((y_46_im * (1.0 / y_46_re)) / (y_46_re / x_46_im)); tmp = 0.0; if (y_46_im <= -6.4e+125) tmp = x_46_im / y_46_im; elseif (y_46_im <= -4.8e+74) tmp = t_0; elseif (y_46_im <= -9e-23) tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_im <= 2.7e+65) tmp = t_0; else tmp = x_46_im / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6.4e+125], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -4.8e+74], t$95$0, If[LessEqual[y$46$im, -9e-23], N[(N[(x$46$im * y$46$im), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.7e+65], t$95$0, N[(x$46$im / y$46$im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{y.re} + \frac{y.im \cdot \frac{1}{y.re}}{\frac{y.re}{x.im}}\\
\mathbf{if}\;y.im \leq -6.4 \cdot 10^{+125}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -4.8 \cdot 10^{+74}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -9 \cdot 10^{-23}:\\
\;\;\;\;\frac{x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{+65}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -6.39999999999999967e125 or 2.70000000000000019e65 < y.im Initial program 43.1%
Taylor expanded in y.re around 0 71.1%
if -6.39999999999999967e125 < y.im < -4.80000000000000017e74 or -8.9999999999999995e-23 < y.im < 2.70000000000000019e65Initial program 69.6%
Taylor expanded in y.re around inf 80.0%
+-commutative80.0%
associate-/l*81.6%
associate-/r/77.9%
fma-def77.9%
Simplified77.9%
fma-udef77.9%
+-commutative77.9%
pow277.9%
div-inv77.9%
associate-*l*81.6%
pow281.6%
pow-flip81.6%
metadata-eval81.6%
Applied egg-rr81.6%
associate-*r*77.9%
*-commutative77.9%
metadata-eval77.9%
pow-div77.9%
inv-pow77.9%
pow177.9%
associate-/r/78.7%
associate-*l/84.6%
Applied egg-rr84.6%
if -4.80000000000000017e74 < y.im < -8.9999999999999995e-23Initial program 91.0%
Taylor expanded in x.re around 0 59.7%
Final simplification77.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -6.4e+125)
(/ x.im y.im)
(if (<= y.im -9.8e+73)
(/ x.re y.re)
(if (<= y.im -3.5e-23)
(/ (* x.im y.im) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 1.85e+65) (/ x.re y.re) (/ x.im 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 <= -6.4e+125) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -9.8e+73) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= -3.5e-23) {
tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 1.85e+65) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46im <= (-6.4d+125)) then
tmp = x_46im / y_46im
else if (y_46im <= (-9.8d+73)) then
tmp = x_46re / y_46re
else if (y_46im <= (-3.5d-23)) then
tmp = (x_46im * y_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46im <= 1.85d+65) then
tmp = x_46re / y_46re
else
tmp = x_46im / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -6.4e+125) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -9.8e+73) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= -3.5e-23) {
tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 1.85e+65) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / 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 <= -6.4e+125: tmp = x_46_im / y_46_im elif y_46_im <= -9.8e+73: tmp = x_46_re / y_46_re elif y_46_im <= -3.5e-23: tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_im <= 1.85e+65: tmp = x_46_re / y_46_re else: tmp = x_46_im / 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 <= -6.4e+125) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -9.8e+73) tmp = Float64(x_46_re / y_46_re); elseif (y_46_im <= -3.5e-23) tmp = Float64(Float64(x_46_im * y_46_im) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 1.85e+65) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(x_46_im / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -6.4e+125) tmp = x_46_im / y_46_im; elseif (y_46_im <= -9.8e+73) tmp = x_46_re / y_46_re; elseif (y_46_im <= -3.5e-23) tmp = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_im <= 1.85e+65) tmp = x_46_re / y_46_re; else tmp = x_46_im / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -6.4e+125], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -9.8e+73], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, -3.5e-23], N[(N[(x$46$im * y$46$im), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.85e+65], N[(x$46$re / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -6.4 \cdot 10^{+125}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -9.8 \cdot 10^{+73}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.im \leq -3.5 \cdot 10^{-23}:\\
\;\;\;\;\frac{x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.85 \cdot 10^{+65}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -6.39999999999999967e125 or 1.84999999999999997e65 < y.im Initial program 43.1%
Taylor expanded in y.re around 0 71.1%
if -6.39999999999999967e125 < y.im < -9.7999999999999998e73 or -3.49999999999999993e-23 < y.im < 1.84999999999999997e65Initial program 69.6%
Taylor expanded in y.re around inf 67.8%
if -9.7999999999999998e73 < y.im < -3.49999999999999993e-23Initial program 91.0%
Taylor expanded in x.re around 0 59.7%
Final simplification68.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -6.4e+125)
(and (not (<= y.im -2.05e+69))
(or (<= y.im -8e-24) (not (<= y.im 3.8e+65)))))
(/ 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 <= -6.4e+125) || (!(y_46_im <= -2.05e+69) && ((y_46_im <= -8e-24) || !(y_46_im <= 3.8e+65)))) {
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 <= (-6.4d+125)) .or. (.not. (y_46im <= (-2.05d+69))) .and. (y_46im <= (-8d-24)) .or. (.not. (y_46im <= 3.8d+65))) 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 <= -6.4e+125) || (!(y_46_im <= -2.05e+69) && ((y_46_im <= -8e-24) || !(y_46_im <= 3.8e+65)))) {
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 <= -6.4e+125) or (not (y_46_im <= -2.05e+69) and ((y_46_im <= -8e-24) or not (y_46_im <= 3.8e+65))): 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 <= -6.4e+125) || (!(y_46_im <= -2.05e+69) && ((y_46_im <= -8e-24) || !(y_46_im <= 3.8e+65)))) 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 <= -6.4e+125) || (~((y_46_im <= -2.05e+69)) && ((y_46_im <= -8e-24) || ~((y_46_im <= 3.8e+65))))) 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, -6.4e+125], And[N[Not[LessEqual[y$46$im, -2.05e+69]], $MachinePrecision], Or[LessEqual[y$46$im, -8e-24], N[Not[LessEqual[y$46$im, 3.8e+65]], $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 -6.4 \cdot 10^{+125} \lor \neg \left(y.im \leq -2.05 \cdot 10^{+69}\right) \land \left(y.im \leq -8 \cdot 10^{-24} \lor \neg \left(y.im \leq 3.8 \cdot 10^{+65}\right)\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -6.39999999999999967e125 or -2.05e69 < y.im < -7.99999999999999939e-24 or 3.80000000000000011e65 < y.im Initial program 51.1%
Taylor expanded in y.re around 0 67.6%
if -6.39999999999999967e125 < y.im < -2.05e69 or -7.99999999999999939e-24 < y.im < 3.80000000000000011e65Initial program 69.6%
Taylor expanded in y.re around inf 67.8%
Final simplification67.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 60.6%
Taylor expanded in y.re around 0 41.3%
Final simplification41.3%
herbie shell --seed 2023314
(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))))