
(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 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re y.re) (* x.im y.im))))
(if (<= y.im -3.7e+124)
(/ (- (- x.im) (/ x.re (/ y.im y.re))) (hypot y.re y.im))
(if (<= y.im -2.3e-156)
(/ t_0 (fma y.re y.re (* y.im y.im)))
(if (<= y.im 1.35e-148)
(* (/ 1.0 y.re) (+ x.re (/ x.im (/ y.re y.im))))
(if (<= y.im 3.9e+58)
(/ t_0 (+ (* y.re y.re) (* y.im y.im)))
(* (+ x.im (* y.re (/ x.re 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) {
double t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double tmp;
if (y_46_im <= -3.7e+124) {
tmp = (-x_46_im - (x_46_re / (y_46_im / y_46_re))) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -2.3e-156) {
tmp = t_0 / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
} else if (y_46_im <= 1.35e-148) {
tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im)));
} else if (y_46_im <= 3.9e+58) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) * (1.0 / hypot(y_46_re, y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) tmp = 0.0 if (y_46_im <= -3.7e+124) tmp = Float64(Float64(Float64(-x_46_im) - Float64(x_46_re / Float64(y_46_im / y_46_re))) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -2.3e-156) tmp = Float64(t_0 / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im))); elseif (y_46_im <= 1.35e-148) tmp = Float64(Float64(1.0 / y_46_re) * Float64(x_46_re + Float64(x_46_im / Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 3.9e+58) tmp = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) * Float64(1.0 / hypot(y_46_re, y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.7e+124], 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], If[LessEqual[y$46$im, -2.3e-156], N[(t$95$0 / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.35e-148], N[(N[(1.0 / y$46$re), $MachinePrecision] * N[(x$46$re + N[(x$46$im / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.9e+58], N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot y.re + x.im \cdot y.im\\
\mathbf{if}\;y.im \leq -3.7 \cdot 10^{+124}:\\
\;\;\;\;\frac{\left(-x.im\right) - \frac{x.re}{\frac{y.im}{y.re}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -2.3 \cdot 10^{-156}:\\
\;\;\;\;\frac{t_0}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\
\mathbf{elif}\;y.im \leq 1.35 \cdot 10^{-148}:\\
\;\;\;\;\frac{1}{y.re} \cdot \left(x.re + \frac{x.im}{\frac{y.re}{y.im}}\right)\\
\mathbf{elif}\;y.im \leq 3.9 \cdot 10^{+58}:\\
\;\;\;\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + y.re \cdot \frac{x.re}{y.im}\right) \cdot \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -3.70000000000000008e124Initial program 29.9%
*-un-lft-identity29.9%
associate-*r/29.9%
fma-def29.9%
add-sqr-sqrt29.9%
times-frac29.9%
fma-def29.9%
hypot-def29.9%
fma-def29.9%
fma-def29.9%
hypot-def46.4%
Applied egg-rr46.4%
associate-*l/46.6%
*-un-lft-identity46.6%
Applied egg-rr46.6%
Taylor expanded in y.im around -inf 80.1%
distribute-lft-out80.1%
associate-/l*89.6%
Simplified89.6%
if -3.70000000000000008e124 < y.im < -2.3e-156Initial program 86.9%
fma-def86.9%
fma-def87.0%
Simplified87.0%
fma-def87.0%
Applied egg-rr87.0%
if -2.3e-156 < y.im < 1.34999999999999994e-148Initial program 57.0%
*-un-lft-identity57.0%
associate-*r/57.0%
fma-def57.0%
add-sqr-sqrt57.0%
times-frac57.2%
fma-def57.2%
hypot-def57.2%
fma-def57.2%
fma-def57.2%
hypot-def75.2%
Applied egg-rr75.2%
Taylor expanded in y.re around inf 48.6%
associate-/l*49.7%
Simplified49.7%
Taylor expanded in y.re around inf 96.8%
if 1.34999999999999994e-148 < y.im < 3.9000000000000001e58Initial program 87.1%
if 3.9000000000000001e58 < y.im Initial program 42.8%
*-un-lft-identity42.8%
associate-*r/42.8%
fma-def42.8%
add-sqr-sqrt42.8%
times-frac42.9%
fma-def42.9%
hypot-def42.9%
fma-def42.9%
fma-def42.9%
hypot-def61.8%
Applied egg-rr61.8%
Taylor expanded in y.re around 0 80.1%
associate-/l*85.9%
associate-/r/87.3%
Simplified87.3%
Final simplification89.6%
(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)))
5e+288)
(/ (/ (fma x.re y.re (* x.im y.im)) (hypot y.re y.im)) (hypot y.re y.im))
(* (/ 1.0 y.im) (+ 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 ((((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+288) {
tmp = (fma(x_46_re, y_46_re, (x_46_im * y_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
} else {
tmp = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (Float64(Float64(Float64(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))) <= 5e+288) tmp = Float64(Float64(fma(x_46_re, y_46_re, Float64(x_46_im * y_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)); else tmp = Float64(Float64(1.0 / y_46_im) * Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[N[(N[(N[(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], 5e+288], N[(N[(N[(x$46$re * y$46$re + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y$46$im), $MachinePrecision] * N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $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 5 \cdot 10^{+288}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y.im} \cdot \left(x.im + y.re \cdot \frac{x.re}{y.im}\right)\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 5.0000000000000003e288Initial program 80.8%
*-un-lft-identity80.8%
associate-*r/80.8%
fma-def80.8%
add-sqr-sqrt80.8%
times-frac80.9%
fma-def80.9%
hypot-def80.9%
fma-def80.9%
fma-def80.9%
hypot-def97.0%
Applied egg-rr97.0%
associate-*l/97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
if 5.0000000000000003e288 < (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 9.7%
*-un-lft-identity9.7%
associate-*r/9.7%
fma-def9.7%
add-sqr-sqrt9.7%
times-frac9.7%
fma-def9.7%
hypot-def9.7%
fma-def9.7%
fma-def9.7%
hypot-def14.4%
Applied egg-rr14.4%
Taylor expanded in y.re around 0 32.0%
associate-/l*39.1%
associate-/r/39.2%
Simplified39.2%
Taylor expanded in y.re around 0 61.0%
Final simplification87.9%
(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.im (* y.re (/ x.re y.im)))))
(if (<= y.im -3.2e+127)
(* (/ 1.0 y.im) t_1)
(if (<= y.im -2.3e-156)
t_0
(if (<= y.im 2.4e-146)
(* (/ 1.0 y.re) (+ x.re (/ x.im (/ y.re y.im))))
(if (<= y.im 1.25e+58) t_0 (* t_1 (/ 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) {
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_im + (y_46_re * (x_46_re / y_46_im));
double tmp;
if (y_46_im <= -3.2e+127) {
tmp = (1.0 / y_46_im) * t_1;
} else if (y_46_im <= -2.3e-156) {
tmp = t_0;
} else if (y_46_im <= 2.4e-146) {
tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im)));
} else if (y_46_im <= 1.25e+58) {
tmp = t_0;
} else {
tmp = t_1 * (1.0 / 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 = ((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_im + (y_46_re * (x_46_re / y_46_im));
double tmp;
if (y_46_im <= -3.2e+127) {
tmp = (1.0 / y_46_im) * t_1;
} else if (y_46_im <= -2.3e-156) {
tmp = t_0;
} else if (y_46_im <= 2.4e-146) {
tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im)));
} else if (y_46_im <= 1.25e+58) {
tmp = t_0;
} else {
tmp = t_1 * (1.0 / 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 = ((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_im + (y_46_re * (x_46_re / y_46_im)) tmp = 0 if y_46_im <= -3.2e+127: tmp = (1.0 / y_46_im) * t_1 elif y_46_im <= -2.3e-156: tmp = t_0 elif y_46_im <= 2.4e-146: tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im))) elif y_46_im <= 1.25e+58: tmp = t_0 else: tmp = t_1 * (1.0 / 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(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(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) tmp = 0.0 if (y_46_im <= -3.2e+127) tmp = Float64(Float64(1.0 / y_46_im) * t_1); elseif (y_46_im <= -2.3e-156) tmp = t_0; elseif (y_46_im <= 2.4e-146) tmp = Float64(Float64(1.0 / y_46_re) * Float64(x_46_re + Float64(x_46_im / Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 1.25e+58) tmp = t_0; else tmp = Float64(t_1 * Float64(1.0 / 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 = ((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_im + (y_46_re * (x_46_re / y_46_im)); tmp = 0.0; if (y_46_im <= -3.2e+127) tmp = (1.0 / y_46_im) * t_1; elseif (y_46_im <= -2.3e-156) tmp = t_0; elseif (y_46_im <= 2.4e-146) tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im))); elseif (y_46_im <= 1.25e+58) tmp = t_0; else tmp = t_1 * (1.0 / 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[(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[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.2e+127], N[(N[(1.0 / y$46$im), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[y$46$im, -2.3e-156], t$95$0, If[LessEqual[y$46$im, 2.4e-146], N[(N[(1.0 / y$46$re), $MachinePrecision] * N[(x$46$re + N[(x$46$im / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.25e+58], t$95$0, N[(t$95$1 * N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\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 := x.im + y.re \cdot \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -3.2 \cdot 10^{+127}:\\
\;\;\;\;\frac{1}{y.im} \cdot t_1\\
\mathbf{elif}\;y.im \leq -2.3 \cdot 10^{-156}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 2.4 \cdot 10^{-146}:\\
\;\;\;\;\frac{1}{y.re} \cdot \left(x.re + \frac{x.im}{\frac{y.re}{y.im}}\right)\\
\mathbf{elif}\;y.im \leq 1.25 \cdot 10^{+58}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -3.19999999999999976e127Initial program 29.9%
*-un-lft-identity29.9%
associate-*r/29.9%
fma-def29.9%
add-sqr-sqrt29.9%
times-frac29.9%
fma-def29.9%
hypot-def29.9%
fma-def29.9%
fma-def29.9%
hypot-def46.4%
Applied egg-rr46.4%
Taylor expanded in y.re around 0 30.7%
associate-/l*30.9%
associate-/r/30.9%
Simplified30.9%
Taylor expanded in y.re around 0 89.2%
if -3.19999999999999976e127 < y.im < -2.3e-156 or 2.4000000000000002e-146 < y.im < 1.24999999999999996e58Initial program 87.0%
if -2.3e-156 < y.im < 2.4000000000000002e-146Initial program 57.0%
*-un-lft-identity57.0%
associate-*r/57.0%
fma-def57.0%
add-sqr-sqrt57.0%
times-frac57.2%
fma-def57.2%
hypot-def57.2%
fma-def57.2%
fma-def57.2%
hypot-def75.2%
Applied egg-rr75.2%
Taylor expanded in y.re around inf 48.6%
associate-/l*49.7%
Simplified49.7%
Taylor expanded in y.re around inf 96.8%
if 1.24999999999999996e58 < y.im Initial program 42.8%
*-un-lft-identity42.8%
associate-*r/42.8%
fma-def42.8%
add-sqr-sqrt42.8%
times-frac42.9%
fma-def42.9%
hypot-def42.9%
fma-def42.9%
fma-def42.9%
hypot-def61.8%
Applied egg-rr61.8%
Taylor expanded in y.re around 0 80.1%
associate-/l*85.9%
associate-/r/87.3%
Simplified87.3%
Final simplification89.5%
(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)))))
(if (<= y.im -2.2e+136)
(/ (- (- x.im) (/ x.re (/ y.im y.re))) (hypot y.re y.im))
(if (<= y.im -9.5e-161)
t_0
(if (<= y.im 1.95e-145)
(* (/ 1.0 y.re) (+ x.re (/ x.im (/ y.re y.im))))
(if (<= y.im 2.2e+58)
t_0
(* (+ x.im (* y.re (/ x.re 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) {
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 tmp;
if (y_46_im <= -2.2e+136) {
tmp = (-x_46_im - (x_46_re / (y_46_im / y_46_re))) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -9.5e-161) {
tmp = t_0;
} else if (y_46_im <= 1.95e-145) {
tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im)));
} else if (y_46_im <= 2.2e+58) {
tmp = t_0;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) * (1.0 / 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 = ((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 tmp;
if (y_46_im <= -2.2e+136) {
tmp = (-x_46_im - (x_46_re / (y_46_im / y_46_re))) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_im <= -9.5e-161) {
tmp = t_0;
} else if (y_46_im <= 1.95e-145) {
tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im)));
} else if (y_46_im <= 2.2e+58) {
tmp = t_0;
} else {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) * (1.0 / 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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -2.2e+136: tmp = (-x_46_im - (x_46_re / (y_46_im / y_46_re))) / math.hypot(y_46_re, y_46_im) elif y_46_im <= -9.5e-161: tmp = t_0 elif y_46_im <= 1.95e-145: tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im))) elif y_46_im <= 2.2e+58: tmp = t_0 else: tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) * (1.0 / 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(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))) tmp = 0.0 if (y_46_im <= -2.2e+136) tmp = Float64(Float64(Float64(-x_46_im) - Float64(x_46_re / Float64(y_46_im / y_46_re))) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -9.5e-161) tmp = t_0; elseif (y_46_im <= 1.95e-145) tmp = Float64(Float64(1.0 / y_46_re) * Float64(x_46_re + Float64(x_46_im / Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 2.2e+58) tmp = t_0; else tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) * Float64(1.0 / 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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -2.2e+136) tmp = (-x_46_im - (x_46_re / (y_46_im / y_46_re))) / hypot(y_46_re, y_46_im); elseif (y_46_im <= -9.5e-161) tmp = t_0; elseif (y_46_im <= 1.95e-145) tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im))); elseif (y_46_im <= 2.2e+58) tmp = t_0; else tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) * (1.0 / 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[(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.2e+136], 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], If[LessEqual[y$46$im, -9.5e-161], t$95$0, If[LessEqual[y$46$im, 1.95e-145], N[(N[(1.0 / y$46$re), $MachinePrecision] * N[(x$46$re + N[(x$46$im / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.2e+58], t$95$0, N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\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}\\
\mathbf{if}\;y.im \leq -2.2 \cdot 10^{+136}:\\
\;\;\;\;\frac{\left(-x.im\right) - \frac{x.re}{\frac{y.im}{y.re}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -9.5 \cdot 10^{-161}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.95 \cdot 10^{-145}:\\
\;\;\;\;\frac{1}{y.re} \cdot \left(x.re + \frac{x.im}{\frac{y.re}{y.im}}\right)\\
\mathbf{elif}\;y.im \leq 2.2 \cdot 10^{+58}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\left(x.im + y.re \cdot \frac{x.re}{y.im}\right) \cdot \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -2.1999999999999999e136Initial program 29.9%
*-un-lft-identity29.9%
associate-*r/29.9%
fma-def29.9%
add-sqr-sqrt29.9%
times-frac29.9%
fma-def29.9%
hypot-def29.9%
fma-def29.9%
fma-def29.9%
hypot-def46.4%
Applied egg-rr46.4%
associate-*l/46.6%
*-un-lft-identity46.6%
Applied egg-rr46.6%
Taylor expanded in y.im around -inf 80.1%
distribute-lft-out80.1%
associate-/l*89.6%
Simplified89.6%
if -2.1999999999999999e136 < y.im < -9.4999999999999996e-161 or 1.95000000000000015e-145 < y.im < 2.2000000000000001e58Initial program 87.0%
if -9.4999999999999996e-161 < y.im < 1.95000000000000015e-145Initial program 57.0%
*-un-lft-identity57.0%
associate-*r/57.0%
fma-def57.0%
add-sqr-sqrt57.0%
times-frac57.2%
fma-def57.2%
hypot-def57.2%
fma-def57.2%
fma-def57.2%
hypot-def75.2%
Applied egg-rr75.2%
Taylor expanded in y.re around inf 48.6%
associate-/l*49.7%
Simplified49.7%
Taylor expanded in y.re around inf 96.8%
if 2.2000000000000001e58 < y.im Initial program 42.8%
*-un-lft-identity42.8%
associate-*r/42.8%
fma-def42.8%
add-sqr-sqrt42.8%
times-frac42.9%
fma-def42.9%
hypot-def42.9%
fma-def42.9%
fma-def42.9%
hypot-def61.8%
Applied egg-rr61.8%
Taylor expanded in y.re around 0 80.1%
associate-/l*85.9%
associate-/r/87.3%
Simplified87.3%
Final simplification89.5%
(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 (* (/ 1.0 y.im) (+ x.im (* y.re (/ x.re y.im))))))
(if (<= y.im -2.45e+126)
t_1
(if (<= y.im -3.6e-156)
t_0
(if (<= y.im 8.4e-149)
(* (/ 1.0 y.re) (+ x.re (/ x.im (/ y.re y.im))))
(if (<= y.im 1.3e+57) 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 = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
double tmp;
if (y_46_im <= -2.45e+126) {
tmp = t_1;
} else if (y_46_im <= -3.6e-156) {
tmp = t_0;
} else if (y_46_im <= 8.4e-149) {
tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im)));
} else if (y_46_im <= 1.3e+57) {
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 = (1.0d0 / y_46im) * (x_46im + (y_46re * (x_46re / y_46im)))
if (y_46im <= (-2.45d+126)) then
tmp = t_1
else if (y_46im <= (-3.6d-156)) then
tmp = t_0
else if (y_46im <= 8.4d-149) then
tmp = (1.0d0 / y_46re) * (x_46re + (x_46im / (y_46re / y_46im)))
else if (y_46im <= 1.3d+57) 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 = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
double tmp;
if (y_46_im <= -2.45e+126) {
tmp = t_1;
} else if (y_46_im <= -3.6e-156) {
tmp = t_0;
} else if (y_46_im <= 8.4e-149) {
tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im)));
} else if (y_46_im <= 1.3e+57) {
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 = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im))) tmp = 0 if y_46_im <= -2.45e+126: tmp = t_1 elif y_46_im <= -3.6e-156: tmp = t_0 elif y_46_im <= 8.4e-149: tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im))) elif y_46_im <= 1.3e+57: 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(1.0 / y_46_im) * Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im)))) tmp = 0.0 if (y_46_im <= -2.45e+126) tmp = t_1; elseif (y_46_im <= -3.6e-156) tmp = t_0; elseif (y_46_im <= 8.4e-149) tmp = Float64(Float64(1.0 / y_46_re) * Float64(x_46_re + Float64(x_46_im / Float64(y_46_re / y_46_im)))); elseif (y_46_im <= 1.3e+57) 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 = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im))); tmp = 0.0; if (y_46_im <= -2.45e+126) tmp = t_1; elseif (y_46_im <= -3.6e-156) tmp = t_0; elseif (y_46_im <= 8.4e-149) tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im))); elseif (y_46_im <= 1.3e+57) 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[(1.0 / y$46$im), $MachinePrecision] * N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.45e+126], t$95$1, If[LessEqual[y$46$im, -3.6e-156], t$95$0, If[LessEqual[y$46$im, 8.4e-149], N[(N[(1.0 / y$46$re), $MachinePrecision] * N[(x$46$re + N[(x$46$im / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.3e+57], 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{1}{y.im} \cdot \left(x.im + y.re \cdot \frac{x.re}{y.im}\right)\\
\mathbf{if}\;y.im \leq -2.45 \cdot 10^{+126}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -3.6 \cdot 10^{-156}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 8.4 \cdot 10^{-149}:\\
\;\;\;\;\frac{1}{y.re} \cdot \left(x.re + \frac{x.im}{\frac{y.re}{y.im}}\right)\\
\mathbf{elif}\;y.im \leq 1.3 \cdot 10^{+57}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -2.45e126 or 1.3e57 < y.im Initial program 38.6%
*-un-lft-identity38.6%
associate-*r/38.6%
fma-def38.6%
add-sqr-sqrt38.6%
times-frac38.6%
fma-def38.6%
hypot-def38.6%
fma-def38.6%
fma-def38.6%
hypot-def56.8%
Applied egg-rr56.8%
Taylor expanded in y.re around 0 64.0%
associate-/l*68.0%
associate-/r/68.9%
Simplified68.9%
Taylor expanded in y.re around 0 87.8%
if -2.45e126 < y.im < -3.59999999999999999e-156 or 8.40000000000000043e-149 < y.im < 1.3e57Initial program 87.0%
if -3.59999999999999999e-156 < y.im < 8.40000000000000043e-149Initial program 57.0%
*-un-lft-identity57.0%
associate-*r/57.0%
fma-def57.0%
add-sqr-sqrt57.0%
times-frac57.2%
fma-def57.2%
hypot-def57.2%
fma-def57.2%
fma-def57.2%
hypot-def75.2%
Applied egg-rr75.2%
Taylor expanded in y.re around inf 48.6%
associate-/l*49.7%
Simplified49.7%
Taylor expanded in y.re around inf 96.8%
Final simplification89.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.4e-30) (not (<= y.im 1.4e-72))) (* (/ 1.0 y.im) (+ x.im (* y.re (/ x.re y.im)))) (/ x.re y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.4e-30) || !(y_46_im <= 1.4e-72)) {
tmp = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-2.4d-30)) .or. (.not. (y_46im <= 1.4d-72))) then
tmp = (1.0d0 / y_46im) * (x_46im + (y_46re * (x_46re / y_46im)))
else
tmp = x_46re / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -2.4e-30) || !(y_46_im <= 1.4e-72)) {
tmp = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -2.4e-30) or not (y_46_im <= 1.4e-72): tmp = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im))) else: tmp = x_46_re / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -2.4e-30) || !(y_46_im <= 1.4e-72)) tmp = Float64(Float64(1.0 / y_46_im) * Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im)))); else tmp = Float64(x_46_re / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -2.4e-30) || ~((y_46_im <= 1.4e-72))) tmp = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im))); else tmp = x_46_re / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -2.4e-30], N[Not[LessEqual[y$46$im, 1.4e-72]], $MachinePrecision]], N[(N[(1.0 / y$46$im), $MachinePrecision] * N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.4 \cdot 10^{-30} \lor \neg \left(y.im \leq 1.4 \cdot 10^{-72}\right):\\
\;\;\;\;\frac{1}{y.im} \cdot \left(x.im + y.re \cdot \frac{x.re}{y.im}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -2.39999999999999985e-30 or 1.3999999999999999e-72 < y.im Initial program 57.7%
*-un-lft-identity57.7%
associate-*r/57.7%
fma-def57.7%
add-sqr-sqrt57.7%
times-frac57.7%
fma-def57.7%
hypot-def57.7%
fma-def57.7%
fma-def57.7%
hypot-def70.9%
Applied egg-rr70.9%
Taylor expanded in y.re around 0 51.7%
associate-/l*54.2%
associate-/r/54.8%
Simplified54.8%
Taylor expanded in y.re around 0 81.3%
if -2.39999999999999985e-30 < y.im < 1.3999999999999999e-72Initial program 69.5%
Taylor expanded in y.re around inf 70.7%
Final simplification77.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.8e-27) (not (<= y.im 3.5e-14))) (* (/ 1.0 y.im) (+ x.im (* y.re (/ x.re y.im)))) (* (/ 1.0 y.re) (+ x.re (/ x.im (/ 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.8e-27) || !(y_46_im <= 3.5e-14)) {
tmp = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
} else {
tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-3.8d-27)) .or. (.not. (y_46im <= 3.5d-14))) then
tmp = (1.0d0 / y_46im) * (x_46im + (y_46re * (x_46re / y_46im)))
else
tmp = (1.0d0 / y_46re) * (x_46re + (x_46im / (y_46re / y_46im)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -3.8e-27) || !(y_46_im <= 3.5e-14)) {
tmp = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im)));
} else {
tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -3.8e-27) or not (y_46_im <= 3.5e-14): tmp = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im))) else: tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (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.8e-27) || !(y_46_im <= 3.5e-14)) tmp = Float64(Float64(1.0 / y_46_im) * Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im)))); else tmp = Float64(Float64(1.0 / y_46_re) * Float64(x_46_re + Float64(x_46_im / Float64(y_46_re / y_46_im)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -3.8e-27) || ~((y_46_im <= 3.5e-14))) tmp = (1.0 / y_46_im) * (x_46_im + (y_46_re * (x_46_re / y_46_im))); else tmp = (1.0 / y_46_re) * (x_46_re + (x_46_im / (y_46_re / y_46_im))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -3.8e-27], N[Not[LessEqual[y$46$im, 3.5e-14]], $MachinePrecision]], N[(N[(1.0 / y$46$im), $MachinePrecision] * N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y$46$re), $MachinePrecision] * N[(x$46$re + N[(x$46$im / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.8 \cdot 10^{-27} \lor \neg \left(y.im \leq 3.5 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{1}{y.im} \cdot \left(x.im + y.re \cdot \frac{x.re}{y.im}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y.re} \cdot \left(x.re + \frac{x.im}{\frac{y.re}{y.im}}\right)\\
\end{array}
\end{array}
if y.im < -3.8e-27 or 3.5000000000000002e-14 < y.im Initial program 56.1%
*-un-lft-identity56.1%
associate-*r/56.1%
fma-def56.1%
add-sqr-sqrt56.1%
times-frac56.0%
fma-def56.0%
hypot-def56.0%
fma-def56.0%
fma-def56.0%
hypot-def69.5%
Applied egg-rr69.5%
Taylor expanded in y.re around 0 51.6%
associate-/l*54.3%
associate-/r/54.9%
Simplified54.9%
Taylor expanded in y.re around 0 83.4%
if -3.8e-27 < y.im < 3.5000000000000002e-14Initial program 70.5%
*-un-lft-identity70.5%
associate-*r/70.5%
fma-def70.5%
add-sqr-sqrt70.5%
times-frac70.6%
fma-def70.6%
hypot-def70.6%
fma-def70.6%
fma-def70.6%
hypot-def83.4%
Applied egg-rr83.4%
Taylor expanded in y.re around inf 43.6%
associate-/l*44.0%
Simplified44.0%
Taylor expanded in y.re around inf 84.2%
Final simplification83.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -8.2e-22) (not (<= y.im 8.4e-73))) (/ 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 <= -8.2e-22) || !(y_46_im <= 8.4e-73)) {
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 <= (-8.2d-22)) .or. (.not. (y_46im <= 8.4d-73))) 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 <= -8.2e-22) || !(y_46_im <= 8.4e-73)) {
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 <= -8.2e-22) or not (y_46_im <= 8.4e-73): 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 <= -8.2e-22) || !(y_46_im <= 8.4e-73)) 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 <= -8.2e-22) || ~((y_46_im <= 8.4e-73))) 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, -8.2e-22], N[Not[LessEqual[y$46$im, 8.4e-73]], $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 -8.2 \cdot 10^{-22} \lor \neg \left(y.im \leq 8.4 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -8.1999999999999999e-22 or 8.3999999999999994e-73 < y.im Initial program 57.7%
Taylor expanded in y.re around 0 63.4%
if -8.1999999999999999e-22 < y.im < 8.3999999999999994e-73Initial program 69.5%
Taylor expanded in y.re around inf 70.7%
Final simplification66.4%
(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 62.5%
Taylor expanded in y.re around 0 45.3%
Final simplification45.3%
herbie shell --seed 2024017
(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))))