
(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 9 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
(fma
(/ 1.0 (hypot y.re y.im))
(/ x.im (/ (hypot y.re y.im) y.re))
(/ (- x.re) (/ (pow (hypot y.re y.im) 2.0) y.im))))
(t_1
(-
(/ (* y.re (/ x.im (hypot y.re y.im))) (hypot y.re y.im))
(/ x.re y.im))))
(if (<= y.im -2.16e+161)
t_1
(if (<= y.im -3.6e-134)
t_0
(if (<= y.im 1.55e-167)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 5.8e+132) 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((1.0 / hypot(y_46_re, y_46_im)), (x_46_im / (hypot(y_46_re, y_46_im) / y_46_re)), (-x_46_re / (pow(hypot(y_46_re, y_46_im), 2.0) / y_46_im)));
double t_1 = ((y_46_re * (x_46_im / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -2.16e+161) {
tmp = t_1;
} else if (y_46_im <= -3.6e-134) {
tmp = t_0;
} else if (y_46_im <= 1.55e-167) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 5.8e+132) {
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 = fma(Float64(1.0 / hypot(y_46_re, y_46_im)), Float64(x_46_im / Float64(hypot(y_46_re, y_46_im) / y_46_re)), Float64(Float64(-x_46_re) / Float64((hypot(y_46_re, y_46_im) ^ 2.0) / y_46_im))) t_1 = Float64(Float64(Float64(y_46_re * Float64(x_46_im / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -2.16e+161) tmp = t_1; elseif (y_46_im <= -3.6e-134) tmp = t_0; elseif (y_46_im <= 1.55e-167) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 5.8e+132) 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[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] + 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]}, Block[{t$95$1 = N[(N[(N[(y$46$re * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.16e+161], t$95$1, If[LessEqual[y$46$im, -3.6e-134], t$95$0, If[LessEqual[y$46$im, 1.55e-167], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5.8e+132], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}}, \frac{-x.re}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.im}}\right)\\
t_1 := \frac{y.re \cdot \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -2.16 \cdot 10^{+161}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.im \leq -3.6 \cdot 10^{-134}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.55 \cdot 10^{-167}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 5.8 \cdot 10^{+132}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.im < -2.16e161 or 5.7999999999999997e132 < y.im Initial program 27.4%
div-sub27.4%
*-un-lft-identity27.4%
add-sqr-sqrt27.4%
times-frac27.4%
fma-neg27.4%
hypot-def27.4%
hypot-def32.5%
associate-/l*36.2%
add-sqr-sqrt36.2%
pow236.2%
hypot-def36.2%
Applied egg-rr36.2%
associate-/l*49.9%
distribute-neg-frac49.9%
Simplified49.9%
fma-udef49.9%
associate-/r/50.0%
associate-/r/50.0%
Applied egg-rr50.0%
+-commutative50.0%
*-commutative50.0%
associate-*l/50.0%
*-lft-identity50.0%
*-commutative50.0%
Simplified50.0%
Taylor expanded in y.im around inf 97.5%
associate-*r/97.5%
neg-mul-197.5%
Simplified97.5%
if -2.16e161 < y.im < -3.5999999999999999e-134 or 1.55e-167 < y.im < 5.7999999999999997e132Initial program 73.7%
div-sub73.6%
*-un-lft-identity73.6%
add-sqr-sqrt73.6%
times-frac73.6%
fma-neg73.6%
hypot-def73.6%
hypot-def78.8%
associate-/l*83.8%
add-sqr-sqrt83.7%
pow283.7%
hypot-def83.7%
Applied egg-rr83.7%
associate-/l*96.9%
distribute-neg-frac96.9%
Simplified96.9%
if -3.5999999999999999e-134 < y.im < 1.55e-167Initial program 75.3%
Taylor expanded in y.re around inf 80.6%
mul-1-neg80.6%
unsub-neg80.6%
unpow280.6%
times-frac84.5%
Simplified84.5%
associate-*l/92.0%
Applied egg-rr92.0%
sub-div95.3%
Applied egg-rr95.3%
associate-*r/95.3%
*-commutative95.3%
Applied egg-rr95.3%
Final simplification96.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+288)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(-
(/ (* y.re (/ x.im (hypot y.re y.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+288) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = ((y_46_re * (x_46_im / hypot(y_46_re, y_46_im))) / hypot(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+288) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (t_0 / Math.hypot(y_46_re, y_46_im));
} else {
tmp = ((y_46_re * (x_46_im / Math.hypot(y_46_re, y_46_im))) / Math.hypot(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+288: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (t_0 / math.hypot(y_46_re, y_46_im)) else: tmp = ((y_46_re * (x_46_im / math.hypot(y_46_re, y_46_im))) / math.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+288) 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(y_46_re * Float64(x_46_im / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im)) - Float64(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+288) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im)); else tmp = ((y_46_re * (x_46_im / hypot(y_46_re, y_46_im))) / hypot(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+288], 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[(y$46$re * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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^{+288}:\\
\;\;\;\;\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{y.re \cdot \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{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))) < 4e288Initial program 78.8%
*-un-lft-identity78.8%
add-sqr-sqrt78.8%
times-frac78.7%
hypot-def78.7%
hypot-def95.8%
Applied egg-rr95.8%
if 4e288 < (/.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 8.0%
div-sub4.9%
*-un-lft-identity4.9%
add-sqr-sqrt4.9%
times-frac4.9%
fma-neg4.9%
hypot-def4.9%
hypot-def7.6%
associate-/l*16.3%
add-sqr-sqrt16.3%
pow216.3%
hypot-def16.3%
Applied egg-rr16.3%
associate-/l*61.8%
distribute-neg-frac61.8%
Simplified61.8%
fma-udef61.8%
associate-/r/61.9%
associate-/r/61.9%
Applied egg-rr61.9%
+-commutative61.9%
*-commutative61.9%
associate-*l/62.0%
*-lft-identity62.0%
*-commutative62.0%
Simplified62.0%
Taylor expanded in y.im around inf 77.5%
associate-*r/77.5%
neg-mul-177.5%
Simplified77.5%
Final simplification90.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(-
(/ (* y.re (/ x.im (hypot y.re y.im))) (hypot y.re y.im))
(/ x.re y.im))))
(if (<= y.im -1.9e-33)
t_0
(if (<= y.im -2.9e-134)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 1.92e+99) (/ (- x.im (* x.re (/ y.im y.re))) y.re) 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 * (x_46_im / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -1.9e-33) {
tmp = t_0;
} else if (y_46_im <= -2.9e-134) {
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 if (y_46_im <= 1.92e+99) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = t_0;
}
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 / Math.hypot(y_46_re, y_46_im))) / Math.hypot(y_46_re, y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -1.9e-33) {
tmp = t_0;
} else if (y_46_im <= -2.9e-134) {
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 if (y_46_im <= 1.92e+99) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} 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 * (x_46_im / math.hypot(y_46_re, y_46_im))) / math.hypot(y_46_re, y_46_im)) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -1.9e-33: tmp = t_0 elif y_46_im <= -2.9e-134: 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)) elif y_46_im <= 1.92e+99: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re 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 * Float64(x_46_im / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -1.9e-33) tmp = t_0; elseif (y_46_im <= -2.9e-134) 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))); elseif (y_46_im <= 1.92e+99) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); 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 * (x_46_im / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im)) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -1.9e-33) tmp = t_0; elseif (y_46_im <= -2.9e-134) 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)); elseif (y_46_im <= 1.92e+99) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; 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 * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.9e-33], t$95$0, If[LessEqual[y$46$im, -2.9e-134], 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], If[LessEqual[y$46$im, 1.92e+99], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.9 \cdot 10^{-33}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -2.9 \cdot 10^{-134}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.92 \cdot 10^{+99}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.im < -1.89999999999999997e-33 or 1.9199999999999999e99 < y.im Initial program 45.3%
div-sub45.3%
*-un-lft-identity45.3%
add-sqr-sqrt45.3%
times-frac45.3%
fma-neg45.3%
hypot-def45.3%
hypot-def50.0%
associate-/l*57.0%
add-sqr-sqrt57.0%
pow257.0%
hypot-def57.0%
Applied egg-rr57.0%
associate-/l*68.6%
distribute-neg-frac68.6%
Simplified68.6%
fma-udef68.6%
associate-/r/68.7%
associate-/r/64.9%
Applied egg-rr64.9%
+-commutative64.9%
*-commutative64.9%
associate-*l/65.0%
*-lft-identity65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in y.im around inf 93.0%
associate-*r/93.0%
neg-mul-193.0%
Simplified93.0%
if -1.89999999999999997e-33 < y.im < -2.89999999999999993e-134Initial program 98.5%
if -2.89999999999999993e-134 < y.im < 1.9199999999999999e99Initial program 67.9%
Taylor expanded in y.re around inf 75.7%
mul-1-neg75.7%
unsub-neg75.7%
unpow275.7%
times-frac79.2%
Simplified79.2%
associate-*l/83.6%
Applied egg-rr83.6%
sub-div85.5%
Applied egg-rr85.5%
Final simplification90.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -2.4e+42)
(* (/ 1.0 (hypot y.re y.im)) (- x.re (* y.re (/ x.im y.im))))
(if (<= y.im -9.2e-134)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 1.92e+99)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(- (* (/ x.im y.im) (/ y.re y.im)) (/ x.re y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -2.4e+42) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_re - (y_46_re * (x_46_im / y_46_im)));
} else if (y_46_im <= -9.2e-134) {
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 if (y_46_im <= 1.92e+99) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = ((x_46_im / y_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 tmp;
if (y_46_im <= -2.4e+42) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_re - (y_46_re * (x_46_im / y_46_im)));
} else if (y_46_im <= -9.2e-134) {
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 if (y_46_im <= 1.92e+99) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = ((x_46_im / y_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): tmp = 0 if y_46_im <= -2.4e+42: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_re - (y_46_re * (x_46_im / y_46_im))) elif y_46_im <= -9.2e-134: 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)) elif y_46_im <= 1.92e+99: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re else: tmp = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - (x_46_re / y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -2.4e+42) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_re - Float64(y_46_re * Float64(x_46_im / y_46_im)))); elseif (y_46_im <= -9.2e-134) 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))); elseif (y_46_im <= 1.92e+99) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = Float64(Float64(Float64(x_46_im / y_46_im) * Float64(y_46_re / y_46_im)) - Float64(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) tmp = 0.0; if (y_46_im <= -2.4e+42) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_re - (y_46_re * (x_46_im / y_46_im))); elseif (y_46_im <= -9.2e-134) 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)); elseif (y_46_im <= 1.92e+99) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; else tmp = ((x_46_im / y_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_] := If[LessEqual[y$46$im, -2.4e+42], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re - N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -9.2e-134], 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], If[LessEqual[y$46$im, 1.92e+99], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.4 \cdot 10^{+42}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.re - y.re \cdot \frac{x.im}{y.im}\right)\\
\mathbf{elif}\;y.im \leq -9.2 \cdot 10^{-134}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.92 \cdot 10^{+99}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} \cdot \frac{y.re}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -2.3999999999999999e42Initial program 47.6%
*-un-lft-identity47.6%
add-sqr-sqrt47.6%
times-frac47.6%
hypot-def47.6%
hypot-def65.3%
Applied egg-rr65.3%
Taylor expanded in y.im around -inf 84.2%
+-commutative84.2%
mul-1-neg84.2%
unsub-neg84.2%
associate-*r/89.6%
Simplified89.6%
if -2.3999999999999999e42 < y.im < -9.2000000000000001e-134Initial program 94.0%
if -9.2000000000000001e-134 < y.im < 1.9199999999999999e99Initial program 67.9%
Taylor expanded in y.re around inf 75.7%
mul-1-neg75.7%
unsub-neg75.7%
unpow275.7%
times-frac79.2%
Simplified79.2%
associate-*l/83.6%
Applied egg-rr83.6%
sub-div85.5%
Applied egg-rr85.5%
if 1.9199999999999999e99 < y.im Initial program 32.8%
Taylor expanded in y.re around 0 71.9%
+-commutative71.9%
mul-1-neg71.9%
unsub-neg71.9%
unpow271.9%
times-frac88.0%
Simplified88.0%
Final simplification88.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* (/ x.im y.im) (/ y.re y.im)) (/ x.re y.im))))
(if (<= y.im -2.35e+63)
t_0
(if (<= y.im -1.4e-132)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 1.92e+99) (/ (- x.im (* x.re (/ y.im y.re))) y.re) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -2.35e+63) {
tmp = t_0;
} else if (y_46_im <= -1.4e-132) {
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 if (y_46_im <= 1.92e+99) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} 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 = ((x_46im / y_46im) * (y_46re / y_46im)) - (x_46re / y_46im)
if (y_46im <= (-2.35d+63)) then
tmp = t_0
else if (y_46im <= (-1.4d-132)) then
tmp = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46im <= 1.92d+99) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
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 = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - (x_46_re / y_46_im);
double tmp;
if (y_46_im <= -2.35e+63) {
tmp = t_0;
} else if (y_46_im <= -1.4e-132) {
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 if (y_46_im <= 1.92e+99) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - (x_46_re / y_46_im) tmp = 0 if y_46_im <= -2.35e+63: tmp = t_0 elif y_46_im <= -1.4e-132: 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)) elif y_46_im <= 1.92e+99: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re 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(x_46_im / y_46_im) * Float64(y_46_re / y_46_im)) - Float64(x_46_re / y_46_im)) tmp = 0.0 if (y_46_im <= -2.35e+63) tmp = t_0; elseif (y_46_im <= -1.4e-132) 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))); elseif (y_46_im <= 1.92e+99) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); 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 = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - (x_46_re / y_46_im); tmp = 0.0; if (y_46_im <= -2.35e+63) tmp = t_0; elseif (y_46_im <= -1.4e-132) 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)); elseif (y_46_im <= 1.92e+99) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; 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[(x$46$im / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.35e+63], t$95$0, If[LessEqual[y$46$im, -1.4e-132], 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], If[LessEqual[y$46$im, 1.92e+99], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im}{y.im} \cdot \frac{y.re}{y.im} - \frac{x.re}{y.im}\\
\mathbf{if}\;y.im \leq -2.35 \cdot 10^{+63}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq -1.4 \cdot 10^{-132}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.92 \cdot 10^{+99}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y.im < -2.3500000000000001e63 or 1.9199999999999999e99 < y.im Initial program 39.5%
Taylor expanded in y.re around 0 76.4%
+-commutative76.4%
mul-1-neg76.4%
unsub-neg76.4%
unpow276.4%
times-frac89.4%
Simplified89.4%
if -2.3500000000000001e63 < y.im < -1.40000000000000001e-132Initial program 92.1%
if -1.40000000000000001e-132 < y.im < 1.9199999999999999e99Initial program 67.9%
Taylor expanded in y.re around inf 75.7%
mul-1-neg75.7%
unsub-neg75.7%
unpow275.7%
times-frac79.2%
Simplified79.2%
associate-*l/83.6%
Applied egg-rr83.6%
sub-div85.5%
Applied egg-rr85.5%
Final simplification88.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4.1e-26) (not (<= y.im 1.92e+99))) (- (* (/ x.im y.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 <= -4.1e-26) || !(y_46_im <= 1.92e+99)) {
tmp = ((x_46_im / y_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 <= (-4.1d-26)) .or. (.not. (y_46im <= 1.92d+99))) then
tmp = ((x_46im / y_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 <= -4.1e-26) || !(y_46_im <= 1.92e+99)) {
tmp = ((x_46_im / y_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 <= -4.1e-26) or not (y_46_im <= 1.92e+99): tmp = ((x_46_im / y_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 <= -4.1e-26) || !(y_46_im <= 1.92e+99)) tmp = Float64(Float64(Float64(x_46_im / y_46_im) * Float64(y_46_re / 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 <= -4.1e-26) || ~((y_46_im <= 1.92e+99))) tmp = ((x_46_im / y_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, -4.1e-26], N[Not[LessEqual[y$46$im, 1.92e+99]], $MachinePrecision]], N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * N[(y$46$re / 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 -4.1 \cdot 10^{-26} \lor \neg \left(y.im \leq 1.92 \cdot 10^{+99}\right):\\
\;\;\;\;\frac{x.im}{y.im} \cdot \frac{y.re}{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 < -4.0999999999999999e-26 or 1.9199999999999999e99 < y.im Initial program 45.7%
Taylor expanded in y.re around 0 77.0%
+-commutative77.0%
mul-1-neg77.0%
unsub-neg77.0%
unpow277.0%
times-frac88.3%
Simplified88.3%
if -4.0999999999999999e-26 < y.im < 1.9199999999999999e99Initial program 73.4%
Taylor expanded in y.re around inf 73.8%
mul-1-neg73.8%
unsub-neg73.8%
unpow273.8%
times-frac76.1%
Simplified76.1%
associate-*l/80.3%
Applied egg-rr80.3%
sub-div81.8%
Applied egg-rr81.8%
Final simplification85.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.9e-25) (not (<= y.im 2.2e+99))) (/ (- 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.9e-25) || !(y_46_im <= 2.2e+99)) {
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.9d-25)) .or. (.not. (y_46im <= 2.2d+99))) 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.9e-25) || !(y_46_im <= 2.2e+99)) {
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.9e-25) or not (y_46_im <= 2.2e+99): 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.9e-25) || !(y_46_im <= 2.2e+99)) 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.9e-25) || ~((y_46_im <= 2.2e+99))) 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.9e-25], N[Not[LessEqual[y$46$im, 2.2e+99]], $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.9 \cdot 10^{-25} \lor \neg \left(y.im \leq 2.2 \cdot 10^{+99}\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.8999999999999999e-25 or 2.19999999999999978e99 < y.im Initial program 45.7%
Taylor expanded in y.re around 0 76.8%
associate-*r/76.8%
neg-mul-176.8%
Simplified76.8%
if -1.8999999999999999e-25 < y.im < 2.19999999999999978e99Initial program 73.4%
Taylor expanded in y.re around inf 73.8%
mul-1-neg73.8%
unsub-neg73.8%
unpow273.8%
times-frac76.1%
Simplified76.1%
associate-*l/80.3%
Applied egg-rr80.3%
sub-div81.8%
Applied egg-rr81.8%
Final simplification79.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.95e-64) (not (<= y.im 1.92e+99))) (/ (- 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 <= -2.95e-64) || !(y_46_im <= 1.92e+99)) {
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 <= (-2.95d-64)) .or. (.not. (y_46im <= 1.92d+99))) 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 <= -2.95e-64) || !(y_46_im <= 1.92e+99)) {
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 <= -2.95e-64) or not (y_46_im <= 1.92e+99): 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 <= -2.95e-64) || !(y_46_im <= 1.92e+99)) 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 <= -2.95e-64) || ~((y_46_im <= 1.92e+99))) 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, -2.95e-64], N[Not[LessEqual[y$46$im, 1.92e+99]], $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 -2.95 \cdot 10^{-64} \lor \neg \left(y.im \leq 1.92 \cdot 10^{+99}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -2.94999999999999997e-64 or 1.9199999999999999e99 < y.im Initial program 46.6%
Taylor expanded in y.re around 0 75.5%
associate-*r/75.5%
neg-mul-175.5%
Simplified75.5%
if -2.94999999999999997e-64 < y.im < 1.9199999999999999e99Initial program 73.4%
Taylor expanded in y.re around inf 65.2%
Final simplification70.3%
(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 60.0%
Taylor expanded in y.re around inf 39.3%
Final simplification39.3%
herbie shell --seed 2023257
(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))))