
(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) (* (/ y.im y.re) (/ x.im y.re))))
(t_1
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -7e-55)
(* (+ x.im (* x.re (/ y.re y.im))) (/ -1.0 (hypot y.re y.im)))
(if (<= y.im 2e-144)
t_0
(if (<= y.im 7.6e-15)
t_1
(if (<= y.im 4.2e+26)
t_0
(if (<= y.im 1.05e+120)
t_1
(+ (/ x.im y.im) (/ (/ x.re (/ y.im 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) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
double t_1 = ((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-55) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) * (-1.0 / hypot(y_46_re, y_46_im));
} else if (y_46_im <= 2e-144) {
tmp = t_0;
} else if (y_46_im <= 7.6e-15) {
tmp = t_1;
} else if (y_46_im <= 4.2e+26) {
tmp = t_0;
} else if (y_46_im <= 1.05e+120) {
tmp = t_1;
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re / (y_46_im / 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) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
double t_1 = ((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-55) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) * (-1.0 / Math.hypot(y_46_re, y_46_im));
} else if (y_46_im <= 2e-144) {
tmp = t_0;
} else if (y_46_im <= 7.6e-15) {
tmp = t_1;
} else if (y_46_im <= 4.2e+26) {
tmp = t_0;
} else if (y_46_im <= 1.05e+120) {
tmp = t_1;
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re / (y_46_im / 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) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)) t_1 = ((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-55: tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) * (-1.0 / math.hypot(y_46_re, y_46_im)) elif y_46_im <= 2e-144: tmp = t_0 elif y_46_im <= 7.6e-15: tmp = t_1 elif y_46_im <= 4.2e+26: tmp = t_0 elif y_46_im <= 1.05e+120: tmp = t_1 else: tmp = (x_46_im / y_46_im) + ((x_46_re / (y_46_im / 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(Float64(y_46_im / y_46_re) * Float64(x_46_im / y_46_re))) t_1 = 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-55) tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) * Float64(-1.0 / hypot(y_46_re, y_46_im))); elseif (y_46_im <= 2e-144) tmp = t_0; elseif (y_46_im <= 7.6e-15) tmp = t_1; elseif (y_46_im <= 4.2e+26) tmp = t_0; elseif (y_46_im <= 1.05e+120) tmp = t_1; else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(x_46_re / Float64(y_46_im / 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) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)); t_1 = ((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-55) tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) * (-1.0 / hypot(y_46_re, y_46_im)); elseif (y_46_im <= 2e-144) tmp = t_0; elseif (y_46_im <= 7.6e-15) tmp = t_1; elseif (y_46_im <= 4.2e+26) tmp = t_0; elseif (y_46_im <= 1.05e+120) tmp = t_1; else tmp = (x_46_im / y_46_im) + ((x_46_re / (y_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_] := Block[{t$95$0 = N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im / y$46$re), $MachinePrecision] * N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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-55], N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2e-144], t$95$0, If[LessEqual[y$46$im, 7.6e-15], t$95$1, If[LessEqual[y$46$im, 4.2e+26], t$95$0, If[LessEqual[y$46$im, 1.05e+120], t$95$1, N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\
t_1 := \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^{-55}:\\
\;\;\;\;\left(x.im + x.re \cdot \frac{y.re}{y.im}\right) \cdot \frac{-1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{-144}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 7.6 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 4.2 \cdot 10^{+26}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.05 \cdot 10^{+120}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{\frac{x.re}{\frac{y.im}{y.re}}}{y.im}\\
\end{array}
\end{array}
if y.im < -7.00000000000000051e-55Initial program 49.1%
*-un-lft-identity49.1%
add-sqr-sqrt49.1%
times-frac49.1%
hypot-def49.1%
fma-def49.1%
hypot-def62.0%
Applied egg-rr62.0%
Taylor expanded in y.im around -inf 74.4%
neg-mul-174.4%
+-commutative74.4%
mul-1-neg74.4%
unsub-neg74.4%
*-lft-identity74.4%
times-frac81.1%
/-rgt-identity81.1%
Simplified81.1%
if -7.00000000000000051e-55 < y.im < 1.9999999999999999e-144 or 7.6000000000000004e-15 < y.im < 4.2000000000000002e26Initial program 61.7%
Taylor expanded in y.re around inf 86.7%
unpow286.7%
times-frac89.5%
Simplified89.5%
if 1.9999999999999999e-144 < y.im < 7.6000000000000004e-15 or 4.2000000000000002e26 < y.im < 1.05e120Initial program 81.0%
if 1.05e120 < y.im Initial program 32.3%
Taylor expanded in y.re around 0 80.6%
+-commutative80.6%
unpow280.6%
associate-/l*80.7%
Simplified80.7%
clear-num80.7%
inv-pow80.7%
associate-/l*82.7%
Applied egg-rr82.7%
unpow-182.7%
associate-/l/90.3%
Simplified90.3%
frac-2neg90.3%
metadata-eval90.3%
div-inv90.3%
distribute-neg-frac90.3%
Applied egg-rr90.3%
mul-1-neg90.3%
associate-/r/90.4%
associate-*r*90.3%
distribute-rgt-neg-out90.3%
distribute-neg-frac90.3%
associate-*r/90.3%
associate-*l/90.4%
*-lft-identity90.4%
/-rgt-identity90.4%
distribute-neg-frac90.4%
times-frac86.4%
*-rgt-identity86.4%
associate-/l*90.4%
neg-mul-190.4%
neg-mul-190.4%
times-frac90.4%
metadata-eval90.4%
Simplified90.4%
Final simplification85.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)))
2e+302)
(*
(/ 1.0 (hypot y.re y.im))
(/ (fma x.re y.re (* x.im y.im)) (hypot y.re y.im)))
(+ (/ x.im y.im) (* (/ y.re y.im) (/ x.re y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double 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))) <= 2e+302) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (fma(x_46_re, y_46_re, (x_46_im * y_46_im)) / hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) 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))) <= 2e+302) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(fma(x_46_re, y_46_re, Float64(x_46_im * y_46_im)) / hypot(y_46_re, y_46_im))); else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(y_46_re / y_46_im) * 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], 2e+302], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * 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]), $MachinePrecision], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$re / y$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 2 \cdot 10^{+302}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.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))) < 2.0000000000000002e302Initial program 75.1%
*-un-lft-identity75.1%
add-sqr-sqrt75.1%
times-frac75.1%
hypot-def75.1%
fma-def75.1%
hypot-def94.9%
Applied egg-rr94.9%
if 2.0000000000000002e302 < (/.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 8.6%
Taylor expanded in y.re around 0 46.9%
+-commutative46.9%
*-commutative46.9%
unpow246.9%
times-frac59.8%
Simplified59.8%
Final simplification85.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (/ x.re y.re) (* (/ y.im y.re) (/ x.im y.re))))
(t_1
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -2.9e-55)
(+ (/ x.im y.im) (/ 1.0 (* y.im (/ (/ y.im x.re) y.re))))
(if (<= y.im 1.95e-143)
t_0
(if (<= y.im 3.4e-15)
t_1
(if (<= y.im 8.8e+27)
t_0
(if (<= y.im 4.6e+118)
t_1
(+ (/ x.im y.im) (/ (/ x.re (/ y.im 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) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
double t_1 = ((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.9e-55) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im * ((y_46_im / x_46_re) / y_46_re)));
} else if (y_46_im <= 1.95e-143) {
tmp = t_0;
} else if (y_46_im <= 3.4e-15) {
tmp = t_1;
} else if (y_46_im <= 8.8e+27) {
tmp = t_0;
} else if (y_46_im <= 4.6e+118) {
tmp = t_1;
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re / (y_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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x_46re / y_46re) + ((y_46im / y_46re) * (x_46im / y_46re))
t_1 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46im <= (-2.9d-55)) then
tmp = (x_46im / y_46im) + (1.0d0 / (y_46im * ((y_46im / x_46re) / y_46re)))
else if (y_46im <= 1.95d-143) then
tmp = t_0
else if (y_46im <= 3.4d-15) then
tmp = t_1
else if (y_46im <= 8.8d+27) then
tmp = t_0
else if (y_46im <= 4.6d+118) then
tmp = t_1
else
tmp = (x_46im / y_46im) + ((x_46re / (y_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 t_0 = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
double t_1 = ((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.9e-55) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im * ((y_46_im / x_46_re) / y_46_re)));
} else if (y_46_im <= 1.95e-143) {
tmp = t_0;
} else if (y_46_im <= 3.4e-15) {
tmp = t_1;
} else if (y_46_im <= 8.8e+27) {
tmp = t_0;
} else if (y_46_im <= 4.6e+118) {
tmp = t_1;
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re / (y_46_im / 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) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)) t_1 = ((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.9e-55: tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im * ((y_46_im / x_46_re) / y_46_re))) elif y_46_im <= 1.95e-143: tmp = t_0 elif y_46_im <= 3.4e-15: tmp = t_1 elif y_46_im <= 8.8e+27: tmp = t_0 elif y_46_im <= 4.6e+118: tmp = t_1 else: tmp = (x_46_im / y_46_im) + ((x_46_re / (y_46_im / 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(Float64(y_46_im / y_46_re) * Float64(x_46_im / y_46_re))) t_1 = 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.9e-55) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im * Float64(Float64(y_46_im / x_46_re) / y_46_re)))); elseif (y_46_im <= 1.95e-143) tmp = t_0; elseif (y_46_im <= 3.4e-15) tmp = t_1; elseif (y_46_im <= 8.8e+27) tmp = t_0; elseif (y_46_im <= 4.6e+118) tmp = t_1; else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(x_46_re / Float64(y_46_im / 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) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)); t_1 = ((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.9e-55) tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im * ((y_46_im / x_46_re) / y_46_re))); elseif (y_46_im <= 1.95e-143) tmp = t_0; elseif (y_46_im <= 3.4e-15) tmp = t_1; elseif (y_46_im <= 8.8e+27) tmp = t_0; elseif (y_46_im <= 4.6e+118) tmp = t_1; else tmp = (x_46_im / y_46_im) + ((x_46_re / (y_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_] := Block[{t$95$0 = N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im / y$46$re), $MachinePrecision] * N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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.9e-55], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im * N[(N[(y$46$im / x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.95e-143], t$95$0, If[LessEqual[y$46$im, 3.4e-15], t$95$1, If[LessEqual[y$46$im, 8.8e+27], t$95$0, If[LessEqual[y$46$im, 4.6e+118], t$95$1, N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\
t_1 := \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.9 \cdot 10^{-55}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{1}{y.im \cdot \frac{\frac{y.im}{x.re}}{y.re}}\\
\mathbf{elif}\;y.im \leq 1.95 \cdot 10^{-143}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 3.4 \cdot 10^{-15}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 8.8 \cdot 10^{+27}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 4.6 \cdot 10^{+118}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{\frac{x.re}{\frac{y.im}{y.re}}}{y.im}\\
\end{array}
\end{array}
if y.im < -2.9e-55Initial program 49.1%
Taylor expanded in y.re around 0 67.7%
+-commutative67.7%
unpow267.7%
associate-/l*69.5%
Simplified69.5%
clear-num69.4%
inv-pow69.4%
associate-/l*74.0%
Applied egg-rr74.0%
unpow-174.0%
associate-/l/77.9%
Simplified77.9%
associate-/r*79.3%
associate-/r/79.3%
Applied egg-rr79.3%
if -2.9e-55 < y.im < 1.95000000000000002e-143 or 3.4e-15 < y.im < 8.7999999999999995e27Initial program 61.7%
Taylor expanded in y.re around inf 86.7%
unpow286.7%
times-frac89.5%
Simplified89.5%
if 1.95000000000000002e-143 < y.im < 3.4e-15 or 8.7999999999999995e27 < y.im < 4.60000000000000032e118Initial program 81.0%
if 4.60000000000000032e118 < y.im Initial program 32.3%
Taylor expanded in y.re around 0 80.6%
+-commutative80.6%
unpow280.6%
associate-/l*80.7%
Simplified80.7%
clear-num80.7%
inv-pow80.7%
associate-/l*82.7%
Applied egg-rr82.7%
unpow-182.7%
associate-/l/90.3%
Simplified90.3%
frac-2neg90.3%
metadata-eval90.3%
div-inv90.3%
distribute-neg-frac90.3%
Applied egg-rr90.3%
mul-1-neg90.3%
associate-/r/90.4%
associate-*r*90.3%
distribute-rgt-neg-out90.3%
distribute-neg-frac90.3%
associate-*r/90.3%
associate-*l/90.4%
*-lft-identity90.4%
/-rgt-identity90.4%
distribute-neg-frac90.4%
times-frac86.4%
*-rgt-identity86.4%
associate-/l*90.4%
neg-mul-190.4%
neg-mul-190.4%
times-frac90.4%
metadata-eval90.4%
Simplified90.4%
Final simplification85.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.8e-57) (not (<= y.im 6.5e+30))) (+ (/ x.im y.im) (/ 1.0 (* y.im (/ (/ y.im x.re) y.re)))) (+ (/ x.re y.re) (* (/ y.im y.re) (/ x.im y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -3.8e-57) || !(y_46_im <= 6.5e+30)) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im * ((y_46_im / x_46_re) / y_46_re)));
} else {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-3.8d-57)) .or. (.not. (y_46im <= 6.5d+30))) then
tmp = (x_46im / y_46im) + (1.0d0 / (y_46im * ((y_46im / x_46re) / y_46re)))
else
tmp = (x_46re / y_46re) + ((y_46im / y_46re) * (x_46im / y_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -3.8e-57) || !(y_46_im <= 6.5e+30)) {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im * ((y_46_im / x_46_re) / y_46_re)));
} else {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -3.8e-57) or not (y_46_im <= 6.5e+30): tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im * ((y_46_im / x_46_re) / y_46_re))) else: tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -3.8e-57) || !(y_46_im <= 6.5e+30)) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im * Float64(Float64(y_46_im / x_46_re) / y_46_re)))); else tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im / y_46_re) * Float64(x_46_im / y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -3.8e-57) || ~((y_46_im <= 6.5e+30))) tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im * ((y_46_im / x_46_re) / y_46_re))); else tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -3.8e-57], N[Not[LessEqual[y$46$im, 6.5e+30]], $MachinePrecision]], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im * N[(N[(y$46$im / x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im / y$46$re), $MachinePrecision] * N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.8 \cdot 10^{-57} \lor \neg \left(y.im \leq 6.5 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{x.im}{y.im} + \frac{1}{y.im \cdot \frac{\frac{y.im}{x.re}}{y.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -3.7999999999999997e-57 or 6.5e30 < y.im Initial program 47.4%
Taylor expanded in y.re around 0 71.8%
+-commutative71.8%
unpow271.8%
associate-/l*72.2%
Simplified72.2%
clear-num72.1%
inv-pow72.1%
associate-/l*75.2%
Applied egg-rr75.2%
unpow-175.2%
associate-/l/79.9%
Simplified79.9%
associate-/r*80.6%
associate-/r/81.3%
Applied egg-rr81.3%
if -3.7999999999999997e-57 < y.im < 6.5e30Initial program 67.3%
Taylor expanded in y.re around inf 79.5%
unpow279.5%
times-frac81.8%
Simplified81.8%
Final simplification81.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3e-55) (not (<= y.im 5.3e+26))) (+ (/ x.im y.im) (* (/ y.re y.im) (/ 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 <= -3e-55) || !(y_46_im <= 5.3e+26)) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (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 <= (-3d-55)) .or. (.not. (y_46im <= 5.3d+26))) then
tmp = (x_46im / y_46im) + ((y_46re / y_46im) * (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 <= -3e-55) || !(y_46_im <= 5.3e+26)) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (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 <= -3e-55) or not (y_46_im <= 5.3e+26): tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (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 <= -3e-55) || !(y_46_im <= 5.3e+26)) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(y_46_re / y_46_im) * 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 <= -3e-55) || ~((y_46_im <= 5.3e+26))) tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (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, -3e-55], N[Not[LessEqual[y$46$im, 5.3e+26]], $MachinePrecision]], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3 \cdot 10^{-55} \lor \neg \left(y.im \leq 5.3 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -3.00000000000000016e-55 or 5.29999999999999969e26 < y.im Initial program 47.4%
Taylor expanded in y.re around 0 71.8%
+-commutative71.8%
*-commutative71.8%
unpow271.8%
times-frac80.6%
Simplified80.6%
if -3.00000000000000016e-55 < y.im < 5.29999999999999969e26Initial program 67.3%
Taylor expanded in y.re around inf 68.4%
Final simplification75.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1e-54) (not (<= y.im 1.9e+30))) (+ (/ x.im y.im) (* (/ y.re y.im) (/ x.re y.im))) (+ (/ x.re y.re) (* (/ y.im y.re) (/ x.im y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1e-54) || !(y_46_im <= 1.9e+30)) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-1d-54)) .or. (.not. (y_46im <= 1.9d+30))) then
tmp = (x_46im / y_46im) + ((y_46re / y_46im) * (x_46re / y_46im))
else
tmp = (x_46re / y_46re) + ((y_46im / y_46re) * (x_46im / y_46re))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1e-54) || !(y_46_im <= 1.9e+30)) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1e-54) or not (y_46_im <= 1.9e+30): tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)) else: tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1e-54) || !(y_46_im <= 1.9e+30)) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(y_46_re / y_46_im) * Float64(x_46_re / y_46_im))); else tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im / y_46_re) * Float64(x_46_im / y_46_re))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1e-54) || ~((y_46_im <= 1.9e+30))) tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)); else tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1e-54], N[Not[LessEqual[y$46$im, 1.9e+30]], $MachinePrecision]], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im / y$46$re), $MachinePrecision] * N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1 \cdot 10^{-54} \lor \neg \left(y.im \leq 1.9 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1e-54 or 1.9000000000000001e30 < y.im Initial program 47.4%
Taylor expanded in y.re around 0 71.8%
+-commutative71.8%
*-commutative71.8%
unpow271.8%
times-frac80.6%
Simplified80.6%
if -1e-54 < y.im < 1.9000000000000001e30Initial program 67.3%
Taylor expanded in y.re around inf 79.5%
unpow279.5%
times-frac81.8%
Simplified81.8%
Final simplification81.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -3.5e+69)
(/ x.im y.im)
(if (<= y.im -1.35e-30)
(* y.re (/ x.re (+ (* y.re y.re) (* y.im y.im))))
(if (<= y.im -5.8e-55)
(/ x.im y.im)
(if (<= y.im 1.3e+30) (/ 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 <= -3.5e+69) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -1.35e-30) {
tmp = y_46_re * (x_46_re / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
} else if (y_46_im <= -5.8e-55) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.3e+30) {
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 <= (-3.5d+69)) then
tmp = x_46im / y_46im
else if (y_46im <= (-1.35d-30)) then
tmp = y_46re * (x_46re / ((y_46re * y_46re) + (y_46im * y_46im)))
else if (y_46im <= (-5.8d-55)) then
tmp = x_46im / y_46im
else if (y_46im <= 1.3d+30) 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 <= -3.5e+69) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -1.35e-30) {
tmp = y_46_re * (x_46_re / ((y_46_re * y_46_re) + (y_46_im * y_46_im)));
} else if (y_46_im <= -5.8e-55) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.3e+30) {
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 <= -3.5e+69: tmp = x_46_im / y_46_im elif y_46_im <= -1.35e-30: tmp = y_46_re * (x_46_re / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) elif y_46_im <= -5.8e-55: tmp = x_46_im / y_46_im elif y_46_im <= 1.3e+30: 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 <= -3.5e+69) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -1.35e-30) tmp = Float64(y_46_re * Float64(x_46_re / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))); elseif (y_46_im <= -5.8e-55) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 1.3e+30) 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 <= -3.5e+69) tmp = x_46_im / y_46_im; elseif (y_46_im <= -1.35e-30) tmp = y_46_re * (x_46_re / ((y_46_re * y_46_re) + (y_46_im * y_46_im))); elseif (y_46_im <= -5.8e-55) tmp = x_46_im / y_46_im; elseif (y_46_im <= 1.3e+30) 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, -3.5e+69], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -1.35e-30], N[(y$46$re * N[(x$46$re / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -5.8e-55], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.3e+30], 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 -3.5 \cdot 10^{+69}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -1.35 \cdot 10^{-30}:\\
\;\;\;\;y.re \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq -5.8 \cdot 10^{-55}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 1.3 \cdot 10^{+30}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -3.49999999999999987e69 or -1.34999999999999994e-30 < y.im < -5.8e-55 or 1.29999999999999994e30 < y.im Initial program 44.3%
Taylor expanded in y.re around 0 73.0%
if -3.49999999999999987e69 < y.im < -1.34999999999999994e-30Initial program 65.7%
Taylor expanded in x.re around inf 46.2%
associate-/l*47.1%
associate-/r/46.8%
unpow246.8%
unpow246.8%
+-commutative46.8%
fma-udef46.8%
Simplified46.8%
fma-udef46.8%
+-commutative46.8%
Applied egg-rr46.8%
if -5.8e-55 < y.im < 1.29999999999999994e30Initial program 67.3%
Taylor expanded in y.re around inf 68.4%
Final simplification68.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -3.1e+24)
(and (not (<= y.im -1.6e-30))
(or (<= y.im -1.05e-54) (not (<= y.im 1.05e+30)))))
(/ 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 <= -3.1e+24) || (!(y_46_im <= -1.6e-30) && ((y_46_im <= -1.05e-54) || !(y_46_im <= 1.05e+30)))) {
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 <= (-3.1d+24)) .or. (.not. (y_46im <= (-1.6d-30))) .and. (y_46im <= (-1.05d-54)) .or. (.not. (y_46im <= 1.05d+30))) 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 <= -3.1e+24) || (!(y_46_im <= -1.6e-30) && ((y_46_im <= -1.05e-54) || !(y_46_im <= 1.05e+30)))) {
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 <= -3.1e+24) or (not (y_46_im <= -1.6e-30) and ((y_46_im <= -1.05e-54) or not (y_46_im <= 1.05e+30))): 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 <= -3.1e+24) || (!(y_46_im <= -1.6e-30) && ((y_46_im <= -1.05e-54) || !(y_46_im <= 1.05e+30)))) 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 <= -3.1e+24) || (~((y_46_im <= -1.6e-30)) && ((y_46_im <= -1.05e-54) || ~((y_46_im <= 1.05e+30))))) 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, -3.1e+24], And[N[Not[LessEqual[y$46$im, -1.6e-30]], $MachinePrecision], Or[LessEqual[y$46$im, -1.05e-54], N[Not[LessEqual[y$46$im, 1.05e+30]], $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 -3.1 \cdot 10^{+24} \lor \neg \left(y.im \leq -1.6 \cdot 10^{-30}\right) \land \left(y.im \leq -1.05 \cdot 10^{-54} \lor \neg \left(y.im \leq 1.05 \cdot 10^{+30}\right)\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -3.10000000000000011e24 or -1.6e-30 < y.im < -1.05e-54 or 1.05e30 < y.im Initial program 46.7%
Taylor expanded in y.re around 0 69.7%
if -3.10000000000000011e24 < y.im < -1.6e-30 or -1.05e-54 < y.im < 1.05e30Initial program 66.2%
Taylor expanded in y.re around inf 68.1%
Final simplification68.9%
(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 56.4%
Taylor expanded in y.re around 0 43.5%
Final simplification43.5%
herbie shell --seed 2023188
(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))))