
(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 10 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)))
INFINITY)
(/ (/ (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) (/ x.re (/ y.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((((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) INFINITY)) {
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 - (x_46_re / (y_46_im / y_46_re)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (Float64(Float64(Float64(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))) <= Inf) 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(Float64(-x_46_im) - Float64(x_46_re / Float64(y_46_im / y_46_re)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[N[(N[(N[(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], Infinity], 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[(x$46$re / N[(y$46$im / y$46$re), $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 \infty:\\
\;\;\;\;\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(\left(-x.im\right) - \frac{x.re}{\frac{y.im}{y.re}}\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))) < +inf.0Initial program 77.7%
*-un-lft-identity77.7%
add-sqr-sqrt77.7%
times-frac77.7%
hypot-def77.7%
fma-def77.7%
hypot-def96.1%
Applied egg-rr96.1%
associate-*l/96.4%
*-un-lft-identity96.4%
Applied egg-rr96.4%
if +inf.0 < (/.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 0.0%
*-un-lft-identity0.0%
add-sqr-sqrt0.0%
times-frac0.0%
hypot-def0.0%
fma-def0.0%
hypot-def2.7%
Applied egg-rr2.7%
Taylor expanded in y.im around -inf 25.4%
mul-1-neg25.4%
unsub-neg25.4%
neg-mul-125.4%
associate-/l*28.0%
Simplified28.0%
Taylor expanded in y.im around -inf 54.1%
Final simplification90.1%
(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 -7e+151)
(+ (/ x.im y.im) (/ x.re (* y.im (/ y.im y.re))))
(if (<= y.im -3.9e-168)
t_0
(if (<= y.im 2.9e-223)
(+ (/ x.re y.re) (* y.im (/ (* x.im (/ 1.0 y.re)) y.re)))
(if (<= y.im 7.5e+28)
t_0
(* (/ 1.0 (hypot y.re y.im)) (+ x.im (/ x.re (/ y.im y.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((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 <= -7e+151) {
tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
} else if (y_46_im <= -3.9e-168) {
tmp = t_0;
} else if (y_46_im <= 2.9e-223) {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re));
} else if (y_46_im <= 7.5e+28) {
tmp = t_0;
} else {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + (x_46_re / (y_46_im / y_46_re)));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((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 <= -7e+151) {
tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
} else if (y_46_im <= -3.9e-168) {
tmp = t_0;
} else if (y_46_im <= 2.9e-223) {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re));
} else if (y_46_im <= 7.5e+28) {
tmp = t_0;
} else {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_im + (x_46_re / (y_46_im / y_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((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 <= -7e+151: tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))) elif y_46_im <= -3.9e-168: tmp = t_0 elif y_46_im <= 2.9e-223: tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re)) elif y_46_im <= 7.5e+28: tmp = t_0 else: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_im + (x_46_re / (y_46_im / y_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(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 <= -7e+151) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64(y_46_im * Float64(y_46_im / y_46_re)))); elseif (y_46_im <= -3.9e-168) tmp = t_0; elseif (y_46_im <= 2.9e-223) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(y_46_im * Float64(Float64(x_46_im * Float64(1.0 / y_46_re)) / y_46_re))); elseif (y_46_im <= 7.5e+28) tmp = t_0; else tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_im + Float64(x_46_re / Float64(y_46_im / y_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((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 <= -7e+151) tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))); elseif (y_46_im <= -3.9e-168) tmp = t_0; elseif (y_46_im <= 2.9e-223) tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re)); elseif (y_46_im <= 7.5e+28) tmp = t_0; else tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_im + (x_46_re / (y_46_im / y_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(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, -7e+151], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(y$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -3.9e-168], t$95$0, If[LessEqual[y$46$im, 2.9e-223], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(y$46$im * N[(N[(x$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7.5e+28], t$95$0, N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im + N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $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 -7 \cdot 10^{+151}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{y.im \cdot \frac{y.im}{y.re}}\\
\mathbf{elif}\;y.im \leq -3.9 \cdot 10^{-168}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 2.9 \cdot 10^{-223}:\\
\;\;\;\;\frac{x.re}{y.re} + y.im \cdot \frac{x.im \cdot \frac{1}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+28}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.im + \frac{x.re}{\frac{y.im}{y.re}}\right)\\
\end{array}
\end{array}
if y.im < -7.0000000000000006e151Initial program 30.7%
Taylor expanded in y.re around 0 87.6%
associate-/l*87.8%
Simplified87.8%
pow287.8%
*-un-lft-identity87.8%
times-frac94.1%
Applied egg-rr94.1%
if -7.0000000000000006e151 < y.im < -3.90000000000000012e-168 or 2.9e-223 < y.im < 7.4999999999999998e28Initial program 83.1%
if -3.90000000000000012e-168 < y.im < 2.9e-223Initial program 64.2%
Taylor expanded in y.re around inf 84.0%
associate-/l*82.6%
associate-/r/79.5%
Simplified79.5%
*-un-lft-identity79.5%
pow279.5%
times-frac85.1%
Applied egg-rr85.1%
associate-*r/85.2%
Applied egg-rr85.2%
if 7.4999999999999998e28 < y.im Initial program 53.0%
*-un-lft-identity53.0%
add-sqr-sqrt53.0%
times-frac53.0%
hypot-def53.0%
fma-def53.0%
hypot-def73.0%
Applied egg-rr73.0%
Taylor expanded in y.re around 0 89.8%
associate-/l*91.5%
Simplified91.5%
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)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (+ x.im (/ x.re (/ y.im y.re)))))
(if (<= y.im -3.8e+143)
(* t_1 (/ -1.0 (hypot y.re y.im)))
(if (<= y.im -1.5e-168)
t_0
(if (<= y.im 1.72e-223)
(+ (/ x.re y.re) (* y.im (/ (* x.im (/ 1.0 y.re)) y.re)))
(if (<= y.im 7.5e+28) t_0 (* (/ 1.0 (hypot y.re y.im)) 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_im + (x_46_re / (y_46_im / y_46_re));
double tmp;
if (y_46_im <= -3.8e+143) {
tmp = t_1 * (-1.0 / hypot(y_46_re, y_46_im));
} else if (y_46_im <= -1.5e-168) {
tmp = t_0;
} else if (y_46_im <= 1.72e-223) {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re));
} else if (y_46_im <= 7.5e+28) {
tmp = t_0;
} else {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * t_1;
}
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 + (x_46_re / (y_46_im / y_46_re));
double tmp;
if (y_46_im <= -3.8e+143) {
tmp = t_1 * (-1.0 / Math.hypot(y_46_re, y_46_im));
} else if (y_46_im <= -1.5e-168) {
tmp = t_0;
} else if (y_46_im <= 1.72e-223) {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re));
} else if (y_46_im <= 7.5e+28) {
tmp = t_0;
} else {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * 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_im + (x_46_re / (y_46_im / y_46_re)) tmp = 0 if y_46_im <= -3.8e+143: tmp = t_1 * (-1.0 / math.hypot(y_46_re, y_46_im)) elif y_46_im <= -1.5e-168: tmp = t_0 elif y_46_im <= 1.72e-223: tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re)) elif y_46_im <= 7.5e+28: tmp = t_0 else: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * 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(x_46_im + Float64(x_46_re / Float64(y_46_im / y_46_re))) tmp = 0.0 if (y_46_im <= -3.8e+143) tmp = Float64(t_1 * Float64(-1.0 / hypot(y_46_re, y_46_im))); elseif (y_46_im <= -1.5e-168) tmp = t_0; elseif (y_46_im <= 1.72e-223) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(y_46_im * Float64(Float64(x_46_im * Float64(1.0 / y_46_re)) / y_46_re))); elseif (y_46_im <= 7.5e+28) tmp = t_0; else tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * 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_im + (x_46_re / (y_46_im / y_46_re)); tmp = 0.0; if (y_46_im <= -3.8e+143) tmp = t_1 * (-1.0 / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -1.5e-168) tmp = t_0; elseif (y_46_im <= 1.72e-223) tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re)); elseif (y_46_im <= 7.5e+28) tmp = t_0; else tmp = (1.0 / hypot(y_46_re, y_46_im)) * 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[(x$46$im + N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.8e+143], N[(t$95$1 * N[(-1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.5e-168], t$95$0, If[LessEqual[y$46$im, 1.72e-223], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(y$46$im * N[(N[(x$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7.5e+28], t$95$0, N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * t$95$1), $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 + \frac{x.re}{\frac{y.im}{y.re}}\\
\mathbf{if}\;y.im \leq -3.8 \cdot 10^{+143}:\\
\;\;\;\;t_1 \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -1.5 \cdot 10^{-168}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.72 \cdot 10^{-223}:\\
\;\;\;\;\frac{x.re}{y.re} + y.im \cdot \frac{x.im \cdot \frac{1}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+28}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot t_1\\
\end{array}
\end{array}
if y.im < -3.8e143Initial program 38.6%
*-un-lft-identity38.6%
add-sqr-sqrt38.6%
times-frac38.6%
hypot-def38.6%
fma-def38.6%
hypot-def69.2%
Applied egg-rr69.2%
Taylor expanded in y.im around -inf 92.4%
mul-1-neg92.4%
unsub-neg92.4%
neg-mul-192.4%
associate-/l*95.2%
Simplified95.2%
if -3.8e143 < y.im < -1.49999999999999996e-168 or 1.72e-223 < y.im < 7.4999999999999998e28Initial program 82.5%
if -1.49999999999999996e-168 < y.im < 1.72e-223Initial program 64.2%
Taylor expanded in y.re around inf 84.0%
associate-/l*82.6%
associate-/r/79.5%
Simplified79.5%
*-un-lft-identity79.5%
pow279.5%
times-frac85.1%
Applied egg-rr85.1%
associate-*r/85.2%
Applied egg-rr85.2%
if 7.4999999999999998e28 < y.im Initial program 53.0%
*-un-lft-identity53.0%
add-sqr-sqrt53.0%
times-frac53.0%
hypot-def53.0%
fma-def53.0%
hypot-def73.0%
Applied egg-rr73.0%
Taylor expanded in y.re around 0 89.8%
associate-/l*91.5%
Simplified91.5%
Final simplification86.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)))))
(if (<= y.im -2.8e+150)
(+ (/ x.im y.im) (/ x.re (* y.im (/ y.im y.re))))
(if (<= y.im -2.3e-168)
t_0
(if (<= y.im 1.25e-223)
(+ (/ x.re y.re) (* y.im (/ (* x.im (/ 1.0 y.re)) y.re)))
(if (<= y.im 7.5e+28)
t_0
(* (/ -1.0 y.im) (- (- x.im) (/ x.re (/ y.im y.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((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.8e+150) {
tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
} else if (y_46_im <= -2.3e-168) {
tmp = t_0;
} else if (y_46_im <= 1.25e-223) {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re));
} else if (y_46_im <= 7.5e+28) {
tmp = t_0;
} else {
tmp = (-1.0 / y_46_im) * (-x_46_im - (x_46_re / (y_46_im / y_46_re)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46im <= (-2.8d+150)) then
tmp = (x_46im / y_46im) + (x_46re / (y_46im * (y_46im / y_46re)))
else if (y_46im <= (-2.3d-168)) then
tmp = t_0
else if (y_46im <= 1.25d-223) then
tmp = (x_46re / y_46re) + (y_46im * ((x_46im * (1.0d0 / y_46re)) / y_46re))
else if (y_46im <= 7.5d+28) then
tmp = t_0
else
tmp = ((-1.0d0) / y_46im) * (-x_46im - (x_46re / (y_46im / y_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((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.8e+150) {
tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re)));
} else if (y_46_im <= -2.3e-168) {
tmp = t_0;
} else if (y_46_im <= 1.25e-223) {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re));
} else if (y_46_im <= 7.5e+28) {
tmp = t_0;
} else {
tmp = (-1.0 / y_46_im) * (-x_46_im - (x_46_re / (y_46_im / y_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((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.8e+150: tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))) elif y_46_im <= -2.3e-168: tmp = t_0 elif y_46_im <= 1.25e-223: tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re)) elif y_46_im <= 7.5e+28: tmp = t_0 else: tmp = (-1.0 / y_46_im) * (-x_46_im - (x_46_re / (y_46_im / y_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(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.8e+150) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re / Float64(y_46_im * Float64(y_46_im / y_46_re)))); elseif (y_46_im <= -2.3e-168) tmp = t_0; elseif (y_46_im <= 1.25e-223) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(y_46_im * Float64(Float64(x_46_im * Float64(1.0 / y_46_re)) / y_46_re))); elseif (y_46_im <= 7.5e+28) tmp = t_0; else tmp = Float64(Float64(-1.0 / y_46_im) * Float64(Float64(-x_46_im) - Float64(x_46_re / Float64(y_46_im / y_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((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.8e+150) tmp = (x_46_im / y_46_im) + (x_46_re / (y_46_im * (y_46_im / y_46_re))); elseif (y_46_im <= -2.3e-168) tmp = t_0; elseif (y_46_im <= 1.25e-223) tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im * (1.0 / y_46_re)) / y_46_re)); elseif (y_46_im <= 7.5e+28) tmp = t_0; else tmp = (-1.0 / y_46_im) * (-x_46_im - (x_46_re / (y_46_im / y_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(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.8e+150], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re / N[(y$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -2.3e-168], t$95$0, If[LessEqual[y$46$im, 1.25e-223], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(y$46$im * N[(N[(x$46$im * N[(1.0 / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7.5e+28], t$95$0, N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[((-x$46$im) - N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $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.8 \cdot 10^{+150}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re}{y.im \cdot \frac{y.im}{y.re}}\\
\mathbf{elif}\;y.im \leq -2.3 \cdot 10^{-168}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.25 \cdot 10^{-223}:\\
\;\;\;\;\frac{x.re}{y.re} + y.im \cdot \frac{x.im \cdot \frac{1}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+28}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(\left(-x.im\right) - \frac{x.re}{\frac{y.im}{y.re}}\right)\\
\end{array}
\end{array}
if y.im < -2.80000000000000009e150Initial program 30.7%
Taylor expanded in y.re around 0 87.6%
associate-/l*87.8%
Simplified87.8%
pow287.8%
*-un-lft-identity87.8%
times-frac94.1%
Applied egg-rr94.1%
if -2.80000000000000009e150 < y.im < -2.29999999999999986e-168 or 1.25000000000000006e-223 < y.im < 7.4999999999999998e28Initial program 83.1%
if -2.29999999999999986e-168 < y.im < 1.25000000000000006e-223Initial program 64.2%
Taylor expanded in y.re around inf 84.0%
associate-/l*82.6%
associate-/r/79.5%
Simplified79.5%
*-un-lft-identity79.5%
pow279.5%
times-frac85.1%
Applied egg-rr85.1%
associate-*r/85.2%
Applied egg-rr85.2%
if 7.4999999999999998e28 < y.im Initial program 53.0%
*-un-lft-identity53.0%
add-sqr-sqrt53.0%
times-frac53.0%
hypot-def53.0%
fma-def53.0%
hypot-def73.0%
Applied egg-rr73.0%
Taylor expanded in y.im around -inf 22.8%
mul-1-neg22.8%
unsub-neg22.8%
neg-mul-122.8%
associate-/l*22.9%
Simplified22.9%
Taylor expanded in y.im around -inf 91.4%
Final simplification86.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.im -106000000.0)
(/ x.im y.im)
(if (<= y.im 1.36e-19)
(+ (/ x.re y.re) (* y.im (/ (/ x.im y.re) y.re)))
(if (<= y.im 13000000000000.0)
(/ (* x.im y.im) t_0)
(if (<= y.im 7.5e+30) (/ (* x.re y.re) t_0) (/ x.im y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_im <= -106000000.0) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.36e-19) {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_46_re) / y_46_re));
} else if (y_46_im <= 13000000000000.0) {
tmp = (x_46_im * y_46_im) / t_0;
} else if (y_46_im <= 7.5e+30) {
tmp = (x_46_re * y_46_re) / t_0;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (y_46re * y_46re) + (y_46im * y_46im)
if (y_46im <= (-106000000.0d0)) then
tmp = x_46im / y_46im
else if (y_46im <= 1.36d-19) then
tmp = (x_46re / y_46re) + (y_46im * ((x_46im / y_46re) / y_46re))
else if (y_46im <= 13000000000000.0d0) then
tmp = (x_46im * y_46im) / t_0
else if (y_46im <= 7.5d+30) then
tmp = (x_46re * y_46re) / t_0
else
tmp = x_46im / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im);
double tmp;
if (y_46_im <= -106000000.0) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.36e-19) {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_46_re) / y_46_re));
} else if (y_46_im <= 13000000000000.0) {
tmp = (x_46_im * y_46_im) / t_0;
} else if (y_46_im <= 7.5e+30) {
tmp = (x_46_re * y_46_re) / t_0;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im) tmp = 0 if y_46_im <= -106000000.0: tmp = x_46_im / y_46_im elif y_46_im <= 1.36e-19: tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_46_re) / y_46_re)) elif y_46_im <= 13000000000000.0: tmp = (x_46_im * y_46_im) / t_0 elif y_46_im <= 7.5e+30: tmp = (x_46_re * y_46_re) / t_0 else: tmp = x_46_im / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) tmp = 0.0 if (y_46_im <= -106000000.0) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 1.36e-19) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(y_46_im * Float64(Float64(x_46_im / y_46_re) / y_46_re))); elseif (y_46_im <= 13000000000000.0) tmp = Float64(Float64(x_46_im * y_46_im) / t_0); elseif (y_46_im <= 7.5e+30) tmp = Float64(Float64(x_46_re * y_46_re) / t_0); else tmp = Float64(x_46_im / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (y_46_re * y_46_re) + (y_46_im * y_46_im); tmp = 0.0; if (y_46_im <= -106000000.0) tmp = x_46_im / y_46_im; elseif (y_46_im <= 1.36e-19) tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_46_re) / y_46_re)); elseif (y_46_im <= 13000000000000.0) tmp = (x_46_im * y_46_im) / t_0; elseif (y_46_im <= 7.5e+30) tmp = (x_46_re * y_46_re) / t_0; else tmp = x_46_im / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -106000000.0], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.36e-19], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(y$46$im * N[(N[(x$46$im / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 13000000000000.0], N[(N[(x$46$im * y$46$im), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[y$46$im, 7.5e+30], N[(N[(x$46$re * y$46$re), $MachinePrecision] / t$95$0), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot y.re + y.im \cdot y.im\\
\mathbf{if}\;y.im \leq -106000000:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 1.36 \cdot 10^{-19}:\\
\;\;\;\;\frac{x.re}{y.re} + y.im \cdot \frac{\frac{x.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 13000000000000:\\
\;\;\;\;\frac{x.im \cdot y.im}{t_0}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+30}:\\
\;\;\;\;\frac{x.re \cdot y.re}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -1.06e8 or 7.49999999999999973e30 < y.im Initial program 55.5%
Taylor expanded in y.re around 0 77.7%
if -1.06e8 < y.im < 1.3599999999999999e-19Initial program 73.5%
Taylor expanded in y.re around inf 70.5%
associate-/l*69.9%
associate-/r/66.5%
Simplified66.5%
*-un-lft-identity66.5%
pow266.5%
times-frac70.2%
Applied egg-rr70.2%
associate-*l/70.3%
*-un-lft-identity70.3%
Applied egg-rr70.3%
if 1.3599999999999999e-19 < y.im < 1.3e13Initial program 99.0%
Taylor expanded in x.re around 0 85.4%
if 1.3e13 < y.im < 7.49999999999999973e30Initial program 75.0%
Taylor expanded in x.re around inf 75.0%
*-commutative75.0%
Simplified75.0%
Final simplification74.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.8e-69) (not (<= y.im 2e-76))) (* (/ -1.0 y.im) (- (- x.im) (/ x.re (/ y.im y.re)))) (+ (/ x.re y.re) (* y.im (/ (/ x.im y.re) y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.8e-69) || !(y_46_im <= 2e-76)) {
tmp = (-1.0 / y_46_im) * (-x_46_im - (x_46_re / (y_46_im / y_46_re)));
} else {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_46_re) / y_46_re));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-1.8d-69)) .or. (.not. (y_46im <= 2d-76))) then
tmp = ((-1.0d0) / y_46im) * (-x_46im - (x_46re / (y_46im / y_46re)))
else
tmp = (x_46re / y_46re) + (y_46im * ((x_46im / y_46re) / y_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.8e-69) || !(y_46_im <= 2e-76)) {
tmp = (-1.0 / y_46_im) * (-x_46_im - (x_46_re / (y_46_im / y_46_re)));
} else {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_46_re) / y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.8e-69) or not (y_46_im <= 2e-76): tmp = (-1.0 / y_46_im) * (-x_46_im - (x_46_re / (y_46_im / y_46_re))) else: tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_46_re) / y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.8e-69) || !(y_46_im <= 2e-76)) tmp = Float64(Float64(-1.0 / y_46_im) * Float64(Float64(-x_46_im) - Float64(x_46_re / Float64(y_46_im / y_46_re)))); else tmp = Float64(Float64(x_46_re / y_46_re) + Float64(y_46_im * Float64(Float64(x_46_im / y_46_re) / y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.8e-69) || ~((y_46_im <= 2e-76))) tmp = (-1.0 / y_46_im) * (-x_46_im - (x_46_re / (y_46_im / y_46_re))); else tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_46_re) / y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.8e-69], N[Not[LessEqual[y$46$im, 2e-76]], $MachinePrecision]], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[((-x$46$im) - N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(y$46$im * N[(N[(x$46$im / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.8 \cdot 10^{-69} \lor \neg \left(y.im \leq 2 \cdot 10^{-76}\right):\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(\left(-x.im\right) - \frac{x.re}{\frac{y.im}{y.re}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re} + y.im \cdot \frac{\frac{x.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -1.80000000000000009e-69 or 1.99999999999999985e-76 < y.im Initial program 62.4%
*-un-lft-identity62.4%
add-sqr-sqrt62.4%
times-frac62.4%
hypot-def62.4%
fma-def62.4%
hypot-def79.2%
Applied egg-rr79.2%
Taylor expanded in y.im around -inf 47.1%
mul-1-neg47.1%
unsub-neg47.1%
neg-mul-147.1%
associate-/l*47.8%
Simplified47.8%
Taylor expanded in y.im around -inf 80.2%
if -1.80000000000000009e-69 < y.im < 1.99999999999999985e-76Initial program 72.5%
Taylor expanded in y.re around inf 78.3%
associate-/l*77.6%
associate-/r/73.9%
Simplified73.9%
*-un-lft-identity73.9%
pow273.9%
times-frac79.0%
Applied egg-rr79.0%
associate-*l/79.0%
*-un-lft-identity79.0%
Applied egg-rr79.0%
Final simplification79.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4800.0) (not (<= y.im 8.6e-19))) (/ x.im y.im) (+ (/ x.re y.re) (* y.im (/ x.im (* y.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 <= -4800.0) || !(y_46_im <= 8.6e-19)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (x_46_re / y_46_re) + (y_46_im * (x_46_im / (y_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 <= (-4800.0d0)) .or. (.not. (y_46im <= 8.6d-19))) then
tmp = x_46im / y_46im
else
tmp = (x_46re / y_46re) + (y_46im * (x_46im / (y_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 <= -4800.0) || !(y_46_im <= 8.6e-19)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (x_46_re / y_46_re) + (y_46_im * (x_46_im / (y_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 <= -4800.0) or not (y_46_im <= 8.6e-19): tmp = x_46_im / y_46_im else: tmp = (x_46_re / y_46_re) + (y_46_im * (x_46_im / (y_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 <= -4800.0) || !(y_46_im <= 8.6e-19)) tmp = Float64(x_46_im / y_46_im); else tmp = Float64(Float64(x_46_re / y_46_re) + Float64(y_46_im * Float64(x_46_im / Float64(y_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 <= -4800.0) || ~((y_46_im <= 8.6e-19))) tmp = x_46_im / y_46_im; else tmp = (x_46_re / y_46_re) + (y_46_im * (x_46_im / (y_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, -4800.0], N[Not[LessEqual[y$46$im, 8.6e-19]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(y$46$im * N[(x$46$im / N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4800 \lor \neg \left(y.im \leq 8.6 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re} + y.im \cdot \frac{x.im}{y.re \cdot y.re}\\
\end{array}
\end{array}
if y.im < -4800 or 8.6e-19 < y.im Initial program 58.8%
Taylor expanded in y.re around 0 74.6%
if -4800 < y.im < 8.6e-19Initial program 73.5%
Taylor expanded in y.re around inf 70.5%
associate-/l*69.9%
associate-/r/66.5%
Simplified66.5%
pow266.5%
Applied egg-rr66.5%
Final simplification70.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -0.0037) (not (<= y.im 1.72e-18))) (/ x.im y.im) (+ (/ x.re y.re) (* y.im (/ (/ x.im y.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 <= -0.0037) || !(y_46_im <= 1.72e-18)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_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 <= (-0.0037d0)) .or. (.not. (y_46im <= 1.72d-18))) then
tmp = x_46im / y_46im
else
tmp = (x_46re / y_46re) + (y_46im * ((x_46im / y_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 <= -0.0037) || !(y_46_im <= 1.72e-18)) {
tmp = x_46_im / y_46_im;
} else {
tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_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 <= -0.0037) or not (y_46_im <= 1.72e-18): tmp = x_46_im / y_46_im else: tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_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 <= -0.0037) || !(y_46_im <= 1.72e-18)) tmp = Float64(x_46_im / y_46_im); else tmp = Float64(Float64(x_46_re / y_46_re) + Float64(y_46_im * Float64(Float64(x_46_im / y_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 <= -0.0037) || ~((y_46_im <= 1.72e-18))) tmp = x_46_im / y_46_im; else tmp = (x_46_re / y_46_re) + (y_46_im * ((x_46_im / y_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, -0.0037], N[Not[LessEqual[y$46$im, 1.72e-18]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(y$46$im * N[(N[(x$46$im / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -0.0037 \lor \neg \left(y.im \leq 1.72 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re} + y.im \cdot \frac{\frac{x.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -0.0037000000000000002 or 1.72e-18 < y.im Initial program 58.8%
Taylor expanded in y.re around 0 74.6%
if -0.0037000000000000002 < y.im < 1.72e-18Initial program 73.5%
Taylor expanded in y.re around inf 70.5%
associate-/l*69.9%
associate-/r/66.5%
Simplified66.5%
*-un-lft-identity66.5%
pow266.5%
times-frac70.2%
Applied egg-rr70.2%
associate-*l/70.3%
*-un-lft-identity70.3%
Applied egg-rr70.3%
Final simplification72.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -8.5e-5) (not (<= y.im 1.22e-19))) (/ 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.5e-5) || !(y_46_im <= 1.22e-19)) {
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.5d-5)) .or. (.not. (y_46im <= 1.22d-19))) 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.5e-5) || !(y_46_im <= 1.22e-19)) {
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.5e-5) or not (y_46_im <= 1.22e-19): 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.5e-5) || !(y_46_im <= 1.22e-19)) 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.5e-5) || ~((y_46_im <= 1.22e-19))) 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.5e-5], N[Not[LessEqual[y$46$im, 1.22e-19]], $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.5 \cdot 10^{-5} \lor \neg \left(y.im \leq 1.22 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -8.500000000000001e-5 or 1.2200000000000001e-19 < y.im Initial program 58.8%
Taylor expanded in y.re around 0 74.6%
if -8.500000000000001e-5 < y.im < 1.2200000000000001e-19Initial program 73.5%
Taylor expanded in y.re around inf 58.1%
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 66.1%
Taylor expanded in y.re around 0 47.4%
Final simplification47.4%
herbie shell --seed 2023320
(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))))