
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
1e+269)
(*
(/ 1.0 (hypot y.re y.im))
(/ (fma x.re y.re (* x.im y.im)) (hypot y.re y.im)))
(/ (+ x.re (* x.im (/ y.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 ((((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+269) {
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_re + (x_46_im * (y_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 (Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 1e+269) 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_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / 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], 1e+269], 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$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leq 10^{+269}:\\
\;\;\;\;\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.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\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))) < 1e269Initial program 75.6%
*-un-lft-identity75.6%
associate-*r/75.6%
fma-define75.6%
add-sqr-sqrt75.6%
times-frac75.5%
fma-define75.5%
hypot-define75.5%
fma-define75.5%
fma-define75.5%
hypot-define94.5%
Applied egg-rr94.5%
if 1e269 < (/.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 11.8%
Taylor expanded in y.re around inf 60.1%
associate-/l*70.3%
Simplified70.3%
Final simplification88.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re y.re) (* x.im y.im))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 1e+269)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(/ (+ x.re (* x.im (/ y.im y.re))) 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);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+269) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / 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);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+269) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (t_0 / Math.hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / 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) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+269: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (t_0 / math.hypot(y_46_re, y_46_im)) else: tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 1e+269) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); else tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_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) t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 1e+269) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im)); else tmp = (x_46_re + (x_46_im * (y_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_] := Block[{t$95$0 = N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+269], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot y.re + x.im \cdot y.im\\
\mathbf{if}\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 10^{+269}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\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))) < 1e269Initial program 75.6%
*-un-lft-identity75.6%
associate-*r/75.6%
fma-define75.6%
add-sqr-sqrt75.6%
times-frac75.5%
fma-define75.5%
hypot-define75.5%
fma-define75.5%
fma-define75.5%
hypot-define94.5%
Applied egg-rr94.5%
fma-define94.5%
Applied egg-rr94.5%
if 1e269 < (/.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 11.8%
Taylor expanded in y.re around inf 60.1%
associate-/l*70.3%
Simplified70.3%
Final simplification88.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -2.5e+44)
(/ (+ x.im (* y.re (/ x.re y.im))) y.im)
(if (<= y.im -2.1e-55)
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 7.5e-62)
(/ (+ x.re (/ 1.0 (/ (/ y.re x.im) y.im))) y.re)
(if (<= y.im 1.3e+123)
(/ (fma x.re y.re (* x.im y.im)) (fma y.re y.re (* y.im y.im)))
(/ (+ x.im (* x.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) {
double tmp;
if (y_46_im <= -2.5e+44) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else if (y_46_im <= -2.1e-55) {
tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 7.5e-62) {
tmp = (x_46_re + (1.0 / ((y_46_re / x_46_im) / y_46_im))) / y_46_re;
} else if (y_46_im <= 1.3e+123) {
tmp = fma(x_46_re, y_46_re, (x_46_im * y_46_im)) / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -2.5e+44) tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) / y_46_im); elseif (y_46_im <= -2.1e-55) tmp = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 7.5e-62) tmp = Float64(Float64(x_46_re + Float64(1.0 / Float64(Float64(y_46_re / x_46_im) / y_46_im))) / y_46_re); elseif (y_46_im <= 1.3e+123) tmp = Float64(fma(x_46_re, y_46_re, Float64(x_46_im * y_46_im)) / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -2.5e+44], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -2.1e-55], 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, 7.5e-62], N[(N[(x$46$re + N[(1.0 / N[(N[(y$46$re / x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.3e+123], N[(N[(x$46$re * y$46$re + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.5 \cdot 10^{+44}:\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\mathbf{elif}\;y.im \leq -2.1 \cdot 10^{-55}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{x.re + \frac{1}{\frac{\frac{y.re}{x.im}}{y.im}}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.3 \cdot 10^{+123}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.im < -2.4999999999999998e44Initial program 40.7%
Taylor expanded in y.im around inf 70.4%
associate-/l*72.6%
Applied egg-rr72.6%
*-commutative72.6%
associate-*l/70.4%
associate-*r/76.8%
Simplified76.8%
if -2.4999999999999998e44 < y.im < -2.1000000000000002e-55Initial program 77.3%
if -2.1000000000000002e-55 < y.im < 7.5000000000000003e-62Initial program 63.5%
Taylor expanded in y.re around inf 89.3%
associate-/l*88.7%
Simplified88.7%
associate-*r/89.3%
clear-num89.4%
Applied egg-rr89.4%
associate-/r*89.5%
Simplified89.5%
if 7.5000000000000003e-62 < y.im < 1.29999999999999993e123Initial program 77.7%
fma-define77.8%
fma-define77.8%
Simplified77.8%
if 1.29999999999999993e123 < y.im Initial program 36.2%
Taylor expanded in y.im around inf 84.1%
associate-/l*93.7%
Simplified93.7%
Final simplification84.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)))))
(if (<= y.im -2.5e+44)
(/ (+ x.im (* y.re (/ x.re y.im))) y.im)
(if (<= y.im -2.35e-51)
t_0
(if (<= y.im 1e-61)
(/ (+ x.re (/ 1.0 (/ (/ y.re x.im) y.im))) y.re)
(if (<= y.im 1.25e+126)
t_0
(/ (+ x.im (* x.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) {
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.5e+44) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else if (y_46_im <= -2.35e-51) {
tmp = t_0;
} else if (y_46_im <= 1e-61) {
tmp = (x_46_re + (1.0 / ((y_46_re / x_46_im) / y_46_im))) / y_46_re;
} else if (y_46_im <= 1.25e+126) {
tmp = t_0;
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46im <= (-2.5d+44)) then
tmp = (x_46im + (y_46re * (x_46re / y_46im))) / y_46im
else if (y_46im <= (-2.35d-51)) then
tmp = t_0
else if (y_46im <= 1d-61) then
tmp = (x_46re + (1.0d0 / ((y_46re / x_46im) / y_46im))) / y_46re
else if (y_46im <= 1.25d+126) then
tmp = t_0
else
tmp = (x_46im + (x_46re * (y_46re / y_46im))) / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (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.5e+44) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else if (y_46_im <= -2.35e-51) {
tmp = t_0;
} else if (y_46_im <= 1e-61) {
tmp = (x_46_re + (1.0 / ((y_46_re / x_46_im) / y_46_im))) / y_46_re;
} else if (y_46_im <= 1.25e+126) {
tmp = t_0;
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (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.5e+44: tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im elif y_46_im <= -2.35e-51: tmp = t_0 elif y_46_im <= 1e-61: tmp = (x_46_re + (1.0 / ((y_46_re / x_46_im) / y_46_im))) / y_46_re elif y_46_im <= 1.25e+126: tmp = t_0 else: tmp = (x_46_im + (x_46_re * (y_46_re / y_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(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.5e+44) tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) / y_46_im); elseif (y_46_im <= -2.35e-51) tmp = t_0; elseif (y_46_im <= 1e-61) tmp = Float64(Float64(x_46_re + Float64(1.0 / Float64(Float64(y_46_re / x_46_im) / y_46_im))) / y_46_re); elseif (y_46_im <= 1.25e+126) tmp = t_0; else tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (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.5e+44) tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im; elseif (y_46_im <= -2.35e-51) tmp = t_0; elseif (y_46_im <= 1e-61) tmp = (x_46_re + (1.0 / ((y_46_re / x_46_im) / y_46_im))) / y_46_re; elseif (y_46_im <= 1.25e+126) tmp = t_0; else tmp = (x_46_im + (x_46_re * (y_46_re / y_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[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.5e+44], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -2.35e-51], t$95$0, If[LessEqual[y$46$im, 1e-61], N[(N[(x$46$re + N[(1.0 / N[(N[(y$46$re / x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.25e+126], t$95$0, N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $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.5 \cdot 10^{+44}:\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\mathbf{elif}\;y.im \leq -2.35 \cdot 10^{-51}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 10^{-61}:\\
\;\;\;\;\frac{x.re + \frac{1}{\frac{\frac{y.re}{x.im}}{y.im}}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.25 \cdot 10^{+126}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.im < -2.4999999999999998e44Initial program 40.7%
Taylor expanded in y.im around inf 70.4%
associate-/l*72.6%
Applied egg-rr72.6%
*-commutative72.6%
associate-*l/70.4%
associate-*r/76.8%
Simplified76.8%
if -2.4999999999999998e44 < y.im < -2.3499999999999999e-51 or 1e-61 < y.im < 1.24999999999999994e126Initial program 77.6%
if -2.3499999999999999e-51 < y.im < 1e-61Initial program 63.5%
Taylor expanded in y.re around inf 89.3%
associate-/l*88.7%
Simplified88.7%
associate-*r/89.3%
clear-num89.4%
Applied egg-rr89.4%
associate-/r*89.5%
Simplified89.5%
if 1.24999999999999994e126 < y.im Initial program 36.2%
Taylor expanded in y.im around inf 84.1%
associate-/l*93.7%
Simplified93.7%
Final simplification84.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4.5e-53) (not (<= y.im 5.6e-38))) (/ (+ x.im (* y.re (/ x.re y.im))) y.im) (/ (+ x.re (/ 1.0 (/ (/ y.re x.im) 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 ((y_46_im <= -4.5e-53) || !(y_46_im <= 5.6e-38)) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else {
tmp = (x_46_re + (1.0 / ((y_46_re / x_46_im) / 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) :: tmp
if ((y_46im <= (-4.5d-53)) .or. (.not. (y_46im <= 5.6d-38))) then
tmp = (x_46im + (y_46re * (x_46re / y_46im))) / y_46im
else
tmp = (x_46re + (1.0d0 / ((y_46re / x_46im) / 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 tmp;
if ((y_46_im <= -4.5e-53) || !(y_46_im <= 5.6e-38)) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else {
tmp = (x_46_re + (1.0 / ((y_46_re / x_46_im) / y_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 <= -4.5e-53) or not (y_46_im <= 5.6e-38): tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im else: tmp = (x_46_re + (1.0 / ((y_46_re / x_46_im) / 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 ((y_46_im <= -4.5e-53) || !(y_46_im <= 5.6e-38)) tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) / y_46_im); else tmp = Float64(Float64(x_46_re + Float64(1.0 / Float64(Float64(y_46_re / x_46_im) / 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) tmp = 0.0; if ((y_46_im <= -4.5e-53) || ~((y_46_im <= 5.6e-38))) tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im; else tmp = (x_46_re + (1.0 / ((y_46_re / x_46_im) / y_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, -4.5e-53], N[Not[LessEqual[y$46$im, 5.6e-38]], $MachinePrecision]], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$re + N[(1.0 / N[(N[(y$46$re / x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.5 \cdot 10^{-53} \lor \neg \left(y.im \leq 5.6 \cdot 10^{-38}\right):\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + \frac{1}{\frac{\frac{y.re}{x.im}}{y.im}}}{y.re}\\
\end{array}
\end{array}
if y.im < -4.49999999999999985e-53 or 5.6e-38 < y.im Initial program 56.1%
Taylor expanded in y.im around inf 68.3%
associate-/l*70.5%
Applied egg-rr70.5%
*-commutative70.5%
associate-*l/68.3%
associate-*r/71.8%
Simplified71.8%
if -4.49999999999999985e-53 < y.im < 5.6e-38Initial program 64.1%
Taylor expanded in y.re around inf 88.7%
associate-/l*88.1%
Simplified88.1%
associate-*r/88.7%
clear-num88.8%
Applied egg-rr88.8%
associate-/r*88.9%
Simplified88.9%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -56000000.0) (not (<= y.re 12500000000.0))) (/ x.re y.re) (/ (+ x.im (* x.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) {
double tmp;
if ((y_46_re <= -56000000.0) || !(y_46_re <= 12500000000.0)) {
tmp = x_46_re / y_46_re;
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_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_46re <= (-56000000.0d0)) .or. (.not. (y_46re <= 12500000000.0d0))) then
tmp = x_46re / y_46re
else
tmp = (x_46im + (x_46re * (y_46re / y_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_re <= -56000000.0) || !(y_46_re <= 12500000000.0)) {
tmp = x_46_re / y_46_re;
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_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_re <= -56000000.0) or not (y_46_re <= 12500000000.0): tmp = x_46_re / y_46_re else: tmp = (x_46_im + (x_46_re * (y_46_re / y_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_re <= -56000000.0) || !(y_46_re <= 12500000000.0)) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_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_re <= -56000000.0) || ~((y_46_re <= 12500000000.0))) tmp = x_46_re / y_46_re; else tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -56000000.0], N[Not[LessEqual[y$46$re, 12500000000.0]], $MachinePrecision]], N[(x$46$re / y$46$re), $MachinePrecision], N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -56000000 \lor \neg \left(y.re \leq 12500000000\right):\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.re < -5.6e7 or 1.25e10 < y.re Initial program 43.3%
Taylor expanded in y.re around inf 72.7%
if -5.6e7 < y.re < 1.25e10Initial program 76.4%
Taylor expanded in y.im around inf 75.8%
associate-/l*75.1%
Simplified75.1%
Final simplification73.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -11500000.0) (not (<= y.re 13000000000.0))) (/ x.re y.re) (/ (+ x.im (/ (* x.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) {
double tmp;
if ((y_46_re <= -11500000.0) || !(y_46_re <= 13000000000.0)) {
tmp = x_46_re / y_46_re;
} else {
tmp = (x_46_im + ((x_46_re * y_46_re) / y_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_46re <= (-11500000.0d0)) .or. (.not. (y_46re <= 13000000000.0d0))) then
tmp = x_46re / y_46re
else
tmp = (x_46im + ((x_46re * y_46re) / y_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_re <= -11500000.0) || !(y_46_re <= 13000000000.0)) {
tmp = x_46_re / y_46_re;
} else {
tmp = (x_46_im + ((x_46_re * y_46_re) / y_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_re <= -11500000.0) or not (y_46_re <= 13000000000.0): tmp = x_46_re / y_46_re else: tmp = (x_46_im + ((x_46_re * y_46_re) / y_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_re <= -11500000.0) || !(y_46_re <= 13000000000.0)) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(Float64(x_46_im + Float64(Float64(x_46_re * y_46_re) / y_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_re <= -11500000.0) || ~((y_46_re <= 13000000000.0))) tmp = x_46_re / y_46_re; else tmp = (x_46_im + ((x_46_re * y_46_re) / y_46_im)) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -11500000.0], N[Not[LessEqual[y$46$re, 13000000000.0]], $MachinePrecision]], N[(x$46$re / y$46$re), $MachinePrecision], N[(N[(x$46$im + N[(N[(x$46$re * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -11500000 \lor \neg \left(y.re \leq 13000000000\right):\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + \frac{x.re \cdot y.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.re < -1.15e7 or 1.3e10 < y.re Initial program 43.3%
Taylor expanded in y.re around inf 72.7%
if -1.15e7 < y.re < 1.3e10Initial program 76.4%
Taylor expanded in y.im around inf 75.8%
Final simplification74.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -6.4e-44) (not (<= y.im 5.7e-39))) (/ (+ x.im (* y.re (/ x.re y.im))) y.im) (/ (+ x.re (* x.im (/ y.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 <= -6.4e-44) || !(y_46_im <= 5.7e-39)) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else {
tmp = (x_46_re + (x_46_im * (y_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 <= (-6.4d-44)) .or. (.not. (y_46im <= 5.7d-39))) then
tmp = (x_46im + (y_46re * (x_46re / y_46im))) / y_46im
else
tmp = (x_46re + (x_46im * (y_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 <= -6.4e-44) || !(y_46_im <= 5.7e-39)) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else {
tmp = (x_46_re + (x_46_im * (y_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 <= -6.4e-44) or not (y_46_im <= 5.7e-39): tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im else: tmp = (x_46_re + (x_46_im * (y_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 <= -6.4e-44) || !(y_46_im <= 5.7e-39)) tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) / y_46_im); else tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_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 <= -6.4e-44) || ~((y_46_im <= 5.7e-39))) tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im; else tmp = (x_46_re + (x_46_im * (y_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, -6.4e-44], N[Not[LessEqual[y$46$im, 5.7e-39]], $MachinePrecision]], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -6.4 \cdot 10^{-44} \lor \neg \left(y.im \leq 5.7 \cdot 10^{-39}\right):\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -6.3999999999999999e-44 or 5.6999999999999997e-39 < y.im Initial program 56.1%
Taylor expanded in y.im around inf 68.3%
associate-/l*70.5%
Applied egg-rr70.5%
*-commutative70.5%
associate-*l/68.3%
associate-*r/71.8%
Simplified71.8%
if -6.3999999999999999e-44 < y.im < 5.6999999999999997e-39Initial program 64.1%
Taylor expanded in y.re around inf 88.7%
associate-/l*88.1%
Simplified88.1%
Final simplification79.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.8e-42) (not (<= y.im 1.32e-42))) (/ (+ x.im (* y.re (/ x.re y.im))) y.im) (/ (+ x.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-42) || !(y_46_im <= 1.32e-42)) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else {
tmp = (x_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-42)) .or. (.not. (y_46im <= 1.32d-42))) then
tmp = (x_46im + (y_46re * (x_46re / y_46im))) / y_46im
else
tmp = (x_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-42) || !(y_46_im <= 1.32e-42)) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else {
tmp = (x_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-42) or not (y_46_im <= 1.32e-42): tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im else: tmp = (x_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-42) || !(y_46_im <= 1.32e-42)) tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) / y_46_im); else tmp = Float64(Float64(x_46_re + Float64(y_46_im * 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-42) || ~((y_46_im <= 1.32e-42))) tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im; else tmp = (x_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-42], N[Not[LessEqual[y$46$im, 1.32e-42]], $MachinePrecision]], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$re + N[(y$46$im * N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.8 \cdot 10^{-42} \lor \neg \left(y.im \leq 1.32 \cdot 10^{-42}\right):\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + y.im \cdot \frac{x.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -1.8000000000000001e-42 or 1.32000000000000006e-42 < y.im Initial program 56.1%
Taylor expanded in y.im around inf 68.3%
associate-/l*70.5%
Applied egg-rr70.5%
*-commutative70.5%
associate-*l/68.3%
associate-*r/71.8%
Simplified71.8%
if -1.8000000000000001e-42 < y.im < 1.32000000000000006e-42Initial program 64.1%
Taylor expanded in y.re around inf 88.7%
associate-/l*88.1%
Simplified88.1%
clear-num88.1%
un-div-inv88.1%
Applied egg-rr88.1%
associate-/r/88.9%
Simplified88.9%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.2e-47) (not (<= y.im 2.25e-39))) (/ (+ x.im (* y.re (/ x.re y.im))) y.im) (/ (+ x.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.2e-47) || !(y_46_im <= 2.25e-39)) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else {
tmp = (x_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.2d-47)) .or. (.not. (y_46im <= 2.25d-39))) then
tmp = (x_46im + (y_46re * (x_46re / y_46im))) / y_46im
else
tmp = (x_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.2e-47) || !(y_46_im <= 2.25e-39)) {
tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im;
} else {
tmp = (x_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.2e-47) or not (y_46_im <= 2.25e-39): tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im else: tmp = (x_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.2e-47) || !(y_46_im <= 2.25e-39)) tmp = Float64(Float64(x_46_im + Float64(y_46_re * Float64(x_46_re / y_46_im))) / y_46_im); else tmp = Float64(Float64(x_46_re + Float64(y_46_im / Float64(y_46_re / 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.2e-47) || ~((y_46_im <= 2.25e-39))) tmp = (x_46_im + (y_46_re * (x_46_re / y_46_im))) / y_46_im; else tmp = (x_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.2e-47], N[Not[LessEqual[y$46$im, 2.25e-39]], $MachinePrecision]], N[(N[(x$46$im + N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$re + N[(y$46$im / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.2 \cdot 10^{-47} \lor \neg \left(y.im \leq 2.25 \cdot 10^{-39}\right):\\
\;\;\;\;\frac{x.im + y.re \cdot \frac{x.re}{y.im}}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + \frac{y.im}{\frac{y.re}{x.im}}}{y.re}\\
\end{array}
\end{array}
if y.im < -3.1999999999999999e-47 or 2.25e-39 < y.im Initial program 56.1%
Taylor expanded in y.im around inf 68.3%
associate-/l*70.5%
Applied egg-rr70.5%
*-commutative70.5%
associate-*l/68.3%
associate-*r/71.8%
Simplified71.8%
if -3.1999999999999999e-47 < y.im < 2.25e-39Initial program 64.1%
Taylor expanded in y.re around inf 88.7%
associate-/l*88.1%
Simplified88.1%
clear-num88.1%
un-div-inv88.1%
Applied egg-rr88.1%
associate-/r/88.9%
Simplified88.9%
clear-num88.9%
associate-/r/88.9%
clear-num88.9%
Applied egg-rr88.9%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -6.6e+40) (not (<= y.im 3.6e+71))) (/ x.im y.im) (/ x.re y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -6.6e+40) || !(y_46_im <= 3.6e+71)) {
tmp = x_46_im / y_46_im;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-6.6d+40)) .or. (.not. (y_46im <= 3.6d+71))) then
tmp = x_46im / y_46im
else
tmp = x_46re / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -6.6e+40) || !(y_46_im <= 3.6e+71)) {
tmp = x_46_im / y_46_im;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -6.6e+40) or not (y_46_im <= 3.6e+71): tmp = x_46_im / y_46_im else: tmp = x_46_re / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -6.6e+40) || !(y_46_im <= 3.6e+71)) tmp = Float64(x_46_im / y_46_im); else tmp = Float64(x_46_re / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -6.6e+40) || ~((y_46_im <= 3.6e+71))) tmp = x_46_im / y_46_im; else tmp = x_46_re / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -6.6e+40], N[Not[LessEqual[y$46$im, 3.6e+71]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -6.6 \cdot 10^{+40} \lor \neg \left(y.im \leq 3.6 \cdot 10^{+71}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -6.5999999999999997e40 or 3.6e71 < y.im Initial program 45.0%
Taylor expanded in y.re around 0 69.3%
if -6.5999999999999997e40 < y.im < 3.6e71Initial program 67.4%
Taylor expanded in y.re around inf 63.9%
Final simplification65.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.im))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46im
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_im) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 59.9%
Taylor expanded in y.re around 0 34.9%
Final simplification34.9%
herbie shell --seed 2024077
(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))))