
(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 11 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 (/ (* y.re (/ x.im (hypot y.re y.im))) (hypot y.re y.im))))
(if (or (<= y.im -2.55e+157) (not (<= y.im 1.52e+88)))
(- t_0 (/ x.re y.im))
(- t_0 (* y.im (/ x.re (pow (hypot y.re y.im) 2.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);
double tmp;
if ((y_46_im <= -2.55e+157) || !(y_46_im <= 1.52e+88)) {
tmp = t_0 - (x_46_re / y_46_im);
} else {
tmp = t_0 - (y_46_im * (x_46_re / pow(hypot(y_46_re, y_46_im), 2.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);
double tmp;
if ((y_46_im <= -2.55e+157) || !(y_46_im <= 1.52e+88)) {
tmp = t_0 - (x_46_re / y_46_im);
} else {
tmp = t_0 - (y_46_im * (x_46_re / Math.pow(Math.hypot(y_46_re, y_46_im), 2.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) tmp = 0 if (y_46_im <= -2.55e+157) or not (y_46_im <= 1.52e+88): tmp = t_0 - (x_46_re / y_46_im) else: tmp = t_0 - (y_46_im * (x_46_re / math.pow(math.hypot(y_46_re, y_46_im), 2.0))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re * Float64(x_46_im / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im)) tmp = 0.0 if ((y_46_im <= -2.55e+157) || !(y_46_im <= 1.52e+88)) tmp = Float64(t_0 - Float64(x_46_re / y_46_im)); else tmp = Float64(t_0 - Float64(y_46_im * Float64(x_46_re / (hypot(y_46_re, y_46_im) ^ 2.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); tmp = 0.0; if ((y_46_im <= -2.55e+157) || ~((y_46_im <= 1.52e+88))) tmp = t_0 - (x_46_re / y_46_im); else tmp = t_0 - (y_46_im * (x_46_re / (hypot(y_46_re, y_46_im) ^ 2.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[(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]}, If[Or[LessEqual[y$46$im, -2.55e+157], N[Not[LessEqual[y$46$im, 1.52e+88]], $MachinePrecision]], N[(t$95$0 - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(y$46$im * N[(x$46$re / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\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)}\\
\mathbf{if}\;y.im \leq -2.55 \cdot 10^{+157} \lor \neg \left(y.im \leq 1.52 \cdot 10^{+88}\right):\\
\;\;\;\;t\_0 - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0 - y.im \cdot \frac{x.re}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\\
\end{array}
\end{array}
if y.im < -2.55e157 or 1.52000000000000004e88 < y.im Initial program 36.1%
div-sub36.1%
sub-neg36.1%
*-un-lft-identity36.1%
add-sqr-sqrt36.1%
times-frac36.1%
fma-def36.1%
hypot-def36.1%
hypot-def41.3%
associate-/l*45.1%
add-sqr-sqrt45.1%
pow245.1%
hypot-def45.1%
Applied egg-rr45.1%
fma-neg45.1%
*-commutative45.1%
associate-/l*53.5%
associate-/r/52.1%
*-commutative52.1%
Simplified52.1%
associate-*l/52.2%
*-un-lft-identity52.2%
div-inv52.1%
clear-num52.2%
Applied egg-rr52.2%
Taylor expanded in y.im around inf 89.3%
if -2.55e157 < y.im < 1.52000000000000004e88Initial program 69.9%
div-sub68.0%
sub-neg68.0%
*-un-lft-identity68.0%
add-sqr-sqrt68.0%
times-frac68.1%
fma-def68.1%
hypot-def68.1%
hypot-def73.6%
associate-/l*76.3%
add-sqr-sqrt76.3%
pow276.3%
hypot-def76.3%
Applied egg-rr76.3%
fma-neg76.3%
*-commutative76.3%
associate-/l*92.0%
associate-/r/87.9%
*-commutative87.9%
Simplified87.9%
associate-*l/88.0%
*-un-lft-identity88.0%
div-inv87.6%
clear-num88.1%
Applied egg-rr88.1%
Final simplification88.4%
(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))) 2e+236)
(/ (/ t_0 (hypot y.re y.im)) (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))) <= 2e+236) {
tmp = (t_0 / hypot(y_46_re, y_46_im)) / 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))) <= 2e+236) {
tmp = (t_0 / Math.hypot(y_46_re, y_46_im)) / 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))) <= 2e+236: tmp = (t_0 / math.hypot(y_46_re, y_46_im)) / 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))) <= 2e+236) tmp = Float64(Float64(t_0 / hypot(y_46_re, y_46_im)) / 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))) <= 2e+236) tmp = (t_0 / hypot(y_46_re, y_46_im)) / 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], 2e+236], N[(N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(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 2 \cdot 10^{+236}:\\
\;\;\;\;\frac{\frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}}{\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))) < 2.00000000000000011e236Initial program 80.3%
*-un-lft-identity80.3%
add-sqr-sqrt80.3%
times-frac80.3%
hypot-def80.3%
hypot-def93.9%
Applied egg-rr93.9%
*-commutative93.9%
associate-*l/93.9%
div-inv94.0%
*-commutative94.0%
*-commutative94.0%
Applied egg-rr94.0%
if 2.00000000000000011e236 < (/.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 10.5%
div-sub8.8%
sub-neg8.8%
*-un-lft-identity8.8%
add-sqr-sqrt8.8%
times-frac8.8%
fma-def8.8%
hypot-def8.8%
hypot-def11.6%
associate-/l*18.1%
add-sqr-sqrt18.1%
pow218.1%
hypot-def18.1%
Applied egg-rr18.1%
fma-neg18.1%
*-commutative18.1%
associate-/l*60.6%
associate-/r/60.6%
*-commutative60.6%
Simplified60.6%
associate-*l/60.6%
*-un-lft-identity60.6%
div-inv60.6%
clear-num60.7%
Applied egg-rr60.7%
Taylor expanded in y.im around inf 67.1%
Final simplification86.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (pow (hypot y.re y.im) -2.0) (- (* y.re x.im) (* y.im x.re)))))
(if (<= y.re -7.2)
(- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re)))
(if (<= y.re -8.4e-155)
t_0
(if (<= y.re 1.8e-148)
(* (/ -1.0 y.im) (- x.re (/ x.im (/ y.im y.re))))
(if (<= y.re 5.8e+78)
t_0
(/ (- x.im (/ x.re (/ 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 = pow(hypot(y_46_re, y_46_im), -2.0) * ((y_46_re * x_46_im) - (y_46_im * x_46_re));
double tmp;
if (y_46_re <= -7.2) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_re <= -8.4e-155) {
tmp = t_0;
} else if (y_46_re <= 1.8e-148) {
tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re)));
} else if (y_46_re <= 5.8e+78) {
tmp = t_0;
} else {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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 = Math.pow(Math.hypot(y_46_re, y_46_im), -2.0) * ((y_46_re * x_46_im) - (y_46_im * x_46_re));
double tmp;
if (y_46_re <= -7.2) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_re <= -8.4e-155) {
tmp = t_0;
} else if (y_46_re <= 1.8e-148) {
tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re)));
} else if (y_46_re <= 5.8e+78) {
tmp = t_0;
} else {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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 = math.pow(math.hypot(y_46_re, y_46_im), -2.0) * ((y_46_re * x_46_im) - (y_46_im * x_46_re)) tmp = 0 if y_46_re <= -7.2: tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) elif y_46_re <= -8.4e-155: tmp = t_0 elif y_46_re <= 1.8e-148: tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re))) elif y_46_re <= 5.8e+78: tmp = t_0 else: tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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((hypot(y_46_re, y_46_im) ^ -2.0) * Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re))) tmp = 0.0 if (y_46_re <= -7.2) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))); elseif (y_46_re <= -8.4e-155) tmp = t_0; elseif (y_46_re <= 1.8e-148) tmp = Float64(Float64(-1.0 / y_46_im) * Float64(x_46_re - Float64(x_46_im / Float64(y_46_im / y_46_re)))); elseif (y_46_re <= 5.8e+78) tmp = t_0; else tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / 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 = (hypot(y_46_re, y_46_im) ^ -2.0) * ((y_46_re * x_46_im) - (y_46_im * x_46_re)); tmp = 0.0; if (y_46_re <= -7.2) tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); elseif (y_46_re <= -8.4e-155) tmp = t_0; elseif (y_46_re <= 1.8e-148) tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re))); elseif (y_46_re <= 5.8e+78) tmp = t_0; else tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], -2.0], $MachinePrecision] * N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.2], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -8.4e-155], t$95$0, If[LessEqual[y$46$re, 1.8e-148], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(x$46$re - N[(x$46$im / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.8e+78], t$95$0, N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{-2} \cdot \left(y.re \cdot x.im - y.im \cdot x.re\right)\\
\mathbf{if}\;y.re \leq -7.2:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq -8.4 \cdot 10^{-155}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-148}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(x.re - \frac{x.im}{\frac{y.im}{y.re}}\right)\\
\mathbf{elif}\;y.re \leq 5.8 \cdot 10^{+78}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -7.20000000000000018Initial program 48.8%
Taylor expanded in y.re around inf 73.9%
+-commutative73.9%
mul-1-neg73.9%
unsub-neg73.9%
associate-/l*72.9%
associate-/r/75.6%
Simplified75.6%
*-un-lft-identity75.6%
unpow275.6%
times-frac82.9%
Applied egg-rr82.9%
associate-*l/82.9%
*-lft-identity82.9%
Simplified82.9%
if -7.20000000000000018 < y.re < -8.4000000000000007e-155 or 1.7999999999999999e-148 < y.re < 5.80000000000000034e78Initial program 83.7%
add-sqr-sqrt52.1%
pow252.1%
sqrt-div45.1%
hypot-def45.2%
Applied egg-rr45.2%
expm1-log1p-u43.1%
expm1-udef34.9%
Applied egg-rr42.8%
expm1-def59.6%
expm1-log1p84.7%
*-commutative84.7%
*-commutative84.7%
Simplified84.7%
if -8.4000000000000007e-155 < y.re < 1.7999999999999999e-148Initial program 64.4%
*-un-lft-identity64.4%
add-sqr-sqrt64.4%
times-frac64.4%
hypot-def64.4%
hypot-def81.9%
Applied egg-rr81.9%
Taylor expanded in y.im around -inf 52.4%
mul-1-neg52.4%
unsub-neg52.4%
associate-/l*52.4%
Simplified52.4%
Taylor expanded in y.im around -inf 91.4%
if 5.80000000000000034e78 < y.re Initial program 34.1%
*-un-lft-identity34.1%
add-sqr-sqrt34.1%
times-frac34.1%
hypot-def34.1%
hypot-def49.3%
Applied egg-rr49.3%
*-commutative49.3%
associate-*l/49.4%
div-inv49.4%
*-commutative49.4%
*-commutative49.4%
Applied egg-rr49.4%
Taylor expanded in y.re around inf 81.1%
mul-1-neg81.1%
unsub-neg81.1%
associate-/l*89.0%
Simplified89.0%
Final simplification86.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -8.4e-10)
(- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re)))
(if (<= y.re -9.8e-160)
t_0
(if (<= y.re 1.45e-122)
(* (/ -1.0 y.im) (- x.re (/ x.im (/ y.im y.re))))
(if (<= y.re 2.7e+77)
t_0
(/ (- x.im (/ x.re (/ 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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -8.4e-10) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_re <= -9.8e-160) {
tmp = t_0;
} else if (y_46_re <= 1.45e-122) {
tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re)));
} else if (y_46_re <= 2.7e+77) {
tmp = t_0;
} else {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -8.4e-10) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else if (y_46_re <= -9.8e-160) {
tmp = t_0;
} else if (y_46_re <= 1.45e-122) {
tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re)));
} else if (y_46_re <= 2.7e+77) {
tmp = t_0;
} else {
tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -8.4e-10: tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) elif y_46_re <= -9.8e-160: tmp = t_0 elif y_46_re <= 1.45e-122: tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re))) elif y_46_re <= 2.7e+77: tmp = t_0 else: tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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(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))) tmp = 0.0 if (y_46_re <= -8.4e-10) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))); elseif (y_46_re <= -9.8e-160) tmp = t_0; elseif (y_46_re <= 1.45e-122) tmp = Float64(Float64(-1.0 / y_46_im) * Float64(x_46_re - Float64(x_46_im / Float64(y_46_im / y_46_re)))); elseif (y_46_re <= 2.7e+77) tmp = t_0; else tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / 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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -8.4e-10) tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); elseif (y_46_re <= -9.8e-160) tmp = t_0; elseif (y_46_re <= 1.45e-122) tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re))); elseif (y_46_re <= 2.7e+77) tmp = t_0; else tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / 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[(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$re, -8.4e-10], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -9.8e-160], t$95$0, If[LessEqual[y$46$re, 1.45e-122], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(x$46$re - N[(x$46$im / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.7e+77], t$95$0, N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -8.4 \cdot 10^{-10}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq -9.8 \cdot 10^{-160}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.45 \cdot 10^{-122}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(x.re - \frac{x.im}{\frac{y.im}{y.re}}\right)\\
\mathbf{elif}\;y.re \leq 2.7 \cdot 10^{+77}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -8.3999999999999999e-10Initial program 49.6%
Taylor expanded in y.re around inf 74.3%
+-commutative74.3%
mul-1-neg74.3%
unsub-neg74.3%
associate-/l*73.3%
associate-/r/76.0%
Simplified76.0%
*-un-lft-identity76.0%
unpow276.0%
times-frac83.1%
Applied egg-rr83.1%
associate-*l/83.1%
*-lft-identity83.1%
Simplified83.1%
if -8.3999999999999999e-10 < y.re < -9.7999999999999998e-160 or 1.4500000000000001e-122 < y.re < 2.6999999999999998e77Initial program 84.2%
if -9.7999999999999998e-160 < y.re < 1.4500000000000001e-122Initial program 64.6%
*-un-lft-identity64.6%
add-sqr-sqrt64.6%
times-frac64.5%
hypot-def64.5%
hypot-def81.3%
Applied egg-rr81.3%
Taylor expanded in y.im around -inf 53.1%
mul-1-neg53.1%
unsub-neg53.1%
associate-/l*53.1%
Simplified53.1%
Taylor expanded in y.im around -inf 90.3%
if 2.6999999999999998e77 < y.re Initial program 34.1%
*-un-lft-identity34.1%
add-sqr-sqrt34.1%
times-frac34.1%
hypot-def34.1%
hypot-def49.3%
Applied egg-rr49.3%
*-commutative49.3%
associate-*l/49.4%
div-inv49.4%
*-commutative49.4%
*-commutative49.4%
Applied egg-rr49.4%
Taylor expanded in y.re around inf 81.1%
mul-1-neg81.1%
unsub-neg81.1%
associate-/l*89.0%
Simplified89.0%
Final simplification86.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re)))))
(if (<= y.re -8.4e-10)
t_1
(if (<= y.re -3.5e-156)
t_0
(if (<= y.re 5e-123)
(* (/ -1.0 y.im) (- x.re (/ x.im (/ y.im y.re))))
(if (<= y.re 1.25e+79) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
double tmp;
if (y_46_re <= -8.4e-10) {
tmp = t_1;
} else if (y_46_re <= -3.5e-156) {
tmp = t_0;
} else if (y_46_re <= 5e-123) {
tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re)));
} else if (y_46_re <= 1.25e+79) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (x_46im / y_46re) - (y_46im * ((x_46re / y_46re) / y_46re))
if (y_46re <= (-8.4d-10)) then
tmp = t_1
else if (y_46re <= (-3.5d-156)) then
tmp = t_0
else if (y_46re <= 5d-123) then
tmp = ((-1.0d0) / y_46im) * (x_46re - (x_46im / (y_46im / y_46re)))
else if (y_46re <= 1.25d+79) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
double tmp;
if (y_46_re <= -8.4e-10) {
tmp = t_1;
} else if (y_46_re <= -3.5e-156) {
tmp = t_0;
} else if (y_46_re <= 5e-123) {
tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re)));
} else if (y_46_re <= 1.25e+79) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) tmp = 0 if y_46_re <= -8.4e-10: tmp = t_1 elif y_46_re <= -3.5e-156: tmp = t_0 elif y_46_re <= 5e-123: tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re))) elif y_46_re <= 1.25e+79: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))) tmp = 0.0 if (y_46_re <= -8.4e-10) tmp = t_1; elseif (y_46_re <= -3.5e-156) tmp = t_0; elseif (y_46_re <= 5e-123) tmp = Float64(Float64(-1.0 / y_46_im) * Float64(x_46_re - Float64(x_46_im / Float64(y_46_im / y_46_re)))); elseif (y_46_re <= 1.25e+79) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); tmp = 0.0; if (y_46_re <= -8.4e-10) tmp = t_1; elseif (y_46_re <= -3.5e-156) tmp = t_0; elseif (y_46_re <= 5e-123) tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re))); elseif (y_46_re <= 1.25e+79) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$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]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -8.4e-10], t$95$1, If[LessEqual[y$46$re, -3.5e-156], t$95$0, If[LessEqual[y$46$re, 5e-123], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(x$46$re - N[(x$46$im / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.25e+79], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -8.4 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -3.5 \cdot 10^{-156}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 5 \cdot 10^{-123}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(x.re - \frac{x.im}{\frac{y.im}{y.re}}\right)\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{+79}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -8.3999999999999999e-10 or 1.25e79 < y.re Initial program 43.0%
Taylor expanded in y.re around inf 76.2%
+-commutative76.2%
mul-1-neg76.2%
unsub-neg76.2%
associate-/l*77.4%
associate-/r/79.0%
Simplified79.0%
*-un-lft-identity79.0%
unpow279.0%
times-frac85.3%
Applied egg-rr85.3%
associate-*l/85.3%
*-lft-identity85.3%
Simplified85.3%
if -8.3999999999999999e-10 < y.re < -3.4999999999999999e-156 or 5.0000000000000003e-123 < y.re < 1.25e79Initial program 84.2%
if -3.4999999999999999e-156 < y.re < 5.0000000000000003e-123Initial program 64.6%
*-un-lft-identity64.6%
add-sqr-sqrt64.6%
times-frac64.5%
hypot-def64.5%
hypot-def81.3%
Applied egg-rr81.3%
Taylor expanded in y.im around -inf 53.1%
mul-1-neg53.1%
unsub-neg53.1%
associate-/l*53.1%
Simplified53.1%
Taylor expanded in y.im around -inf 90.3%
Final simplification86.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -8e-10) (not (<= y.re 2.6e+80))) (/ x.im y.re) (* (/ -1.0 y.im) (- x.re (/ x.im (/ y.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -8e-10) || !(y_46_re <= 2.6e+80)) {
tmp = x_46_im / y_46_re;
} else {
tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-8d-10)) .or. (.not. (y_46re <= 2.6d+80))) then
tmp = x_46im / y_46re
else
tmp = ((-1.0d0) / y_46im) * (x_46re - (x_46im / (y_46im / y_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -8e-10) || !(y_46_re <= 2.6e+80)) {
tmp = x_46_im / y_46_re;
} else {
tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -8e-10) or not (y_46_re <= 2.6e+80): tmp = x_46_im / y_46_re else: tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -8e-10) || !(y_46_re <= 2.6e+80)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(-1.0 / y_46_im) * Float64(x_46_re - Float64(x_46_im / Float64(y_46_im / y_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -8e-10) || ~((y_46_re <= 2.6e+80))) tmp = x_46_im / y_46_re; else tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -8e-10], N[Not[LessEqual[y$46$re, 2.6e+80]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(x$46$re - N[(x$46$im / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -8 \cdot 10^{-10} \lor \neg \left(y.re \leq 2.6 \cdot 10^{+80}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(x.re - \frac{x.im}{\frac{y.im}{y.re}}\right)\\
\end{array}
\end{array}
if y.re < -8.00000000000000029e-10 or 2.59999999999999982e80 < y.re Initial program 42.5%
Taylor expanded in y.re around inf 73.2%
if -8.00000000000000029e-10 < y.re < 2.59999999999999982e80Initial program 75.4%
*-un-lft-identity75.4%
add-sqr-sqrt75.4%
times-frac75.4%
hypot-def75.4%
hypot-def85.8%
Applied egg-rr85.8%
Taylor expanded in y.im around -inf 47.2%
mul-1-neg47.2%
unsub-neg47.2%
associate-/l*47.2%
Simplified47.2%
Taylor expanded in y.im around -inf 78.3%
Final simplification76.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.6e-29) (not (<= y.re 2.05e+77))) (- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re))) (* (/ -1.0 y.im) (- x.re (/ x.im (/ y.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.6e-29) || !(y_46_re <= 2.05e+77)) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else {
tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-3.6d-29)) .or. (.not. (y_46re <= 2.05d+77))) then
tmp = (x_46im / y_46re) - (y_46im * ((x_46re / y_46re) / y_46re))
else
tmp = ((-1.0d0) / y_46im) * (x_46re - (x_46im / (y_46im / y_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.6e-29) || !(y_46_re <= 2.05e+77)) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else {
tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -3.6e-29) or not (y_46_re <= 2.05e+77): tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) else: tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -3.6e-29) || !(y_46_re <= 2.05e+77)) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))); else tmp = Float64(Float64(-1.0 / y_46_im) * Float64(x_46_re - Float64(x_46_im / Float64(y_46_im / y_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -3.6e-29) || ~((y_46_re <= 2.05e+77))) tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); else tmp = (-1.0 / y_46_im) * (x_46_re - (x_46_im / (y_46_im / y_46_re))); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -3.6e-29], N[Not[LessEqual[y$46$re, 2.05e+77]], $MachinePrecision]], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / y$46$im), $MachinePrecision] * N[(x$46$re - N[(x$46$im / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.6 \cdot 10^{-29} \lor \neg \left(y.re \leq 2.05 \cdot 10^{+77}\right):\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.im} \cdot \left(x.re - \frac{x.im}{\frac{y.im}{y.re}}\right)\\
\end{array}
\end{array}
if y.re < -3.59999999999999974e-29 or 2.05e77 < y.re Initial program 44.9%
Taylor expanded in y.re around inf 76.1%
+-commutative76.1%
mul-1-neg76.1%
unsub-neg76.1%
associate-/l*77.4%
associate-/r/78.9%
Simplified78.9%
*-un-lft-identity78.9%
unpow278.9%
times-frac85.0%
Applied egg-rr85.0%
associate-*l/85.0%
*-lft-identity85.0%
Simplified85.0%
if -3.59999999999999974e-29 < y.re < 2.05e77Initial program 74.5%
*-un-lft-identity74.5%
add-sqr-sqrt74.5%
times-frac74.5%
hypot-def74.5%
hypot-def85.2%
Applied egg-rr85.2%
Taylor expanded in y.im around -inf 47.4%
mul-1-neg47.4%
unsub-neg47.4%
associate-/l*47.4%
Simplified47.4%
Taylor expanded in y.im around -inf 79.6%
Final simplification82.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.7e-35) (not (<= y.im 7.6e+68))) (/ (- 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 <= -1.7e-35) || !(y_46_im <= 7.6e+68)) {
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 <= (-1.7d-35)) .or. (.not. (y_46im <= 7.6d+68))) 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 <= -1.7e-35) || !(y_46_im <= 7.6e+68)) {
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 <= -1.7e-35) or not (y_46_im <= 7.6e+68): 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 <= -1.7e-35) || !(y_46_im <= 7.6e+68)) 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 <= -1.7e-35) || ~((y_46_im <= 7.6e+68))) 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, -1.7e-35], N[Not[LessEqual[y$46$im, 7.6e+68]], $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 -1.7 \cdot 10^{-35} \lor \neg \left(y.im \leq 7.6 \cdot 10^{+68}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.7000000000000001e-35 or 7.6000000000000002e68 < y.im Initial program 49.7%
Taylor expanded in y.re around 0 73.1%
associate-*r/73.1%
neg-mul-173.1%
Simplified73.1%
if -1.7000000000000001e-35 < y.im < 7.6000000000000002e68Initial program 69.4%
Taylor expanded in y.re around inf 65.4%
Final simplification68.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 3.6e+105) (/ x.im y.re) (/ 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 <= 3.6e+105) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_re / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46im <= 3.6d+105) then
tmp = x_46im / y_46re
else
tmp = x_46re / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= 3.6e+105) {
tmp = x_46_im / y_46_re;
} else {
tmp = 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 <= 3.6e+105: tmp = x_46_im / y_46_re else: tmp = 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 <= 3.6e+105) tmp = Float64(x_46_im / y_46_re); else tmp = 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 <= 3.6e+105) tmp = x_46_im / y_46_re; else tmp = 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, 3.6e+105], N[(x$46$im / y$46$re), $MachinePrecision], N[(x$46$re / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq 3.6 \cdot 10^{+105}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < 3.5999999999999999e105Initial program 64.1%
Taylor expanded in y.re around inf 50.7%
if 3.5999999999999999e105 < y.im Initial program 39.8%
*-un-lft-identity39.8%
add-sqr-sqrt39.8%
times-frac39.8%
hypot-def39.8%
hypot-def59.9%
Applied egg-rr59.9%
Taylor expanded in y.im around -inf 30.2%
mul-1-neg30.2%
unsub-neg30.2%
associate-/l*30.2%
Simplified30.2%
Taylor expanded in y.re around 0 30.4%
Final simplification47.6%
(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 60.4%
*-un-lft-identity60.4%
add-sqr-sqrt60.4%
times-frac60.4%
hypot-def60.4%
hypot-def72.1%
Applied egg-rr72.1%
Taylor expanded in y.im around -inf 30.4%
mul-1-neg30.4%
unsub-neg30.4%
associate-/l*31.7%
Simplified31.7%
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 60.4%
Taylor expanded in y.re around inf 45.1%
Final simplification45.1%
herbie shell --seed 2024031
(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))))