
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 2e+270)))
(/ (fma x.im (/ y.im y.re) x.re) y.re)
(/
(/ (fma x.im y.im (* x.re y.re)) (hypot y.re y.im))
(hypot y.re y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 2e+270)) {
tmp = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
} else {
tmp = (fma(x_46_im, y_46_im, (x_46_re * y_46_re)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 2e+270)) tmp = Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re); else tmp = Float64(Float64(fma(x_46_im, y_46_im, Float64(x_46_re * y_46_re)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(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[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 2e+270]], $MachinePrecision]], N[(N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(N[(x$46$im * y$46$im + N[(x$46$re * y$46$re), $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]]]
\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}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 2 \cdot 10^{+270}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.im, y.im, x.re \cdot y.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < -inf.0 or 2.0000000000000001e270 < (/.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 16.9%
Taylor expanded in y.re around inf 17.6%
*-un-lft-identity17.6%
fma-def17.6%
pow217.6%
times-frac22.4%
fma-def22.4%
+-commutative22.4%
fma-def22.4%
Applied egg-rr22.4%
expm1-log1p-u12.4%
expm1-udef12.4%
*-commutative12.4%
div-inv12.4%
associate-*l*9.3%
fma-udef9.3%
+-commutative9.3%
fma-def9.3%
inv-pow9.3%
inv-pow9.3%
pow-prod-up9.3%
metadata-eval9.3%
Applied egg-rr9.3%
expm1-def9.3%
expm1-log1p17.7%
*-commutative17.7%
metadata-eval17.7%
pow-sqr17.7%
unpow-117.7%
unpow-117.7%
associate-*r*22.4%
associate-*l/22.4%
*-lft-identity22.4%
associate-*r/22.4%
Simplified60.4%
if -inf.0 < (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 2.0000000000000001e270Initial program 82.2%
*-un-lft-identity82.2%
+-commutative82.2%
fma-udef82.2%
add-sqr-sqrt82.2%
times-frac82.2%
fma-udef82.2%
+-commutative82.2%
hypot-def82.2%
fma-def82.2%
fma-udef82.2%
+-commutative82.2%
hypot-def99.6%
Applied egg-rr99.6%
*-commutative99.6%
associate-*l/99.7%
div-inv99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
Final simplification85.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re y.re) (* x.im y.im)))
(t_1 (/ t_0 (+ (* y.re y.re) (* y.im y.im)))))
(if (or (<= t_1 -1e+294) (not (<= t_1 2e+270)))
(/ (fma x.im (/ y.im y.re) x.re) y.re)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double t_1 = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if ((t_1 <= -1e+294) || !(t_1 <= 2e+270)) {
tmp = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
} else {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) t_1 = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if ((t_1 <= -1e+294) || !(t_1 <= 2e+270)) tmp = Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re); else tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+294], N[Not[LessEqual[t$95$1, 2e+270]], $MachinePrecision]], N[(N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], 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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot y.re + x.im \cdot y.im\\
t_1 := \frac{t_0}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+294} \lor \neg \left(t_1 \leq 2 \cdot 10^{+270}\right):\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < -1.00000000000000007e294 or 2.0000000000000001e270 < (/.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 17.7%
Taylor expanded in y.re around inf 18.5%
*-un-lft-identity18.5%
fma-def18.5%
pow218.5%
times-frac23.2%
fma-def23.2%
+-commutative23.2%
fma-def23.2%
Applied egg-rr23.2%
expm1-log1p-u12.3%
expm1-udef12.3%
*-commutative12.3%
div-inv12.3%
associate-*l*9.2%
fma-udef9.2%
+-commutative9.2%
fma-def9.2%
inv-pow9.2%
inv-pow9.2%
pow-prod-up9.2%
metadata-eval9.2%
Applied egg-rr9.2%
expm1-def9.2%
expm1-log1p18.6%
*-commutative18.6%
metadata-eval18.6%
pow-sqr18.5%
unpow-118.5%
unpow-118.5%
associate-*r*23.2%
associate-*l/23.2%
*-lft-identity23.2%
associate-*r/23.3%
Simplified60.8%
if -1.00000000000000007e294 < (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 2.0000000000000001e270Initial program 82.1%
*-un-lft-identity82.1%
+-commutative82.1%
fma-udef82.1%
add-sqr-sqrt82.1%
times-frac82.1%
fma-udef82.1%
+-commutative82.1%
hypot-def82.1%
fma-def82.1%
fma-udef82.1%
+-commutative82.1%
hypot-def99.7%
Applied egg-rr99.7%
fma-def82.1%
Applied egg-rr99.7%
Final simplification85.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (/ y.re (hypot y.re y.im)) (/ x.re (hypot y.re y.im))))
(t_1 (/ x.re (/ y.im y.re))))
(if (<= y.im -3.8e+92)
(/ (- (- x.im) t_1) (hypot y.re y.im))
(if (<= y.im -3.6e-69)
t_0
(if (<= y.im 7.5e-87)
(/ (fma x.im (/ y.im y.re) x.re) y.re)
(if (<= y.im 1.62e-12)
(/ (+ (* x.re y.re) (* x.im y.im)) (fma y.im y.im (* y.re y.re)))
(if (<= y.im 3.4e+61) t_0 (/ (+ x.im t_1) (hypot y.re y.im)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re / hypot(y_46_re, y_46_im)) * (x_46_re / hypot(y_46_re, y_46_im));
double t_1 = x_46_re / (y_46_im / y_46_re);
double tmp;
if (y_46_im <= -3.8e+92) {
tmp = (-x_46_im - t_1) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -3.6e-69) {
tmp = t_0;
} else if (y_46_im <= 7.5e-87) {
tmp = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
} else if (y_46_im <= 1.62e-12) {
tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
} else if (y_46_im <= 3.4e+61) {
tmp = t_0;
} else {
tmp = (x_46_im + t_1) / hypot(y_46_re, y_46_im);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re / hypot(y_46_re, y_46_im)) * Float64(x_46_re / hypot(y_46_re, y_46_im))) t_1 = Float64(x_46_re / Float64(y_46_im / y_46_re)) tmp = 0.0 if (y_46_im <= -3.8e+92) tmp = Float64(Float64(Float64(-x_46_im) - t_1) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -3.6e-69) tmp = t_0; elseif (y_46_im <= 7.5e-87) tmp = Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re); elseif (y_46_im <= 1.62e-12) tmp = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))); elseif (y_46_im <= 3.4e+61) tmp = t_0; else tmp = Float64(Float64(x_46_im + t_1) / hypot(y_46_re, y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -3.8e+92], N[(N[((-x$46$im) - t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -3.6e-69], t$95$0, If[LessEqual[y$46$im, 7.5e-87], 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.62e-12], N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.4e+61], t$95$0, N[(N[(x$46$im + t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := \frac{x.re}{\frac{y.im}{y.re}}\\
\mathbf{if}\;y.im \leq -3.8 \cdot 10^{+92}:\\
\;\;\;\;\frac{\left(-x.im\right) - t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -3.6 \cdot 10^{-69}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{-87}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
\mathbf{elif}\;y.im \leq 1.62 \cdot 10^{-12}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{elif}\;y.im \leq 3.4 \cdot 10^{+61}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -3.8e92Initial program 37.2%
*-un-lft-identity37.2%
+-commutative37.2%
fma-udef37.2%
add-sqr-sqrt37.2%
times-frac37.1%
fma-udef37.1%
+-commutative37.1%
hypot-def37.1%
fma-def37.1%
fma-udef37.1%
+-commutative37.1%
hypot-def54.1%
Applied egg-rr54.1%
*-commutative54.1%
associate-*l/54.1%
div-inv54.2%
fma-def54.2%
+-commutative54.2%
fma-def54.2%
Applied egg-rr54.2%
Taylor expanded in y.im around -inf 70.8%
mul-1-neg70.8%
unsub-neg70.8%
mul-1-neg70.8%
associate-/l*79.7%
Simplified79.7%
if -3.8e92 < y.im < -3.60000000000000018e-69 or 1.62e-12 < y.im < 3.40000000000000026e61Initial program 66.5%
Taylor expanded in x.re around inf 56.5%
*-commutative56.5%
Simplified56.5%
add-sqr-sqrt56.5%
hypot-udef56.5%
hypot-udef56.5%
times-frac83.7%
Applied egg-rr83.7%
if -3.60000000000000018e-69 < y.im < 7.5000000000000002e-87Initial program 68.9%
Taylor expanded in y.re around inf 59.1%
*-un-lft-identity59.1%
fma-def59.1%
pow259.1%
times-frac68.5%
fma-def68.5%
+-commutative68.5%
fma-def68.5%
Applied egg-rr68.5%
expm1-log1p-u48.3%
expm1-udef28.7%
*-commutative28.7%
div-inv28.7%
associate-*l*25.5%
fma-udef25.5%
+-commutative25.5%
fma-def25.5%
inv-pow25.5%
inv-pow25.5%
pow-prod-up25.5%
metadata-eval25.5%
Applied egg-rr25.5%
expm1-def41.4%
expm1-log1p60.1%
*-commutative60.1%
metadata-eval60.1%
pow-sqr60.1%
unpow-160.1%
unpow-160.1%
associate-*r*68.4%
associate-*l/68.5%
*-lft-identity68.5%
associate-*r/68.6%
Simplified86.7%
if 7.5000000000000002e-87 < y.im < 1.62e-12Initial program 82.3%
fma-def82.3%
+-commutative82.3%
fma-def82.3%
Simplified82.3%
fma-def82.3%
Applied egg-rr82.3%
if 3.40000000000000026e61 < y.im Initial program 46.3%
*-un-lft-identity46.3%
+-commutative46.3%
fma-udef46.3%
add-sqr-sqrt46.3%
times-frac46.3%
fma-udef46.3%
+-commutative46.3%
hypot-def46.3%
fma-def46.3%
fma-udef46.3%
+-commutative46.3%
hypot-def61.1%
Applied egg-rr61.1%
*-commutative61.1%
associate-*l/61.1%
div-inv61.2%
fma-def61.1%
+-commutative61.1%
fma-def61.1%
Applied egg-rr61.1%
Taylor expanded in y.im around inf 81.1%
associate-/l*88.2%
Simplified88.2%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (fma x.im (/ y.im y.re) x.re) y.re))
(t_1 (/ x.re (/ y.im y.re))))
(if (<= y.im -4.8e+91)
(/ (- (- x.im) t_1) (hypot y.re y.im))
(if (<= y.im 2.05e-88)
t_0
(if (<= y.im 9.5e-14)
(/ (+ (* x.re y.re) (* x.im y.im)) (fma y.im y.im (* y.re y.re)))
(if (<= y.im 3.5e+44) t_0 (/ (+ x.im t_1) (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
double t_1 = x_46_re / (y_46_im / y_46_re);
double tmp;
if (y_46_im <= -4.8e+91) {
tmp = (-x_46_im - t_1) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= 2.05e-88) {
tmp = t_0;
} else if (y_46_im <= 9.5e-14) {
tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
} else if (y_46_im <= 3.5e+44) {
tmp = t_0;
} else {
tmp = (x_46_im + t_1) / hypot(y_46_re, y_46_im);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re) t_1 = Float64(x_46_re / Float64(y_46_im / y_46_re)) tmp = 0.0 if (y_46_im <= -4.8e+91) tmp = Float64(Float64(Float64(-x_46_im) - t_1) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= 2.05e-88) tmp = t_0; elseif (y_46_im <= 9.5e-14) tmp = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))); elseif (y_46_im <= 3.5e+44) tmp = t_0; else tmp = Float64(Float64(x_46_im + t_1) / hypot(y_46_re, y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -4.8e+91], N[(N[((-x$46$im) - t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.05e-88], t$95$0, If[LessEqual[y$46$im, 9.5e-14], N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.5e+44], t$95$0, N[(N[(x$46$im + t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
t_1 := \frac{x.re}{\frac{y.im}{y.re}}\\
\mathbf{if}\;y.im \leq -4.8 \cdot 10^{+91}:\\
\;\;\;\;\frac{\left(-x.im\right) - t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq 2.05 \cdot 10^{-88}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 9.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{elif}\;y.im \leq 3.5 \cdot 10^{+44}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -4.79999999999999966e91Initial program 37.2%
*-un-lft-identity37.2%
+-commutative37.2%
fma-udef37.2%
add-sqr-sqrt37.2%
times-frac37.1%
fma-udef37.1%
+-commutative37.1%
hypot-def37.1%
fma-def37.1%
fma-udef37.1%
+-commutative37.1%
hypot-def54.1%
Applied egg-rr54.1%
*-commutative54.1%
associate-*l/54.1%
div-inv54.2%
fma-def54.2%
+-commutative54.2%
fma-def54.2%
Applied egg-rr54.2%
Taylor expanded in y.im around -inf 70.8%
mul-1-neg70.8%
unsub-neg70.8%
mul-1-neg70.8%
associate-/l*79.7%
Simplified79.7%
if -4.79999999999999966e91 < y.im < 2.0500000000000001e-88 or 9.4999999999999999e-14 < y.im < 3.4999999999999999e44Initial program 68.3%
Taylor expanded in y.re around inf 52.7%
*-un-lft-identity52.7%
fma-def52.7%
pow252.7%
times-frac63.7%
fma-def63.7%
+-commutative63.7%
fma-def63.7%
Applied egg-rr63.7%
expm1-log1p-u48.4%
expm1-udef25.8%
*-commutative25.8%
div-inv25.8%
associate-*l*23.6%
fma-udef23.6%
+-commutative23.6%
fma-def23.6%
inv-pow23.6%
inv-pow23.6%
pow-prod-up23.6%
metadata-eval23.6%
Applied egg-rr23.6%
expm1-def39.2%
expm1-log1p53.4%
*-commutative53.4%
metadata-eval53.4%
pow-sqr53.4%
unpow-153.4%
unpow-153.4%
associate-*r*63.6%
associate-*l/63.7%
*-lft-identity63.7%
associate-*r/63.7%
Simplified82.0%
if 2.0500000000000001e-88 < y.im < 9.4999999999999999e-14Initial program 82.3%
fma-def82.3%
+-commutative82.3%
fma-def82.3%
Simplified82.3%
fma-def82.3%
Applied egg-rr82.3%
if 3.4999999999999999e44 < y.im Initial program 46.4%
*-un-lft-identity46.4%
+-commutative46.4%
fma-udef46.4%
add-sqr-sqrt46.4%
times-frac46.5%
fma-udef46.5%
+-commutative46.5%
hypot-def46.5%
fma-def46.5%
fma-udef46.5%
+-commutative46.5%
hypot-def60.8%
Applied egg-rr60.8%
*-commutative60.8%
associate-*l/60.8%
div-inv60.8%
fma-def60.8%
+-commutative60.8%
fma-def60.8%
Applied egg-rr60.8%
Taylor expanded in y.im around inf 80.1%
associate-/l*86.9%
Simplified86.9%
Final simplification82.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (fma x.im (/ y.im y.re) x.re) y.re))
(t_1 (+ (/ x.im y.im) (* y.re (/ x.re (pow y.im 2.0))))))
(if (<= y.im -4.8e+91)
t_1
(if (<= y.im 6.5e-88)
t_0
(if (<= y.im 2.55e-14)
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 7e+43) 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 = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
double t_1 = (x_46_im / y_46_im) + (y_46_re * (x_46_re / pow(y_46_im, 2.0)));
double tmp;
if (y_46_im <= -4.8e+91) {
tmp = t_1;
} else if (y_46_im <= 6.5e-88) {
tmp = t_0;
} else if (y_46_im <= 2.55e-14) {
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 <= 7e+43) {
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(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re) t_1 = Float64(Float64(x_46_im / y_46_im) + Float64(y_46_re * Float64(x_46_re / (y_46_im ^ 2.0)))) tmp = 0.0 if (y_46_im <= -4.8e+91) tmp = t_1; elseif (y_46_im <= 6.5e-88) tmp = t_0; elseif (y_46_im <= 2.55e-14) 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 <= 7e+43) 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[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(y$46$re * N[(x$46$re / N[Power[y$46$im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -4.8e+91], t$95$1, If[LessEqual[y$46$im, 6.5e-88], t$95$0, If[LessEqual[y$46$im, 2.55e-14], 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+43], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
t_1 := \frac{x.im}{y.im} + y.re \cdot \frac{x.re}{{y.im}^{2}}\\
\mathbf{if}\;y.im \leq -4.8 \cdot 10^{+91}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq 6.5 \cdot 10^{-88}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 2.55 \cdot 10^{-14}:\\
\;\;\;\;\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 \cdot 10^{+43}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -4.79999999999999966e91 or 7.0000000000000002e43 < y.im Initial program 42.0%
Taylor expanded in y.re around 0 72.5%
associate-/l*75.3%
associate-/r/77.1%
Simplified77.1%
if -4.79999999999999966e91 < y.im < 6.50000000000000006e-88 or 2.5499999999999999e-14 < y.im < 7.0000000000000002e43Initial program 68.3%
Taylor expanded in y.re around inf 52.7%
*-un-lft-identity52.7%
fma-def52.7%
pow252.7%
times-frac63.7%
fma-def63.7%
+-commutative63.7%
fma-def63.7%
Applied egg-rr63.7%
expm1-log1p-u48.4%
expm1-udef25.8%
*-commutative25.8%
div-inv25.8%
associate-*l*23.6%
fma-udef23.6%
+-commutative23.6%
fma-def23.6%
inv-pow23.6%
inv-pow23.6%
pow-prod-up23.6%
metadata-eval23.6%
Applied egg-rr23.6%
expm1-def39.2%
expm1-log1p53.4%
*-commutative53.4%
metadata-eval53.4%
pow-sqr53.4%
unpow-153.4%
unpow-153.4%
associate-*r*63.6%
associate-*l/63.7%
*-lft-identity63.7%
associate-*r/63.7%
Simplified82.0%
if 6.50000000000000006e-88 < y.im < 2.5499999999999999e-14Initial program 82.3%
Final simplification79.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (fma x.im (/ y.im y.re) x.re) y.re)))
(if (<= y.im -5e+91)
(+ (/ x.im y.im) (* y.re (/ x.re (pow y.im 2.0))))
(if (<= y.im 6.5e-88)
t_0
(if (<= y.im 5.2e-14)
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 2.5e+43)
t_0
(/ (+ x.im (/ x.re (/ y.im y.re))) (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
double tmp;
if (y_46_im <= -5e+91) {
tmp = (x_46_im / y_46_im) + (y_46_re * (x_46_re / pow(y_46_im, 2.0)));
} else if (y_46_im <= 6.5e-88) {
tmp = t_0;
} else if (y_46_im <= 5.2e-14) {
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 <= 2.5e+43) {
tmp = t_0;
} else {
tmp = (x_46_im + (x_46_re / (y_46_im / y_46_re))) / hypot(y_46_re, y_46_im);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re) tmp = 0.0 if (y_46_im <= -5e+91) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(y_46_re * Float64(x_46_re / (y_46_im ^ 2.0)))); elseif (y_46_im <= 6.5e-88) tmp = t_0; elseif (y_46_im <= 5.2e-14) 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 <= 2.5e+43) tmp = t_0; else tmp = Float64(Float64(x_46_im + Float64(x_46_re / Float64(y_46_im / y_46_re))) / hypot(y_46_re, y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$im, -5e+91], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(y$46$re * N[(x$46$re / N[Power[y$46$im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.5e-88], t$95$0, If[LessEqual[y$46$im, 5.2e-14], 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+43], t$95$0, N[(N[(x$46$im + N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
\mathbf{if}\;y.im \leq -5 \cdot 10^{+91}:\\
\;\;\;\;\frac{x.im}{y.im} + y.re \cdot \frac{x.re}{{y.im}^{2}}\\
\mathbf{elif}\;y.im \leq 6.5 \cdot 10^{-88}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 5.2 \cdot 10^{-14}:\\
\;\;\;\;\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 2.5 \cdot 10^{+43}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + \frac{x.re}{\frac{y.im}{y.re}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -5.0000000000000002e91Initial program 37.2%
Taylor expanded in y.re around 0 64.8%
associate-/l*70.3%
associate-/r/72.7%
Simplified72.7%
if -5.0000000000000002e91 < y.im < 6.50000000000000006e-88 or 5.19999999999999993e-14 < y.im < 2.5000000000000002e43Initial program 68.3%
Taylor expanded in y.re around inf 52.7%
*-un-lft-identity52.7%
fma-def52.7%
pow252.7%
times-frac63.7%
fma-def63.7%
+-commutative63.7%
fma-def63.7%
Applied egg-rr63.7%
expm1-log1p-u48.4%
expm1-udef25.8%
*-commutative25.8%
div-inv25.8%
associate-*l*23.6%
fma-udef23.6%
+-commutative23.6%
fma-def23.6%
inv-pow23.6%
inv-pow23.6%
pow-prod-up23.6%
metadata-eval23.6%
Applied egg-rr23.6%
expm1-def39.2%
expm1-log1p53.4%
*-commutative53.4%
metadata-eval53.4%
pow-sqr53.4%
unpow-153.4%
unpow-153.4%
associate-*r*63.6%
associate-*l/63.7%
*-lft-identity63.7%
associate-*r/63.7%
Simplified82.0%
if 6.50000000000000006e-88 < y.im < 5.19999999999999993e-14Initial program 82.3%
if 2.5000000000000002e43 < y.im Initial program 46.4%
*-un-lft-identity46.4%
+-commutative46.4%
fma-udef46.4%
add-sqr-sqrt46.4%
times-frac46.5%
fma-udef46.5%
+-commutative46.5%
hypot-def46.5%
fma-def46.5%
fma-udef46.5%
+-commutative46.5%
hypot-def60.8%
Applied egg-rr60.8%
*-commutative60.8%
associate-*l/60.8%
div-inv60.8%
fma-def60.8%
+-commutative60.8%
fma-def60.8%
Applied egg-rr60.8%
Taylor expanded in y.im around inf 80.1%
associate-/l*86.9%
Simplified86.9%
Final simplification81.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (fma x.im (/ y.im y.re) x.re) y.re))
(t_1 (/ x.re (/ y.im y.re))))
(if (<= y.im -1.02e+92)
(/ (- (- x.im) t_1) (hypot y.re y.im))
(if (<= y.im 3.8e-88)
t_0
(if (<= y.im 1.65e-12)
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 9.5e+42) t_0 (/ (+ x.im t_1) (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
double t_1 = x_46_re / (y_46_im / y_46_re);
double tmp;
if (y_46_im <= -1.02e+92) {
tmp = (-x_46_im - t_1) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= 3.8e-88) {
tmp = t_0;
} else if (y_46_im <= 1.65e-12) {
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 <= 9.5e+42) {
tmp = t_0;
} else {
tmp = (x_46_im + t_1) / hypot(y_46_re, y_46_im);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re) t_1 = Float64(x_46_re / Float64(y_46_im / y_46_re)) tmp = 0.0 if (y_46_im <= -1.02e+92) tmp = Float64(Float64(Float64(-x_46_im) - t_1) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= 3.8e-88) tmp = t_0; elseif (y_46_im <= 1.65e-12) 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 <= 9.5e+42) tmp = t_0; else tmp = Float64(Float64(x_46_im + t_1) / hypot(y_46_re, y_46_im)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im * N[(y$46$im / y$46$re), $MachinePrecision] + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.02e+92], N[(N[((-x$46$im) - t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.8e-88], t$95$0, If[LessEqual[y$46$im, 1.65e-12], 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, 9.5e+42], t$95$0, N[(N[(x$46$im + t$95$1), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
t_1 := \frac{x.re}{\frac{y.im}{y.re}}\\
\mathbf{if}\;y.im \leq -1.02 \cdot 10^{+92}:\\
\;\;\;\;\frac{\left(-x.im\right) - t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq 3.8 \cdot 10^{-88}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.65 \cdot 10^{-12}:\\
\;\;\;\;\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 9.5 \cdot 10^{+42}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + t_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -1.02000000000000003e92Initial program 37.2%
*-un-lft-identity37.2%
+-commutative37.2%
fma-udef37.2%
add-sqr-sqrt37.2%
times-frac37.1%
fma-udef37.1%
+-commutative37.1%
hypot-def37.1%
fma-def37.1%
fma-udef37.1%
+-commutative37.1%
hypot-def54.1%
Applied egg-rr54.1%
*-commutative54.1%
associate-*l/54.1%
div-inv54.2%
fma-def54.2%
+-commutative54.2%
fma-def54.2%
Applied egg-rr54.2%
Taylor expanded in y.im around -inf 70.8%
mul-1-neg70.8%
unsub-neg70.8%
mul-1-neg70.8%
associate-/l*79.7%
Simplified79.7%
if -1.02000000000000003e92 < y.im < 3.80000000000000011e-88 or 1.65e-12 < y.im < 9.50000000000000019e42Initial program 68.3%
Taylor expanded in y.re around inf 52.7%
*-un-lft-identity52.7%
fma-def52.7%
pow252.7%
times-frac63.7%
fma-def63.7%
+-commutative63.7%
fma-def63.7%
Applied egg-rr63.7%
expm1-log1p-u48.4%
expm1-udef25.8%
*-commutative25.8%
div-inv25.8%
associate-*l*23.6%
fma-udef23.6%
+-commutative23.6%
fma-def23.6%
inv-pow23.6%
inv-pow23.6%
pow-prod-up23.6%
metadata-eval23.6%
Applied egg-rr23.6%
expm1-def39.2%
expm1-log1p53.4%
*-commutative53.4%
metadata-eval53.4%
pow-sqr53.4%
unpow-153.4%
unpow-153.4%
associate-*r*63.6%
associate-*l/63.7%
*-lft-identity63.7%
associate-*r/63.7%
Simplified82.0%
if 3.80000000000000011e-88 < y.im < 1.65e-12Initial program 82.3%
if 9.50000000000000019e42 < y.im Initial program 46.4%
*-un-lft-identity46.4%
+-commutative46.4%
fma-udef46.4%
add-sqr-sqrt46.4%
times-frac46.5%
fma-udef46.5%
+-commutative46.5%
hypot-def46.5%
fma-def46.5%
fma-udef46.5%
+-commutative46.5%
hypot-def60.8%
Applied egg-rr60.8%
*-commutative60.8%
associate-*l/60.8%
div-inv60.8%
fma-def60.8%
+-commutative60.8%
fma-def60.8%
Applied egg-rr60.8%
Taylor expanded in y.im around inf 80.1%
associate-/l*86.9%
Simplified86.9%
Final simplification82.6%
(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 -2e+116)
(/ (- x.im) (hypot y.re y.im))
(if (<= y.im -5.3e-81)
t_0
(if (<= y.im 6.8e-87)
(/ (fma x.im (/ y.im y.re) x.re) y.re)
(if (<= y.im 1.15e+92) t_0 (/ x.im y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((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 <= -2e+116) {
tmp = -x_46_im / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -5.3e-81) {
tmp = t_0;
} else if (y_46_im <= 6.8e-87) {
tmp = fma(x_46_im, (y_46_im / y_46_re), x_46_re) / y_46_re;
} else if (y_46_im <= 1.15e+92) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(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 <= -2e+116) tmp = Float64(Float64(-x_46_im) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -5.3e-81) tmp = t_0; elseif (y_46_im <= 6.8e-87) tmp = Float64(fma(x_46_im, Float64(y_46_im / y_46_re), x_46_re) / y_46_re); elseif (y_46_im <= 1.15e+92) tmp = t_0; else tmp = Float64(x_46_im / y_46_im); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(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, -2e+116], N[((-x$46$im) / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -5.3e-81], t$95$0, If[LessEqual[y$46$im, 6.8e-87], 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.15e+92], t$95$0, N[(x$46$im / 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 \cdot 10^{+116}:\\
\;\;\;\;\frac{-x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -5.3 \cdot 10^{-81}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 6.8 \cdot 10^{-87}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{y.re}, x.re\right)}{y.re}\\
\mathbf{elif}\;y.im \leq 1.15 \cdot 10^{+92}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -2.00000000000000003e116Initial program 30.4%
*-un-lft-identity30.4%
+-commutative30.4%
fma-udef30.4%
add-sqr-sqrt30.4%
times-frac30.3%
fma-udef30.3%
+-commutative30.3%
hypot-def30.3%
fma-def30.3%
fma-udef30.3%
+-commutative30.3%
hypot-def50.3%
Applied egg-rr50.3%
*-commutative50.3%
associate-*l/50.3%
div-inv50.4%
fma-def50.4%
+-commutative50.4%
fma-def50.4%
Applied egg-rr50.4%
Taylor expanded in y.im around -inf 68.0%
mul-1-neg68.0%
Simplified68.0%
if -2.00000000000000003e116 < y.im < -5.3000000000000003e-81 or 6.7999999999999997e-87 < y.im < 1.14999999999999999e92Initial program 73.1%
if -5.3000000000000003e-81 < y.im < 6.7999999999999997e-87Initial program 67.7%
Taylor expanded in y.re around inf 60.0%
*-un-lft-identity60.0%
fma-def60.0%
pow260.0%
times-frac69.7%
fma-def69.7%
+-commutative69.7%
fma-def69.7%
Applied egg-rr69.7%
expm1-log1p-u50.1%
expm1-udef29.7%
*-commutative29.7%
div-inv29.7%
associate-*l*26.4%
fma-udef26.4%
+-commutative26.4%
fma-def26.4%
inv-pow26.4%
inv-pow26.4%
pow-prod-up26.4%
metadata-eval26.4%
Applied egg-rr26.4%
expm1-def43.0%
expm1-log1p61.0%
*-commutative61.0%
metadata-eval61.0%
pow-sqr60.9%
unpow-160.9%
unpow-160.9%
associate-*r*69.5%
associate-*l/69.7%
*-lft-identity69.7%
associate-*r/69.8%
Simplified88.6%
if 1.14999999999999999e92 < y.im Initial program 42.6%
Taylor expanded in y.re around 0 81.7%
Final simplification78.6%
(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.re -1.16e+104)
(/ x.re y.re)
(if (<= y.re -1.5e-224)
t_0
(if (<= y.re 2.45e-218)
(/ x.im y.im)
(if (<= y.re 8e+94) t_0 (/ x.re (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.16e+104) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -1.5e-224) {
tmp = t_0;
} else if (y_46_re <= 2.45e-218) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 8e+94) {
tmp = t_0;
} else {
tmp = x_46_re / hypot(y_46_re, y_46_im);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.16e+104) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -1.5e-224) {
tmp = t_0;
} else if (y_46_re <= 2.45e-218) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 8e+94) {
tmp = t_0;
} else {
tmp = x_46_re / Math.hypot(y_46_re, y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -1.16e+104: tmp = x_46_re / y_46_re elif y_46_re <= -1.5e-224: tmp = t_0 elif y_46_re <= 2.45e-218: tmp = x_46_im / y_46_im elif y_46_re <= 8e+94: tmp = t_0 else: tmp = x_46_re / math.hypot(y_46_re, y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -1.16e+104) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= -1.5e-224) tmp = t_0; elseif (y_46_re <= 2.45e-218) tmp = Float64(x_46_im / y_46_im); elseif (y_46_re <= 8e+94) tmp = t_0; else tmp = Float64(x_46_re / hypot(y_46_re, y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -1.16e+104) tmp = x_46_re / y_46_re; elseif (y_46_re <= -1.5e-224) tmp = t_0; elseif (y_46_re <= 2.45e-218) tmp = x_46_im / y_46_im; elseif (y_46_re <= 8e+94) tmp = t_0; else tmp = x_46_re / hypot(y_46_re, y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.16e+104], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -1.5e-224], t$95$0, If[LessEqual[y$46$re, 2.45e-218], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 8e+94], t$95$0, N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.16 \cdot 10^{+104}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq -1.5 \cdot 10^{-224}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 2.45 \cdot 10^{-218}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{+94}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.1599999999999999e104Initial program 37.6%
Taylor expanded in y.re around inf 72.6%
if -1.1599999999999999e104 < y.re < -1.49999999999999991e-224 or 2.44999999999999989e-218 < y.re < 8.0000000000000002e94Initial program 73.1%
if -1.49999999999999991e-224 < y.re < 2.44999999999999989e-218Initial program 65.4%
Taylor expanded in y.re around 0 88.0%
if 8.0000000000000002e94 < y.re Initial program 33.2%
*-un-lft-identity33.2%
+-commutative33.2%
fma-udef33.2%
add-sqr-sqrt33.2%
times-frac33.2%
fma-udef33.2%
+-commutative33.2%
hypot-def33.2%
fma-def33.2%
fma-udef33.2%
+-commutative33.2%
hypot-def54.5%
Applied egg-rr54.5%
*-commutative54.5%
associate-*l/54.5%
div-inv54.6%
fma-def54.6%
+-commutative54.6%
fma-def54.6%
Applied egg-rr54.6%
Taylor expanded in y.im around 0 80.7%
Final simplification76.4%
(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.re -5.2e+105)
(/ (- x.re) (hypot y.re y.im))
(if (<= y.re -5.2e-228)
t_0
(if (<= y.re 1.3e-220)
(/ x.im y.im)
(if (<= y.re 1.2e+94) t_0 (/ x.re (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -5.2e+105) {
tmp = -x_46_re / hypot(y_46_re, y_46_im);
} else if (y_46_re <= -5.2e-228) {
tmp = t_0;
} else if (y_46_re <= 1.3e-220) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 1.2e+94) {
tmp = t_0;
} else {
tmp = x_46_re / hypot(y_46_re, y_46_im);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -5.2e+105) {
tmp = -x_46_re / Math.hypot(y_46_re, y_46_im);
} else if (y_46_re <= -5.2e-228) {
tmp = t_0;
} else if (y_46_re <= 1.3e-220) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 1.2e+94) {
tmp = t_0;
} else {
tmp = x_46_re / Math.hypot(y_46_re, y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -5.2e+105: tmp = -x_46_re / math.hypot(y_46_re, y_46_im) elif y_46_re <= -5.2e-228: tmp = t_0 elif y_46_re <= 1.3e-220: tmp = x_46_im / y_46_im elif y_46_re <= 1.2e+94: tmp = t_0 else: tmp = x_46_re / math.hypot(y_46_re, y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_re <= -5.2e+105) tmp = Float64(Float64(-x_46_re) / hypot(y_46_re, y_46_im)); elseif (y_46_re <= -5.2e-228) tmp = t_0; elseif (y_46_re <= 1.3e-220) tmp = Float64(x_46_im / y_46_im); elseif (y_46_re <= 1.2e+94) tmp = t_0; else tmp = Float64(x_46_re / hypot(y_46_re, y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -5.2e+105) tmp = -x_46_re / hypot(y_46_re, y_46_im); elseif (y_46_re <= -5.2e-228) tmp = t_0; elseif (y_46_re <= 1.3e-220) tmp = x_46_im / y_46_im; elseif (y_46_re <= 1.2e+94) tmp = t_0; else tmp = x_46_re / hypot(y_46_re, y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.2e+105], N[((-x$46$re) / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -5.2e-228], t$95$0, If[LessEqual[y$46$re, 1.3e-220], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.2e+94], t$95$0, N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -5.2 \cdot 10^{+105}:\\
\;\;\;\;\frac{-x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \leq -5.2 \cdot 10^{-228}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 1.3 \cdot 10^{-220}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+94}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -5.2000000000000004e105Initial program 37.6%
*-un-lft-identity37.6%
+-commutative37.6%
fma-udef37.6%
add-sqr-sqrt37.6%
times-frac37.7%
fma-udef37.7%
+-commutative37.7%
hypot-def37.7%
fma-def37.7%
fma-udef37.7%
+-commutative37.7%
hypot-def62.8%
Applied egg-rr62.8%
*-commutative62.8%
associate-*l/62.8%
div-inv62.8%
fma-def62.8%
+-commutative62.8%
fma-def62.8%
Applied egg-rr62.8%
Taylor expanded in y.re around -inf 72.8%
neg-mul-172.8%
Simplified72.8%
if -5.2000000000000004e105 < y.re < -5.2e-228 or 1.3e-220 < y.re < 1.19999999999999991e94Initial program 73.1%
if -5.2e-228 < y.re < 1.3e-220Initial program 65.4%
Taylor expanded in y.re around 0 88.0%
if 1.19999999999999991e94 < y.re Initial program 33.2%
*-un-lft-identity33.2%
+-commutative33.2%
fma-udef33.2%
add-sqr-sqrt33.2%
times-frac33.2%
fma-udef33.2%
+-commutative33.2%
hypot-def33.2%
fma-def33.2%
fma-udef33.2%
+-commutative33.2%
hypot-def54.5%
Applied egg-rr54.5%
*-commutative54.5%
associate-*l/54.5%
div-inv54.6%
fma-def54.6%
+-commutative54.6%
fma-def54.6%
Applied egg-rr54.6%
Taylor expanded in y.im around 0 80.7%
Final simplification76.4%
(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.re -5.5e+105)
(/ x.re y.re)
(if (<= y.re -1.15e-225)
t_0
(if (<= y.re 5.8e-222)
(/ x.im y.im)
(if (<= y.re 3.1e+127) t_0 (/ x.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)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -5.5e+105) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -1.15e-225) {
tmp = t_0;
} else if (y_46_re <= 5.8e-222) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 3.1e+127) {
tmp = t_0;
} 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) :: 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_46re <= (-5.5d+105)) then
tmp = x_46re / y_46re
else if (y_46re <= (-1.15d-225)) then
tmp = t_0
else if (y_46re <= 5.8d-222) then
tmp = x_46im / y_46im
else if (y_46re <= 3.1d+127) then
tmp = t_0
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 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_re <= -5.5e+105) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -1.15e-225) {
tmp = t_0;
} else if (y_46_re <= 5.8e-222) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 3.1e+127) {
tmp = t_0;
} else {
tmp = x_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)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -5.5e+105: tmp = x_46_re / y_46_re elif y_46_re <= -1.15e-225: tmp = t_0 elif y_46_re <= 5.8e-222: tmp = x_46_im / y_46_im elif y_46_re <= 3.1e+127: tmp = t_0 else: tmp = x_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(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_re <= -5.5e+105) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= -1.15e-225) tmp = t_0; elseif (y_46_re <= 5.8e-222) tmp = Float64(x_46_im / y_46_im); elseif (y_46_re <= 3.1e+127) tmp = t_0; 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) 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_re <= -5.5e+105) tmp = x_46_re / y_46_re; elseif (y_46_re <= -1.15e-225) tmp = t_0; elseif (y_46_re <= 5.8e-222) tmp = x_46_im / y_46_im; elseif (y_46_re <= 3.1e+127) tmp = t_0; 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_] := 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$re, -5.5e+105], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -1.15e-225], t$95$0, If[LessEqual[y$46$re, 5.8e-222], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 3.1e+127], t$95$0, N[(x$46$re / y$46$re), $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.re \leq -5.5 \cdot 10^{+105}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq -1.15 \cdot 10^{-225}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 5.8 \cdot 10^{-222}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.re \leq 3.1 \cdot 10^{+127}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.re < -5.49999999999999979e105 or 3.1000000000000002e127 < y.re Initial program 30.5%
Taylor expanded in y.re around inf 75.4%
if -5.49999999999999979e105 < y.re < -1.1499999999999999e-225 or 5.8000000000000004e-222 < y.re < 3.1000000000000002e127Initial program 74.0%
if -1.1499999999999999e-225 < y.re < 5.8000000000000004e-222Initial program 65.4%
Taylor expanded in y.re around 0 88.0%
Final simplification76.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.6e+92) (not (<= y.im 3.7e+43))) (/ 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 <= -1.6e+92) || !(y_46_im <= 3.7e+43)) {
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 <= (-1.6d+92)) .or. (.not. (y_46im <= 3.7d+43))) 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 <= -1.6e+92) || !(y_46_im <= 3.7e+43)) {
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 <= -1.6e+92) or not (y_46_im <= 3.7e+43): 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 <= -1.6e+92) || !(y_46_im <= 3.7e+43)) 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 <= -1.6e+92) || ~((y_46_im <= 3.7e+43))) 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, -1.6e+92], N[Not[LessEqual[y$46$im, 3.7e+43]], $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.6 \cdot 10^{+92} \lor \neg \left(y.im \leq 3.7 \cdot 10^{+43}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -1.60000000000000013e92 or 3.7000000000000001e43 < y.im Initial program 42.0%
Taylor expanded in y.re around 0 71.7%
if -1.60000000000000013e92 < y.im < 3.7000000000000001e43Initial program 70.4%
Taylor expanded in y.re around inf 61.7%
Final simplification65.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 58.2%
Taylor expanded in y.re around 0 42.5%
Final simplification42.5%
herbie shell --seed 2024010
(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))))