
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re 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_im * y_46_re) - (x_46_re * 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_46im * y_46re) - (x_46re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - Float64(x_46_re * 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_im * y_46_re) - (x_46_re * 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$im * y$46$re), $MachinePrecision] - N[(x$46$re * 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.im \cdot y.re - x.re \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.im y.re) (* x.re 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_im * y_46_re) - (x_46_re * 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_46im * y_46re) - (x_46re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - (x_46_re * 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_im * y_46_re) - Float64(x_46_re * 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_im * y_46_re) - (x_46_re * 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$im * y$46$re), $MachinePrecision] - N[(x$46$re * 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.im \cdot y.re - x.re \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.im (hypot y.re y.im))) (t_1 (/ y.re (hypot y.re y.im))))
(if (or (<= y.im -1.35e+154) (not (<= y.im 2.05e+164)))
(fma t_1 t_0 (/ (- x.re) y.im))
(fma t_1 t_0 (/ (- x.re) (/ (pow (hypot y.re y.im) 2.0) 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_im / hypot(y_46_re, y_46_im);
double t_1 = y_46_re / hypot(y_46_re, y_46_im);
double tmp;
if ((y_46_im <= -1.35e+154) || !(y_46_im <= 2.05e+164)) {
tmp = fma(t_1, t_0, (-x_46_re / y_46_im));
} else {
tmp = fma(t_1, t_0, (-x_46_re / (pow(hypot(y_46_re, y_46_im), 2.0) / y_46_im)));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_im / hypot(y_46_re, y_46_im)) t_1 = Float64(y_46_re / hypot(y_46_re, y_46_im)) tmp = 0.0 if ((y_46_im <= -1.35e+154) || !(y_46_im <= 2.05e+164)) tmp = fma(t_1, t_0, Float64(Float64(-x_46_re) / y_46_im)); else tmp = fma(t_1, t_0, Float64(Float64(-x_46_re) / Float64((hypot(y_46_re, y_46_im) ^ 2.0) / 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[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y$46$im, -1.35e+154], N[Not[LessEqual[y$46$im, 2.05e+164]], $MachinePrecision]], N[(t$95$1 * t$95$0 + N[((-x$46$re) / y$46$im), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$0 + N[((-x$46$re) / N[(N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{if}\;y.im \leq -1.35 \cdot 10^{+154} \lor \neg \left(y.im \leq 2.05 \cdot 10^{+164}\right):\\
\;\;\;\;\mathsf{fma}\left(t_1, t_0, \frac{-x.re}{y.im}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t_1, t_0, \frac{-x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}\right)\\
\end{array}
\end{array}
if y.im < -1.35000000000000003e154 or 2.05000000000000008e164 < y.im Initial program 21.7%
div-sub21.7%
*-commutative21.7%
add-sqr-sqrt21.7%
times-frac22.0%
fma-neg22.0%
hypot-def22.0%
hypot-def34.6%
associate-/l*37.4%
add-sqr-sqrt37.4%
pow237.4%
hypot-def37.4%
Applied egg-rr37.4%
Taylor expanded in y.re around 0 97.6%
if -1.35000000000000003e154 < y.im < 2.05000000000000008e164Initial program 73.7%
div-sub69.8%
*-commutative69.8%
add-sqr-sqrt69.8%
times-frac76.3%
fma-neg76.3%
hypot-def76.4%
hypot-def88.7%
associate-/l*93.8%
add-sqr-sqrt93.8%
pow293.8%
hypot-def93.8%
Applied egg-rr93.8%
Final simplification94.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 4e+305)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(/ (- x.re) y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 4e+305) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), (-x_46_re / y_46_im));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 4e+305) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); else tmp = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(-x_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 * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $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], 4e+305], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re / 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] + N[((-x$46$re) / y$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 4 \cdot 10^{+305}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{-x.re}{y.im}\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 3.9999999999999998e305Initial program 76.0%
*-un-lft-identity76.0%
add-sqr-sqrt76.0%
times-frac76.0%
hypot-def76.0%
hypot-def96.1%
Applied egg-rr96.1%
if 3.9999999999999998e305 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 12.1%
div-sub6.3%
*-commutative6.3%
add-sqr-sqrt6.3%
times-frac15.2%
fma-neg15.2%
hypot-def15.2%
hypot-def38.3%
associate-/l*51.2%
add-sqr-sqrt51.2%
pow251.2%
hypot-def51.2%
Applied egg-rr51.2%
Taylor expanded in y.re around 0 80.4%
Final simplification91.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 4e+305)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(/ (- (* x.im (/ y.re y.im)) x.re) y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 4e+305) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_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 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 4e+305) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (t_0 / Math.hypot(y_46_re, y_46_im));
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / 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_im) - (y_46_im * x_46_re) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 4e+305: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (t_0 / math.hypot(y_46_re, y_46_im)) else: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 4e+305) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); else tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_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 = (y_46_re * x_46_im) - (y_46_im * x_46_re); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 4e+305) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im)); else tmp = ((x_46_im * (y_46_re / y_46_im)) - x_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[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $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], 4e+305], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 4 \cdot 10^{+305}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < 3.9999999999999998e305Initial program 76.0%
*-un-lft-identity76.0%
add-sqr-sqrt76.0%
times-frac76.0%
hypot-def76.0%
hypot-def96.1%
Applied egg-rr96.1%
if 3.9999999999999998e305 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 12.1%
Taylor expanded in y.re around 0 57.6%
+-commutative57.6%
mul-1-neg57.6%
unsub-neg57.6%
unpow257.6%
times-frac62.6%
Simplified62.6%
associate-*r/63.9%
sub-div65.3%
Applied egg-rr65.3%
Final simplification87.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.6e-12)
(- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im))
(if (<= y.im 2.5e-53)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 5.8e+92)
(* (- (* y.re x.im) (* y.im x.re)) (/ 1.0 (pow (hypot y.re y.im) 2.0)))
(* (/ 1.0 (hypot y.re y.im)) (- (/ y.re (/ y.im x.im)) x.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 <= -5.6e-12) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else if (y_46_im <= 2.5e-53) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 5.8e+92) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) * (1.0 / pow(hypot(y_46_re, y_46_im), 2.0));
} else {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * ((y_46_re / (y_46_im / x_46_im)) - x_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5.6e-12) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else if (y_46_im <= 2.5e-53) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 5.8e+92) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) * (1.0 / Math.pow(Math.hypot(y_46_re, y_46_im), 2.0));
} else {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * ((y_46_re / (y_46_im / x_46_im)) - x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -5.6e-12: tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) elif y_46_im <= 2.5e-53: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 5.8e+92: tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) * (1.0 / math.pow(math.hypot(y_46_re, y_46_im), 2.0)) else: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * ((y_46_re / (y_46_im / x_46_im)) - x_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 <= -5.6e-12) tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)); elseif (y_46_im <= 2.5e-53) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 5.8e+92) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) * Float64(1.0 / (hypot(y_46_re, y_46_im) ^ 2.0))); else tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(Float64(y_46_re / Float64(y_46_im / x_46_im)) - x_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 <= -5.6e-12) tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); elseif (y_46_im <= 2.5e-53) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 5.8e+92) tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) * (1.0 / (hypot(y_46_re, y_46_im) ^ 2.0)); else tmp = (1.0 / hypot(y_46_re, y_46_im)) * ((y_46_re / (y_46_im / x_46_im)) - x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -5.6e-12], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.5e-53], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5.8e+92], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.6 \cdot 10^{-12}:\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 2.5 \cdot 10^{-53}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 5.8 \cdot 10^{+92}:\\
\;\;\;\;\left(y.re \cdot x.im - y.im \cdot x.re\right) \cdot \frac{1}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\frac{y.re}{\frac{y.im}{x.im}} - x.re\right)\\
\end{array}
\end{array}
if y.im < -5.6000000000000004e-12Initial program 47.2%
Taylor expanded in y.re around 0 86.7%
+-commutative86.7%
mul-1-neg86.7%
unsub-neg86.7%
unpow286.7%
times-frac89.7%
Simplified89.7%
if -5.6000000000000004e-12 < y.im < 2.5e-53Initial program 72.4%
Taylor expanded in y.re around inf 82.6%
mul-1-neg82.6%
unsub-neg82.6%
unpow282.6%
times-frac87.4%
Simplified87.4%
associate-*l/89.2%
sub-div91.3%
Applied egg-rr91.3%
if 2.5e-53 < y.im < 5.8000000000000001e92Initial program 81.9%
clear-num81.8%
associate-/r/81.9%
add-sqr-sqrt81.9%
pow281.9%
hypot-def81.9%
Applied egg-rr81.9%
if 5.8000000000000001e92 < y.im Initial program 33.9%
div-sub33.9%
sub-neg33.9%
associate-/l*32.7%
add-sqr-sqrt32.7%
pow232.7%
hypot-def32.7%
associate-/l*39.2%
add-sqr-sqrt39.2%
pow239.2%
hypot-def39.2%
Applied egg-rr39.2%
sub-neg39.2%
associate-/r/42.6%
associate-*l/40.3%
associate-/l*33.9%
div-sub33.9%
*-commutative33.9%
Simplified33.9%
*-un-lft-identity33.9%
unpow233.9%
times-frac53.2%
*-commutative53.2%
Applied egg-rr53.2%
Taylor expanded in y.re around 0 78.6%
neg-mul-178.6%
unsub-neg78.6%
associate-/l*82.6%
Simplified82.6%
Final simplification87.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.45e-23)
(- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im))
(if (<= y.im 3e-51)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 1.7e+91)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(* (/ 1.0 (hypot y.re y.im)) (- (/ y.re (/ y.im x.im)) x.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.45e-23) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else if (y_46_im <= 3e-51) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1.7e+91) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * ((y_46_re / (y_46_im / x_46_im)) - x_46_re);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.45e-23) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else if (y_46_im <= 3e-51) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1.7e+91) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * ((y_46_re / (y_46_im / x_46_im)) - x_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.45e-23: tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) elif y_46_im <= 3e-51: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 1.7e+91: tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) else: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * ((y_46_re / (y_46_im / x_46_im)) - x_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.45e-23) tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)); elseif (y_46_im <= 3e-51) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 1.7e+91) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(Float64(y_46_re / Float64(y_46_im / x_46_im)) - x_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.45e-23) tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); elseif (y_46_im <= 3e-51) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 1.7e+91) tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); else tmp = (1.0 / hypot(y_46_re, y_46_im)) * ((y_46_re / (y_46_im / x_46_im)) - x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.45e-23], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3e-51], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.7e+91], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.45 \cdot 10^{-23}:\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 3 \cdot 10^{-51}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{+91}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\frac{y.re}{\frac{y.im}{x.im}} - x.re\right)\\
\end{array}
\end{array}
if y.im < -1.4500000000000001e-23Initial program 47.2%
Taylor expanded in y.re around 0 86.7%
+-commutative86.7%
mul-1-neg86.7%
unsub-neg86.7%
unpow286.7%
times-frac89.7%
Simplified89.7%
if -1.4500000000000001e-23 < y.im < 3.00000000000000002e-51Initial program 72.4%
Taylor expanded in y.re around inf 82.6%
mul-1-neg82.6%
unsub-neg82.6%
unpow282.6%
times-frac87.4%
Simplified87.4%
associate-*l/89.2%
sub-div91.3%
Applied egg-rr91.3%
if 3.00000000000000002e-51 < y.im < 1.7e91Initial program 81.9%
if 1.7e91 < y.im Initial program 33.9%
div-sub33.9%
sub-neg33.9%
associate-/l*32.7%
add-sqr-sqrt32.7%
pow232.7%
hypot-def32.7%
associate-/l*39.2%
add-sqr-sqrt39.2%
pow239.2%
hypot-def39.2%
Applied egg-rr39.2%
sub-neg39.2%
associate-/r/42.6%
associate-*l/40.3%
associate-/l*33.9%
div-sub33.9%
*-commutative33.9%
Simplified33.9%
*-un-lft-identity33.9%
unpow233.9%
times-frac53.2%
*-commutative53.2%
Applied egg-rr53.2%
Taylor expanded in y.re around 0 78.6%
neg-mul-178.6%
unsub-neg78.6%
associate-/l*82.6%
Simplified82.6%
Final simplification87.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im))))
(if (<= y.im -1.15e-15)
t_0
(if (<= y.im 8.2e-53)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.im 1.3e+93)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -1.15e-15) {
tmp = t_0;
} else if (y_46_im <= 8.2e-53) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1.3e+93) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = ((y_46re / y_46im) * (x_46im / y_46im)) - (x_46re / y_46im)
if (y_46im <= (-1.15d-15)) then
tmp = t_0
else if (y_46im <= 8.2d-53) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else if (y_46im <= 1.3d+93) then
tmp = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -1.15e-15) {
tmp = t_0;
} else if (y_46_im <= 8.2e-53) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_im <= 1.3e+93) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -1.15e-15: tmp = t_0 elif y_46_im <= 8.2e-53: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_im <= 1.3e+93: tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -1.15e-15) tmp = t_0; elseif (y_46_im <= 8.2e-53) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_im <= 1.3e+93) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -1.15e-15) tmp = t_0; elseif (y_46_im <= 8.2e-53) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_im <= 1.3e+93) tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); else tmp = t_0; 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 / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.15e-15], t$95$0, If[LessEqual[y$46$im, 8.2e-53], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.3e+93], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.15 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 8.2 \cdot 10^{-53}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.3 \cdot 10^{+93}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.im < -1.14999999999999995e-15 or 1.3e93 < y.im Initial program 41.5%
Taylor expanded in y.re around 0 80.3%
+-commutative80.3%
mul-1-neg80.3%
unsub-neg80.3%
unpow280.3%
times-frac85.7%
Simplified85.7%
if -1.14999999999999995e-15 < y.im < 8.2000000000000001e-53Initial program 72.4%
Taylor expanded in y.re around inf 82.6%
mul-1-neg82.6%
unsub-neg82.6%
unpow282.6%
times-frac87.4%
Simplified87.4%
associate-*l/89.2%
sub-div91.3%
Applied egg-rr91.3%
if 8.2000000000000001e-53 < y.im < 1.3e93Initial program 81.9%
Final simplification87.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.8e-13) (not (<= y.im 1.3e+98))) (- (* (/ y.re y.im) (/ x.im y.im)) (/ x.re y.im)) (/ (- x.im (* x.re (/ 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 <= -2.8e-13) || !(y_46_im <= 1.3e+98)) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else {
tmp = (x_46_im - (x_46_re * (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 <= (-2.8d-13)) .or. (.not. (y_46im <= 1.3d+98))) then
tmp = ((y_46re / y_46im) * (x_46im / y_46im)) - (x_46re / y_46im)
else
tmp = (x_46im - (x_46re * (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 <= -2.8e-13) || !(y_46_im <= 1.3e+98)) {
tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im);
} else {
tmp = (x_46_im - (x_46_re * (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 <= -2.8e-13) or not (y_46_im <= 1.3e+98): tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im) else: tmp = (x_46_im - (x_46_re * (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 <= -2.8e-13) || !(y_46_im <= 1.3e+98)) tmp = Float64(Float64(Float64(y_46_re / y_46_im) * Float64(x_46_im / y_46_im)) - Float64(x_46_re / y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * 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 <= -2.8e-13) || ~((y_46_im <= 1.3e+98))) tmp = ((y_46_re / y_46_im) * (x_46_im / y_46_im)) - (x_46_re / y_46_im); else tmp = (x_46_im - (x_46_re * (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, -2.8e-13], N[Not[LessEqual[y$46$im, 1.3e+98]], $MachinePrecision]], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * 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 -2.8 \cdot 10^{-13} \lor \neg \left(y.im \leq 1.3 \cdot 10^{+98}\right):\\
\;\;\;\;\frac{y.re}{y.im} \cdot \frac{x.im}{y.im} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -2.8000000000000002e-13 or 1.3e98 < y.im Initial program 41.4%
Taylor expanded in y.re around 0 80.8%
+-commutative80.8%
mul-1-neg80.8%
unsub-neg80.8%
unpow280.8%
times-frac86.2%
Simplified86.2%
if -2.8000000000000002e-13 < y.im < 1.3e98Initial program 74.4%
Taylor expanded in y.re around inf 74.8%
mul-1-neg74.8%
unsub-neg74.8%
unpow274.8%
times-frac79.7%
Simplified79.7%
associate-*l/81.1%
sub-div82.6%
Applied egg-rr82.6%
Final simplification84.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.35e-15) (not (<= y.im 1.55e+98))) (/ (- x.re) y.im) (/ (- x.im (* x.re (/ 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 <= -1.35e-15) || !(y_46_im <= 1.55e+98)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (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 <= (-1.35d-15)) .or. (.not. (y_46im <= 1.55d+98))) then
tmp = -x_46re / y_46im
else
tmp = (x_46im - (x_46re * (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 <= -1.35e-15) || !(y_46_im <= 1.55e+98)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (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 <= -1.35e-15) or not (y_46_im <= 1.55e+98): tmp = -x_46_re / y_46_im else: tmp = (x_46_im - (x_46_re * (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 <= -1.35e-15) || !(y_46_im <= 1.55e+98)) tmp = Float64(Float64(-x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * 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 <= -1.35e-15) || ~((y_46_im <= 1.55e+98))) tmp = -x_46_re / y_46_im; else tmp = (x_46_im - (x_46_re * (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, -1.35e-15], N[Not[LessEqual[y$46$im, 1.55e+98]], $MachinePrecision]], N[((-x$46$re) / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * 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 -1.35 \cdot 10^{-15} \lor \neg \left(y.im \leq 1.55 \cdot 10^{+98}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -1.35000000000000005e-15 or 1.5500000000000001e98 < y.im Initial program 41.4%
Taylor expanded in y.re around 0 77.3%
associate-*r/77.3%
neg-mul-177.3%
Simplified77.3%
if -1.35000000000000005e-15 < y.im < 1.5500000000000001e98Initial program 74.4%
Taylor expanded in y.re around inf 74.8%
mul-1-neg74.8%
unsub-neg74.8%
unpow274.8%
times-frac79.7%
Simplified79.7%
associate-*l/81.1%
sub-div82.6%
Applied egg-rr82.6%
Final simplification80.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -5e-9) (not (<= y.im 1.15e+98))) (/ (- (* x.im (/ y.re y.im)) x.re) y.im) (/ (- x.im (* x.re (/ 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 <= -5e-9) || !(y_46_im <= 1.15e+98)) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (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 <= (-5d-9)) .or. (.not. (y_46im <= 1.15d+98))) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else
tmp = (x_46im - (x_46re * (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 <= -5e-9) || !(y_46_im <= 1.15e+98)) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (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 <= -5e-9) or not (y_46_im <= 1.15e+98): tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im - (x_46_re * (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 <= -5e-9) || !(y_46_im <= 1.15e+98)) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * 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 <= -5e-9) || ~((y_46_im <= 1.15e+98))) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im - (x_46_re * (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, -5e-9], N[Not[LessEqual[y$46$im, 1.15e+98]], $MachinePrecision]], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * 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 -5 \cdot 10^{-9} \lor \neg \left(y.im \leq 1.15 \cdot 10^{+98}\right):\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -5.0000000000000001e-9 or 1.15000000000000007e98 < y.im Initial program 41.4%
Taylor expanded in y.re around 0 80.8%
+-commutative80.8%
mul-1-neg80.8%
unsub-neg80.8%
unpow280.8%
times-frac86.2%
Simplified86.2%
associate-*r/86.1%
sub-div86.2%
Applied egg-rr86.2%
if -5.0000000000000001e-9 < y.im < 1.15000000000000007e98Initial program 74.4%
Taylor expanded in y.re around inf 74.8%
mul-1-neg74.8%
unsub-neg74.8%
unpow274.8%
times-frac79.7%
Simplified79.7%
associate-*l/81.1%
sub-div82.6%
Applied egg-rr82.6%
Final simplification84.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -5.6e-50) (not (<= y.im 2.8e+60))) (/ (- x.re) y.im) (/ x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -5.6e-50) || !(y_46_im <= 2.8e+60)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-5.6d-50)) .or. (.not. (y_46im <= 2.8d+60))) then
tmp = -x_46re / y_46im
else
tmp = x_46im / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -5.6e-50) || !(y_46_im <= 2.8e+60)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -5.6e-50) or not (y_46_im <= 2.8e+60): tmp = -x_46_re / y_46_im else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -5.6e-50) || !(y_46_im <= 2.8e+60)) tmp = Float64(Float64(-x_46_re) / y_46_im); else tmp = Float64(x_46_im / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -5.6e-50) || ~((y_46_im <= 2.8e+60))) tmp = -x_46_re / y_46_im; else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -5.6e-50], N[Not[LessEqual[y$46$im, 2.8e+60]], $MachinePrecision]], N[((-x$46$re) / y$46$im), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.6 \cdot 10^{-50} \lor \neg \left(y.im \leq 2.8 \cdot 10^{+60}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -5.5999999999999996e-50 or 2.8e60 < y.im Initial program 43.6%
Taylor expanded in y.re around 0 74.7%
associate-*r/74.7%
neg-mul-174.7%
Simplified74.7%
if -5.5999999999999996e-50 < y.im < 2.8e60Initial program 74.7%
Taylor expanded in y.re around inf 72.8%
Final simplification73.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -6.8e+163) (/ x.re y.im) (/ x.im y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -6.8e+163) {
tmp = x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46im <= (-6.8d+163)) then
tmp = x_46re / y_46im
else
tmp = x_46im / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -6.8e+163) {
tmp = x_46_re / y_46_im;
} else {
tmp = x_46_im / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -6.8e+163: tmp = x_46_re / y_46_im else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -6.8e+163) tmp = Float64(x_46_re / y_46_im); else tmp = Float64(x_46_im / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -6.8e+163) tmp = x_46_re / y_46_im; else tmp = x_46_im / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -6.8e+163], N[(x$46$re / y$46$im), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -6.8 \cdot 10^{+163}:\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -6.8000000000000002e163Initial program 26.3%
div-sub26.3%
sub-neg26.3%
associate-/l*26.6%
add-sqr-sqrt26.6%
pow226.6%
hypot-def26.6%
associate-/l*27.9%
add-sqr-sqrt27.9%
pow227.9%
hypot-def27.9%
Applied egg-rr27.9%
sub-neg27.9%
associate-/r/27.9%
associate-*l/27.6%
associate-/l*26.3%
div-sub26.3%
*-commutative26.3%
Simplified26.3%
*-un-lft-identity26.3%
unpow226.3%
times-frac60.0%
*-commutative60.0%
Applied egg-rr60.0%
Taylor expanded in y.re around 0 26.5%
Taylor expanded in y.im around -inf 26.9%
if -6.8000000000000002e163 < y.im Initial program 64.0%
Taylor expanded in y.re around inf 50.3%
Final simplification46.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.im))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46im
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_im) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 58.3%
div-sub55.5%
sub-neg55.5%
associate-/l*58.7%
add-sqr-sqrt58.7%
pow258.7%
hypot-def58.7%
associate-/l*62.7%
add-sqr-sqrt62.7%
pow262.7%
hypot-def62.7%
Applied egg-rr62.7%
sub-neg62.7%
associate-/r/60.8%
associate-*l/59.5%
associate-/l*55.5%
div-sub58.3%
*-commutative58.3%
Simplified58.3%
*-un-lft-identity58.3%
unpow258.3%
times-frac73.7%
*-commutative73.7%
Applied egg-rr73.7%
Taylor expanded in y.re around 0 33.1%
Taylor expanded in y.re around inf 10.5%
Final simplification10.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.re))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_re;
}
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_46re
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_re;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_re
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_re) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_re; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$re), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.re}
\end{array}
Initial program 58.3%
Taylor expanded in y.re around inf 44.3%
Final simplification44.3%
herbie shell --seed 2023193
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, imaginary part"
:precision binary64
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))