
(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 (<= y.im -4.5e+17)
(* (/ y.im (hypot y.re y.im)) (/ x.im (hypot y.re y.im)))
(if (<= y.im 1.3e+62)
(*
(/ (fma x.im (/ y.im y.re) x.re) (hypot y.im y.re))
(/ y.re (hypot y.im y.re)))
(/ 1.0 (/ y.im (fma y.re (/ x.re y.im) x.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 <= -4.5e+17) {
tmp = (y_46_im / hypot(y_46_re, y_46_im)) * (x_46_im / hypot(y_46_re, y_46_im));
} else if (y_46_im <= 1.3e+62) {
tmp = (fma(x_46_im, (y_46_im / y_46_re), x_46_re) / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re));
} else {
tmp = 1.0 / (y_46_im / fma(y_46_re, (x_46_re / y_46_im), x_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 <= -4.5e+17) tmp = Float64(Float64(y_46_im / hypot(y_46_re, y_46_im)) * Float64(x_46_im / hypot(y_46_re, y_46_im))); elseif (y_46_im <= 1.3e+62) tmp = Float64(Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / hypot(y_46_im, y_46_re)) * Float64(y_46_re / hypot(y_46_im, y_46_re))); else tmp = Float64(1.0 / Float64(y_46_im / fma(y_46_re, Float64(x_46_re / y_46_im), x_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -4.5e+17], N[(N[(y$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.3e+62], N[(N[(N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(y$46$im / N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision] + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.5 \cdot 10^{+17}:\\
\;\;\;\;\frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq 1.3 \cdot 10^{+62}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y.im}{\mathsf{fma}\left(y.re, \frac{x.re}{y.im}, x.im\right)}}\\
\end{array}
\end{array}
if y.im < -4.5e17Initial program 47.8%
Taylor expanded in x.re around 0 46.2%
*-commutative46.2%
Simplified46.2%
add-sqr-sqrt46.2%
hypot-undefine46.2%
hypot-undefine46.2%
times-frac88.9%
Applied egg-rr88.9%
if -4.5e17 < y.im < 1.29999999999999992e62Initial program 76.4%
Taylor expanded in y.re around inf 75.1%
*-commutative75.1%
Simplified75.1%
*-un-lft-identity75.1%
add-sqr-sqrt75.1%
hypot-undefine75.1%
hypot-undefine75.1%
times-frac85.7%
+-commutative85.7%
associate-/l*85.0%
fma-define85.0%
Applied egg-rr85.0%
associate-*l/85.2%
*-lft-identity85.2%
associate-/l*95.9%
associate-*l/95.9%
*-commutative95.9%
fma-undefine95.9%
*-commutative95.9%
associate-*l/95.7%
associate-*r/96.5%
fma-define96.5%
hypot-undefine76.7%
unpow276.7%
unpow276.7%
+-commutative76.7%
unpow276.7%
unpow276.7%
hypot-define96.5%
hypot-undefine76.7%
unpow276.7%
unpow276.7%
+-commutative76.7%
Simplified96.5%
if 1.29999999999999992e62 < y.im Initial program 48.0%
Taylor expanded in y.im around inf 85.8%
associate-/l*89.7%
Simplified89.7%
clear-num91.0%
inv-pow91.0%
+-commutative91.0%
fma-define91.0%
Applied egg-rr91.0%
unpow-191.0%
fma-undefine91.0%
associate-*r/87.1%
*-commutative87.1%
associate-/l*90.9%
fma-define90.9%
Simplified90.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
(/ (+ (* y.re x.re) (* y.im x.im)) (+ (* y.re y.re) (* y.im y.im)))
5e+297)
(/ (/ (fma y.re x.re (* y.im x.im)) (hypot y.re y.im)) (hypot y.re 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_re * x_46_re) + (y_46_im * x_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+297) {
tmp = (fma(y_46_re, x_46_re, (y_46_im * x_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, 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 (Float64(Float64(Float64(y_46_re * x_46_re) + Float64(y_46_im * x_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 5e+297) tmp = Float64(Float64(fma(y_46_re, x_46_re, Float64(y_46_im * x_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, 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[N[(N[(N[(y$46$re * x$46$re), $MachinePrecision] + N[(y$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+297], N[(N[(N[(y$46$re * x$46$re + N[(y$46$im * x$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[(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}\;\frac{y.re \cdot x.re + y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im} \leq 5 \cdot 10^{+297}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(y.re, x.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{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))) < 4.9999999999999998e297Initial program 82.0%
*-un-lft-identity82.0%
add-sqr-sqrt82.0%
times-frac82.0%
hypot-define82.0%
fma-define82.0%
hypot-define97.7%
Applied egg-rr97.7%
*-commutative97.7%
associate-*l/97.7%
div-inv97.8%
fma-undefine97.8%
*-commutative97.8%
fma-define97.8%
*-commutative97.8%
Applied egg-rr97.8%
if 4.9999999999999998e297 < (/.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 15.4%
Taylor expanded in y.im around inf 59.6%
associate-/l*65.5%
Simplified65.5%
Final simplification89.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* y.re x.re) (* y.im x.im))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 5e+297)
(/ (/ t_0 (hypot y.re y.im)) (hypot y.re 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 t_0 = (y_46_re * x_46_re) + (y_46_im * x_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+297) {
tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / 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 = (y_46_re * x_46_re) + (y_46_im * x_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+297) {
tmp = (t_0 / Math.hypot(y_46_re, y_46_im)) / Math.hypot(y_46_re, y_46_im);
} 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 = (y_46_re * x_46_re) + (y_46_im * x_46_im) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+297: tmp = (t_0 / math.hypot(y_46_re, y_46_im)) / math.hypot(y_46_re, 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) t_0 = Float64(Float64(y_46_re * x_46_re) + Float64(y_46_im * x_46_im)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 5e+297) tmp = Float64(Float64(t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, 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
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (y_46_re * x_46_re) + (y_46_im * x_46_im); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+297) tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im); 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[(y$46$re * x$46$re), $MachinePrecision] + N[(y$46$im * x$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], 5e+297], N[(N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$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 := y.re \cdot x.re + y.im \cdot x.im\\
\mathbf{if}\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 5 \cdot 10^{+297}:\\
\;\;\;\;\frac{\frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{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))) < 4.9999999999999998e297Initial program 82.0%
*-un-lft-identity82.0%
add-sqr-sqrt82.0%
times-frac82.0%
hypot-define82.0%
fma-define82.0%
hypot-define97.7%
Applied egg-rr97.7%
*-commutative97.7%
associate-*l/97.7%
div-inv97.8%
fma-undefine97.8%
*-commutative97.8%
fma-define97.8%
*-commutative97.8%
Applied egg-rr97.8%
fma-undefine97.8%
Applied egg-rr97.8%
if 4.9999999999999998e297 < (/.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 15.4%
Taylor expanded in y.im around inf 59.6%
associate-/l*65.5%
Simplified65.5%
Final simplification89.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.re x.re) (* y.im x.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -1.7e+49)
(* (/ y.im (hypot y.re y.im)) (/ x.im (hypot y.re y.im)))
(if (<= y.im -1.1e-150)
t_0
(if (<= y.im 6.2e-119)
(/ (fma x.im (/ y.im y.re) x.re) y.re)
(if (<= y.im 1.55e+29)
t_0
(/ 1.0 (/ y.im (fma y.re (/ x.re y.im) x.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 * x_46_re) + (y_46_im * x_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.7e+49) {
tmp = (y_46_im / hypot(y_46_re, y_46_im)) * (x_46_im / hypot(y_46_re, y_46_im));
} else if (y_46_im <= -1.1e-150) {
tmp = t_0;
} else if (y_46_im <= 6.2e-119) {
tmp = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
} else if (y_46_im <= 1.55e+29) {
tmp = t_0;
} else {
tmp = 1.0 / (y_46_im / fma(y_46_re, (x_46_re / y_46_im), x_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re * x_46_re) + Float64(y_46_im * x_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -1.7e+49) tmp = Float64(Float64(y_46_im / hypot(y_46_re, y_46_im)) * Float64(x_46_im / hypot(y_46_re, y_46_im))); elseif (y_46_im <= -1.1e-150) tmp = t_0; elseif (y_46_im <= 6.2e-119) tmp = Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re); elseif (y_46_im <= 1.55e+29) tmp = t_0; else tmp = Float64(1.0 / Float64(y_46_im / fma(y_46_re, Float64(x_46_re / y_46_im), x_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$re), $MachinePrecision] + N[(y$46$im * x$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, -1.7e+49], N[(N[(y$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.1e-150], t$95$0, If[LessEqual[y$46$im, 6.2e-119], N[(N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.55e+29], t$95$0, N[(1.0 / N[(y$46$im / N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision] + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.re + y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.7 \cdot 10^{+49}:\\
\;\;\;\;\frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -1.1 \cdot 10^{-150}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 6.2 \cdot 10^{-119}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
\mathbf{elif}\;y.im \leq 1.55 \cdot 10^{+29}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{y.im}{\mathsf{fma}\left(y.re, \frac{x.re}{y.im}, x.im\right)}}\\
\end{array}
\end{array}
if y.im < -1.7e49Initial program 43.3%
Taylor expanded in x.re around 0 42.7%
*-commutative42.7%
Simplified42.7%
add-sqr-sqrt42.7%
hypot-undefine42.7%
hypot-undefine42.7%
times-frac89.1%
Applied egg-rr89.1%
if -1.7e49 < y.im < -1.1e-150 or 6.19999999999999956e-119 < y.im < 1.5499999999999999e29Initial program 89.1%
if -1.1e-150 < y.im < 6.19999999999999956e-119Initial program 68.1%
Taylor expanded in y.re around inf 94.7%
+-commutative94.7%
associate-/l*94.9%
fma-define94.9%
Simplified94.9%
if 1.5499999999999999e29 < y.im Initial program 49.1%
Taylor expanded in y.im around inf 84.8%
associate-/l*88.4%
Simplified88.4%
clear-num89.6%
inv-pow89.6%
+-commutative89.6%
fma-define89.6%
Applied egg-rr89.6%
unpow-189.6%
fma-undefine89.6%
associate-*r/85.9%
*-commutative85.9%
associate-/l*89.6%
fma-define89.6%
Simplified89.6%
Final simplification91.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.re x.re) (* y.im x.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ 1.0 (/ y.im (fma y.re (/ x.re y.im) x.im)))))
(if (<= y.im -1.8e+149)
t_1
(if (<= y.im -7.5e-150)
t_0
(if (<= y.im 1.5e-117)
(/ (fma x.im (/ y.im y.re) x.re) y.re)
(if (<= y.im 1.8e+29) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_re) + (y_46_im * x_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = 1.0 / (y_46_im / fma(y_46_re, (x_46_re / y_46_im), x_46_im));
double tmp;
if (y_46_im <= -1.8e+149) {
tmp = t_1;
} else if (y_46_im <= -7.5e-150) {
tmp = t_0;
} else if (y_46_im <= 1.5e-117) {
tmp = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
} else if (y_46_im <= 1.8e+29) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re * x_46_re) + Float64(y_46_im * x_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(1.0 / Float64(y_46_im / fma(y_46_re, Float64(x_46_re / y_46_im), x_46_im))) tmp = 0.0 if (y_46_im <= -1.8e+149) tmp = t_1; elseif (y_46_im <= -7.5e-150) tmp = t_0; elseif (y_46_im <= 1.5e-117) tmp = Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re); elseif (y_46_im <= 1.8e+29) tmp = t_0; else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$re), $MachinePrecision] + N[(y$46$im * x$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[(1.0 / N[(y$46$im / N[(y$46$re * N[(x$46$re / y$46$im), $MachinePrecision] + x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.8e+149], t$95$1, If[LessEqual[y$46$im, -7.5e-150], t$95$0, If[LessEqual[y$46$im, 1.5e-117], N[(N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.8e+29], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.re + y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{1}{\frac{y.im}{\mathsf{fma}\left(y.re, \frac{x.re}{y.im}, x.im\right)}}\\
\mathbf{if}\;y.im \leq -1.8 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -7.5 \cdot 10^{-150}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.5 \cdot 10^{-117}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+29}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.79999999999999997e149 or 1.79999999999999988e29 < y.im Initial program 37.9%
Taylor expanded in y.im around inf 85.7%
associate-/l*89.0%
Simplified89.0%
clear-num89.8%
inv-pow89.8%
+-commutative89.8%
fma-define89.8%
Applied egg-rr89.8%
unpow-189.8%
fma-undefine89.8%
associate-*r/86.4%
*-commutative86.4%
associate-/l*89.7%
fma-define89.7%
Simplified89.7%
if -1.79999999999999997e149 < y.im < -7.5000000000000004e-150 or 1.49999999999999996e-117 < y.im < 1.79999999999999988e29Initial program 88.1%
if -7.5000000000000004e-150 < y.im < 1.49999999999999996e-117Initial program 68.1%
Taylor expanded in y.re around inf 94.7%
+-commutative94.7%
associate-/l*94.9%
fma-define94.9%
Simplified94.9%
Final simplification90.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.re x.re) (* y.im x.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ (+ x.im (/ x.re (/ y.im y.re))) y.im)))
(if (<= y.im -3.9e+136)
t_1
(if (<= y.im -2e-149)
t_0
(if (<= y.im 4.2e-114)
(/ (fma x.im (/ y.im y.re) x.re) y.re)
(if (<= y.im 1.8e+29) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_re) + (y_46_im * x_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))) / y_46_im;
double tmp;
if (y_46_im <= -3.9e+136) {
tmp = t_1;
} else if (y_46_im <= -2e-149) {
tmp = t_0;
} else if (y_46_im <= 4.2e-114) {
tmp = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
} else if (y_46_im <= 1.8e+29) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re * x_46_re) + Float64(y_46_im * x_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(x_46_im + Float64(x_46_re / Float64(y_46_im / y_46_re))) / y_46_im) tmp = 0.0 if (y_46_im <= -3.9e+136) tmp = t_1; elseif (y_46_im <= -2e-149) tmp = t_0; elseif (y_46_im <= 4.2e-114) tmp = Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re); elseif (y_46_im <= 1.8e+29) tmp = t_0; else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$re), $MachinePrecision] + N[(y$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im + N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -3.9e+136], t$95$1, If[LessEqual[y$46$im, -2e-149], t$95$0, If[LessEqual[y$46$im, 4.2e-114], N[(N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.8e+29], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.re + y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im + \frac{x.re}{\frac{y.im}{y.re}}}{y.im}\\
\mathbf{if}\;y.im \leq -3.9 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -2 \cdot 10^{-149}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 4.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+29}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -3.90000000000000019e136 or 1.79999999999999988e29 < y.im Initial program 40.6%
Taylor expanded in y.im around inf 86.3%
associate-/l*89.4%
Simplified89.4%
clear-num89.4%
un-div-inv89.5%
Applied egg-rr89.5%
if -3.90000000000000019e136 < y.im < -1.99999999999999996e-149 or 4.19999999999999985e-114 < y.im < 1.79999999999999988e29Initial program 87.5%
if -1.99999999999999996e-149 < y.im < 4.19999999999999985e-114Initial program 68.1%
Taylor expanded in y.re around inf 94.7%
+-commutative94.7%
associate-/l*94.9%
fma-define94.9%
Simplified94.9%
Final simplification90.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* y.re x.re) (* y.im x.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (/ (+ x.im (/ x.re (/ y.im y.re))) y.im)))
(if (<= y.im -1.65e+124)
t_1
(if (<= y.im -5.7e-154)
t_0
(if (<= y.im 3.2e-114)
(/ (+ x.re (* x.im (/ y.im y.re))) y.re)
(if (<= y.im 1.55e+29) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_re) + (y_46_im * x_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))) / y_46_im;
double tmp;
if (y_46_im <= -1.65e+124) {
tmp = t_1;
} else if (y_46_im <= -5.7e-154) {
tmp = t_0;
} else if (y_46_im <= 3.2e-114) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1.55e+29) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((y_46re * x_46re) + (y_46im * x_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im + (x_46re / (y_46im / y_46re))) / y_46im
if (y_46im <= (-1.65d+124)) then
tmp = t_1
else if (y_46im <= (-5.7d-154)) then
tmp = t_0
else if (y_46im <= 3.2d-114) then
tmp = (x_46re + (x_46im * (y_46im / y_46re))) / y_46re
else if (y_46im <= 1.55d+29) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_re) + (y_46_im * x_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))) / y_46_im;
double tmp;
if (y_46_im <= -1.65e+124) {
tmp = t_1;
} else if (y_46_im <= -5.7e-154) {
tmp = t_0;
} else if (y_46_im <= 3.2e-114) {
tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1.55e+29) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re * x_46_re) + (y_46_im * x_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))) / y_46_im tmp = 0 if y_46_im <= -1.65e+124: tmp = t_1 elif y_46_im <= -5.7e-154: tmp = t_0 elif y_46_im <= 3.2e-114: tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 1.55e+29: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re * x_46_re) + Float64(y_46_im * x_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(x_46_im + Float64(x_46_re / Float64(y_46_im / y_46_re))) / y_46_im) tmp = 0.0 if (y_46_im <= -1.65e+124) tmp = t_1; elseif (y_46_im <= -5.7e-154) tmp = t_0; elseif (y_46_im <= 3.2e-114) tmp = Float64(Float64(x_46_re + Float64(x_46_im * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 1.55e+29) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((y_46_re * x_46_re) + (y_46_im * x_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))) / y_46_im; tmp = 0.0; if (y_46_im <= -1.65e+124) tmp = t_1; elseif (y_46_im <= -5.7e-154) tmp = t_0; elseif (y_46_im <= 3.2e-114) tmp = (x_46_re + (x_46_im * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 1.55e+29) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$re), $MachinePrecision] + N[(y$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im + N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1.65e+124], t$95$1, If[LessEqual[y$46$im, -5.7e-154], t$95$0, If[LessEqual[y$46$im, 3.2e-114], N[(N[(x$46$re + N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.55e+29], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.re + y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im + \frac{x.re}{\frac{y.im}{y.re}}}{y.im}\\
\mathbf{if}\;y.im \leq -1.65 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -5.7 \cdot 10^{-154}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.55 \cdot 10^{+29}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.65000000000000007e124 or 1.5499999999999999e29 < y.im Initial program 40.6%
Taylor expanded in y.im around inf 86.3%
associate-/l*89.4%
Simplified89.4%
clear-num89.4%
un-div-inv89.5%
Applied egg-rr89.5%
if -1.65000000000000007e124 < y.im < -5.6999999999999998e-154 or 3.2000000000000002e-114 < y.im < 1.5499999999999999e29Initial program 87.5%
if -5.6999999999999998e-154 < y.im < 3.2000000000000002e-114Initial program 68.1%
Taylor expanded in y.re around inf 94.7%
*-commutative94.7%
Simplified94.7%
Taylor expanded in y.im around 0 94.7%
associate-*r/94.9%
Simplified94.9%
Final simplification90.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.2e-11) (not (<= y.im 1.95e-7))) (/ (+ x.im (/ x.re (/ y.im 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 ((y_46_im <= -3.2e-11) || !(y_46_im <= 1.95e-7)) {
tmp = (x_46_im + (x_46_re / (y_46_im / 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;
}
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-11)) .or. (.not. (y_46im <= 1.95d-7))) then
tmp = (x_46im + (x_46re / (y_46im / y_46re))) / 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 <= -3.2e-11) || !(y_46_im <= 1.95e-7)) {
tmp = (x_46_im + (x_46_re / (y_46_im / 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): tmp = 0 if (y_46_im <= -3.2e-11) or not (y_46_im <= 1.95e-7): tmp = (x_46_im + (x_46_re / (y_46_im / 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 ((y_46_im <= -3.2e-11) || !(y_46_im <= 1.95e-7)) tmp = Float64(Float64(x_46_im + Float64(x_46_re / Float64(y_46_im / 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) tmp = 0.0; if ((y_46_im <= -3.2e-11) || ~((y_46_im <= 1.95e-7))) tmp = (x_46_im + (x_46_re / (y_46_im / 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_] := If[Or[LessEqual[y$46$im, -3.2e-11], N[Not[LessEqual[y$46$im, 1.95e-7]], $MachinePrecision]], N[(N[(x$46$im + N[(x$46$re / N[(y$46$im / y$46$re), $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 -3.2 \cdot 10^{-11} \lor \neg \left(y.im \leq 1.95 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{x.im + \frac{x.re}{\frac{y.im}{y.re}}}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re + x.im \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -3.19999999999999994e-11 or 1.95000000000000012e-7 < y.im Initial program 53.3%
Taylor expanded in y.im around inf 82.9%
associate-/l*85.2%
Simplified85.2%
clear-num85.2%
un-div-inv85.3%
Applied egg-rr85.3%
if -3.19999999999999994e-11 < y.im < 1.95000000000000012e-7Initial program 74.8%
Taylor expanded in y.re around inf 87.4%
*-commutative87.4%
Simplified87.4%
Taylor expanded in y.im around 0 87.4%
associate-*r/87.5%
Simplified87.5%
Final simplification86.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -7.5e+36)
(/ 1.0 (/ y.re x.re))
(if (<= y.re 560000000000.0)
(/ (+ x.im (/ x.re (/ y.im y.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_re <= -7.5e+36) {
tmp = 1.0 / (y_46_re / x_46_re);
} else if (y_46_re <= 560000000000.0) {
tmp = (x_46_im + (x_46_re / (y_46_im / y_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_46re <= (-7.5d+36)) then
tmp = 1.0d0 / (y_46re / x_46re)
else if (y_46re <= 560000000000.0d0) then
tmp = (x_46im + (x_46re / (y_46im / y_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_re <= -7.5e+36) {
tmp = 1.0 / (y_46_re / x_46_re);
} else if (y_46_re <= 560000000000.0) {
tmp = (x_46_im + (x_46_re / (y_46_im / y_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_re <= -7.5e+36: tmp = 1.0 / (y_46_re / x_46_re) elif y_46_re <= 560000000000.0: tmp = (x_46_im + (x_46_re / (y_46_im / y_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_re <= -7.5e+36) tmp = Float64(1.0 / Float64(y_46_re / x_46_re)); elseif (y_46_re <= 560000000000.0) tmp = Float64(Float64(x_46_im + Float64(x_46_re / Float64(y_46_im / y_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_re <= -7.5e+36) tmp = 1.0 / (y_46_re / x_46_re); elseif (y_46_re <= 560000000000.0) tmp = (x_46_im + (x_46_re / (y_46_im / y_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[LessEqual[y$46$re, -7.5e+36], N[(1.0 / N[(y$46$re / x$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 560000000000.0], N[(N[(x$46$im + N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -7.5 \cdot 10^{+36}:\\
\;\;\;\;\frac{1}{\frac{y.re}{x.re}}\\
\mathbf{elif}\;y.re \leq 560000000000:\\
\;\;\;\;\frac{x.im + \frac{x.re}{\frac{y.im}{y.re}}}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.re < -7.50000000000000054e36Initial program 50.1%
Taylor expanded in y.re around inf 63.7%
clear-num65.0%
inv-pow65.0%
Applied egg-rr65.0%
unpow-165.0%
Simplified65.0%
if -7.50000000000000054e36 < y.re < 5.6e11Initial program 68.9%
Taylor expanded in y.im around inf 84.6%
associate-/l*85.2%
Simplified85.2%
clear-num85.2%
un-div-inv85.2%
Applied egg-rr85.2%
if 5.6e11 < y.re Initial program 63.5%
Taylor expanded in y.re around inf 72.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.35e+37)
(/ 1.0 (/ y.re x.re))
(if (<= y.re 800000000000.0)
(/ (+ x.im (* x.re (/ y.re y.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_re <= -1.35e+37) {
tmp = 1.0 / (y_46_re / x_46_re);
} else if (y_46_re <= 800000000000.0) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_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_46re <= (-1.35d+37)) then
tmp = 1.0d0 / (y_46re / x_46re)
else if (y_46re <= 800000000000.0d0) then
tmp = (x_46im + (x_46re * (y_46re / y_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_re <= -1.35e+37) {
tmp = 1.0 / (y_46_re / x_46_re);
} else if (y_46_re <= 800000000000.0) {
tmp = (x_46_im + (x_46_re * (y_46_re / y_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_re <= -1.35e+37: tmp = 1.0 / (y_46_re / x_46_re) elif y_46_re <= 800000000000.0: tmp = (x_46_im + (x_46_re * (y_46_re / y_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_re <= -1.35e+37) tmp = Float64(1.0 / Float64(y_46_re / x_46_re)); elseif (y_46_re <= 800000000000.0) tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_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_re <= -1.35e+37) tmp = 1.0 / (y_46_re / x_46_re); elseif (y_46_re <= 800000000000.0) tmp = (x_46_im + (x_46_re * (y_46_re / y_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[LessEqual[y$46$re, -1.35e+37], N[(1.0 / N[(y$46$re / x$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 800000000000.0], N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.35 \cdot 10^{+37}:\\
\;\;\;\;\frac{1}{\frac{y.re}{x.re}}\\
\mathbf{elif}\;y.re \leq 800000000000:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.re < -1.34999999999999993e37Initial program 50.1%
Taylor expanded in y.re around inf 63.7%
clear-num65.0%
inv-pow65.0%
Applied egg-rr65.0%
unpow-165.0%
Simplified65.0%
if -1.34999999999999993e37 < y.re < 8e11Initial program 68.9%
Taylor expanded in y.im around inf 84.6%
associate-/l*85.2%
Simplified85.2%
if 8e11 < y.re Initial program 63.5%
Taylor expanded in y.re around inf 72.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1e-47) (not (<= y.im 4e-8))) (/ 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 <= -1e-47) || !(y_46_im <= 4e-8)) {
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 <= (-1d-47)) .or. (.not. (y_46im <= 4d-8))) 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 <= -1e-47) || !(y_46_im <= 4e-8)) {
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 <= -1e-47) or not (y_46_im <= 4e-8): 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 <= -1e-47) || !(y_46_im <= 4e-8)) 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 <= -1e-47) || ~((y_46_im <= 4e-8))) 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, -1e-47], N[Not[LessEqual[y$46$im, 4e-8]], $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 -1 \cdot 10^{-47} \lor \neg \left(y.im \leq 4 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -9.9999999999999997e-48 or 4.0000000000000001e-8 < y.im Initial program 55.0%
Taylor expanded in y.re around 0 73.1%
if -9.9999999999999997e-48 < y.im < 4.0000000000000001e-8Initial program 74.2%
Taylor expanded in y.re around inf 67.3%
Final simplification70.3%
(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 64.1%
Taylor expanded in y.re around 0 47.6%
herbie shell --seed 2024132
(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))))