
(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
(if (<=
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))
2e+271)
(*
(/ 1.0 (hypot y.re y.im))
(/ (fma x.im y.re (* x.re (- y.im))) (hypot y.re y.im)))
(/ (- x.im (* y.im (/ x.re 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 ((((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 2e+271) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (fma(x_46_im, y_46_re, (x_46_re * -y_46_im)) / hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_im - (y_46_im * (x_46_re / 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 (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))) <= 2e+271) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(fma(x_46_im, y_46_re, Float64(x_46_re * Float64(-y_46_im))) / hypot(y_46_re, y_46_im))); else tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / y_46_re); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[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], 2e+271], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(x$46$im * y$46$re + N[(x$46$re * (-y$46$im)), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leq 2 \cdot 10^{+271}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.im, y.re, x.re \cdot \left(-y.im\right)\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\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))) < 1.99999999999999991e271Initial program 81.2%
*-un-lft-identity81.2%
add-sqr-sqrt81.2%
times-frac81.2%
hypot-define81.2%
fma-neg81.2%
distribute-rgt-neg-in81.2%
hypot-define96.8%
Applied egg-rr96.8%
if 1.99999999999999991e271 < (/.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 15.1%
Taylor expanded in y.re around inf 53.7%
+-commutative53.7%
mul-1-neg53.7%
unsub-neg53.7%
Simplified53.7%
*-un-lft-identity53.7%
pow253.7%
times-frac56.0%
*-commutative56.0%
Applied egg-rr56.0%
Taylor expanded in x.im around 0 53.7%
+-commutative53.7%
mul-1-neg53.7%
sub-neg53.7%
*-commutative53.7%
*-rgt-identity53.7%
*-commutative53.7%
unpow253.7%
times-frac56.0%
associate-/l*56.0%
*-commutative56.0%
associate-*r/56.0%
*-rgt-identity56.0%
associate-*r/66.7%
div-sub70.4%
Simplified70.4%
Final simplification91.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(/ x.re (- y.im)))))
(if (<= y.im -1.05e-22)
t_0
(if (<= y.im 1.4e-124)
(/ (- x.im (/ (* x.re y.im) y.re)) y.re)
(if (<= y.im 6.7e+41)
(*
(fma x.im y.re (* x.re (- y.im)))
(/ 1.0 (pow (hypot y.re y.im) 2.0)))
t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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));
double tmp;
if (y_46_im <= -1.05e-22) {
tmp = t_0;
} else if (y_46_im <= 1.4e-124) {
tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= 6.7e+41) {
tmp = fma(x_46_im, y_46_re, (x_46_re * -y_46_im)) * (1.0 / pow(hypot(y_46_re, y_46_im), 2.0));
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(x_46_re / Float64(-y_46_im))) tmp = 0.0 if (y_46_im <= -1.05e-22) tmp = t_0; elseif (y_46_im <= 1.4e-124) tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_im <= 6.7e+41) tmp = Float64(fma(x_46_im, y_46_re, Float64(x_46_re * Float64(-y_46_im))) * Float64(1.0 / (hypot(y_46_re, y_46_im) ^ 2.0))); else tmp = t_0; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im / 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.05e-22], t$95$0, If[LessEqual[y$46$im, 1.4e-124], N[(N[(x$46$im - N[(N[(x$46$re * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 6.7e+41], N[(N[(x$46$im * y$46$re + N[(x$46$re * (-y$46$im)), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
\mathbf{if}\;y.im \leq -1.05 \cdot 10^{-22}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{-124}:\\
\;\;\;\;\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 6.7 \cdot 10^{+41}:\\
\;\;\;\;\mathsf{fma}\left(x.im, y.re, x.re \cdot \left(-y.im\right)\right) \cdot \frac{1}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.05000000000000004e-22 or 6.6999999999999996e41 < y.im Initial program 50.5%
div-sub50.5%
*-commutative50.5%
add-sqr-sqrt50.5%
times-frac53.4%
fma-neg53.4%
hypot-define53.4%
hypot-define67.0%
associate-/l*73.4%
add-sqr-sqrt73.4%
pow273.4%
hypot-define73.4%
Applied egg-rr73.4%
Taylor expanded in y.im around inf 89.7%
if -1.05000000000000004e-22 < y.im < 1.39999999999999999e-124Initial program 77.1%
Taylor expanded in y.re around inf 83.6%
+-commutative83.6%
mul-1-neg83.6%
unsub-neg83.6%
Simplified83.6%
*-un-lft-identity83.6%
pow283.6%
times-frac85.8%
*-commutative85.8%
Applied egg-rr85.8%
Taylor expanded in x.im around 0 83.6%
+-commutative83.6%
mul-1-neg83.6%
sub-neg83.6%
*-commutative83.6%
*-rgt-identity83.6%
*-commutative83.6%
unpow283.6%
times-frac85.8%
associate-/l*85.8%
*-commutative85.8%
associate-*r/85.9%
*-rgt-identity85.9%
associate-*r/82.7%
div-sub85.0%
Simplified85.0%
associate-*r/89.1%
Applied egg-rr89.1%
if 1.39999999999999999e-124 < y.im < 6.6999999999999996e41Initial program 85.6%
div-inv85.7%
fma-neg85.7%
distribute-rgt-neg-in85.7%
add-sqr-sqrt85.7%
pow285.7%
hypot-define85.7%
Applied egg-rr85.7%
Final simplification88.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -6.5e+53)
(/ (- x.im (* y.im (/ x.re y.re))) y.re)
(if (<= y.re -2.5e-188)
t_0
(if (<= y.re 3.5e-100)
(- (* x.im (/ y.re (pow y.im 2.0))) (/ x.re y.im))
(if (<= y.re 6.5e+139)
t_0
(- (/ x.im y.re) (* (/ x.re y.re) (/ y.im y.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -6.5e+53) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else if (y_46_re <= -2.5e-188) {
tmp = t_0;
} else if (y_46_re <= 3.5e-100) {
tmp = (x_46_im * (y_46_re / pow(y_46_im, 2.0))) - (x_46_re / y_46_im);
} else if (y_46_re <= 6.5e+139) {
tmp = t_0;
} else {
tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (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) :: t_0
real(8) :: tmp
t_0 = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46re <= (-6.5d+53)) then
tmp = (x_46im - (y_46im * (x_46re / y_46re))) / y_46re
else if (y_46re <= (-2.5d-188)) then
tmp = t_0
else if (y_46re <= 3.5d-100) then
tmp = (x_46im * (y_46re / (y_46im ** 2.0d0))) - (x_46re / y_46im)
else if (y_46re <= 6.5d+139) then
tmp = t_0
else
tmp = (x_46im / y_46re) - ((x_46re / y_46re) * (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 t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -6.5e+53) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else if (y_46_re <= -2.5e-188) {
tmp = t_0;
} else if (y_46_re <= 3.5e-100) {
tmp = (x_46_im * (y_46_re / Math.pow(y_46_im, 2.0))) - (x_46_re / y_46_im);
} else if (y_46_re <= 6.5e+139) {
tmp = t_0;
} else {
tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (y_46_im / y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -6.5e+53: tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re elif y_46_re <= -2.5e-188: tmp = t_0 elif y_46_re <= 3.5e-100: tmp = (x_46_im * (y_46_re / math.pow(y_46_im, 2.0))) - (x_46_re / y_46_im) elif y_46_re <= 6.5e+139: tmp = t_0 else: tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (y_46_im / y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_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))) tmp = 0.0 if (y_46_re <= -6.5e+53) tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / y_46_re); elseif (y_46_re <= -2.5e-188) tmp = t_0; elseif (y_46_re <= 3.5e-100) tmp = Float64(Float64(x_46_im * Float64(y_46_re / (y_46_im ^ 2.0))) - Float64(x_46_re / y_46_im)); elseif (y_46_re <= 6.5e+139) tmp = t_0; else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(x_46_re / y_46_re) * 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) t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -6.5e+53) tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re; elseif (y_46_re <= -2.5e-188) tmp = t_0; elseif (y_46_re <= 3.5e-100) tmp = (x_46_im * (y_46_re / (y_46_im ^ 2.0))) - (x_46_re / y_46_im); elseif (y_46_re <= 6.5e+139) tmp = t_0; else tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (y_46_im / y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$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]}, If[LessEqual[y$46$re, -6.5e+53], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -2.5e-188], t$95$0, If[LessEqual[y$46$re, 3.5e-100], N[(N[(x$46$im * N[(y$46$re / N[Power[y$46$im, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.5e+139], t$95$0, N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(x$46$re / y$46$re), $MachinePrecision] * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -6.5 \cdot 10^{+53}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq -2.5 \cdot 10^{-188}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3.5 \cdot 10^{-100}:\\
\;\;\;\;x.im \cdot \frac{y.re}{{y.im}^{2}} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{+139}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{x.re}{y.re} \cdot \frac{y.im}{y.re}\\
\end{array}
\end{array}
if y.re < -6.50000000000000017e53Initial program 46.7%
Taylor expanded in y.re around inf 79.8%
+-commutative79.8%
mul-1-neg79.8%
unsub-neg79.8%
Simplified79.8%
*-un-lft-identity79.8%
pow279.8%
times-frac81.7%
*-commutative81.7%
Applied egg-rr81.7%
Taylor expanded in x.im around 0 79.8%
+-commutative79.8%
mul-1-neg79.8%
sub-neg79.8%
*-commutative79.8%
*-rgt-identity79.8%
*-commutative79.8%
unpow279.8%
times-frac81.7%
associate-/l*81.6%
*-commutative81.6%
associate-*r/81.7%
*-rgt-identity81.7%
associate-*r/83.6%
div-sub83.6%
Simplified83.6%
if -6.50000000000000017e53 < y.re < -2.5e-188 or 3.5000000000000001e-100 < y.re < 6.5000000000000003e139Initial program 84.4%
if -2.5e-188 < y.re < 3.5000000000000001e-100Initial program 76.9%
Taylor expanded in y.re around 0 89.7%
+-commutative89.7%
mul-1-neg89.7%
unsub-neg89.7%
associate-/l*92.3%
Simplified92.3%
if 6.5000000000000003e139 < y.re Initial program 30.0%
Taylor expanded in y.re around inf 77.4%
+-commutative77.4%
mul-1-neg77.4%
unsub-neg77.4%
Simplified77.4%
*-commutative77.4%
pow277.4%
times-frac89.2%
Applied egg-rr89.2%
Final simplification87.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.re -1.65e+54)
(/ (- x.im (* y.im (/ x.re y.re))) y.re)
(if (<= y.re 4.3e-234)
t_0
(if (<= y.re 1.25e-204)
(/ x.re (- y.im))
(if (<= y.re 6.5e+139)
t_0
(- (/ x.im y.re) (* (/ x.re y.re) (/ y.im y.re)))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.65e+54) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else if (y_46_re <= 4.3e-234) {
tmp = t_0;
} else if (y_46_re <= 1.25e-204) {
tmp = x_46_re / -y_46_im;
} else if (y_46_re <= 6.5e+139) {
tmp = t_0;
} else {
tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (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) :: t_0
real(8) :: tmp
t_0 = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46re <= (-1.65d+54)) then
tmp = (x_46im - (y_46im * (x_46re / y_46re))) / y_46re
else if (y_46re <= 4.3d-234) then
tmp = t_0
else if (y_46re <= 1.25d-204) then
tmp = x_46re / -y_46im
else if (y_46re <= 6.5d+139) then
tmp = t_0
else
tmp = (x_46im / y_46re) - ((x_46re / y_46re) * (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 t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_re <= -1.65e+54) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else if (y_46_re <= 4.3e-234) {
tmp = t_0;
} else if (y_46_re <= 1.25e-204) {
tmp = x_46_re / -y_46_im;
} else if (y_46_re <= 6.5e+139) {
tmp = t_0;
} else {
tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (y_46_im / y_46_re));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_re <= -1.65e+54: tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re elif y_46_re <= 4.3e-234: tmp = t_0 elif y_46_re <= 1.25e-204: tmp = x_46_re / -y_46_im elif y_46_re <= 6.5e+139: tmp = t_0 else: tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (y_46_im / y_46_re)) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_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))) tmp = 0.0 if (y_46_re <= -1.65e+54) tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / y_46_re); elseif (y_46_re <= 4.3e-234) tmp = t_0; elseif (y_46_re <= 1.25e-204) tmp = Float64(x_46_re / Float64(-y_46_im)); elseif (y_46_re <= 6.5e+139) tmp = t_0; else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(x_46_re / y_46_re) * 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) t_0 = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_re <= -1.65e+54) tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re; elseif (y_46_re <= 4.3e-234) tmp = t_0; elseif (y_46_re <= 1.25e-204) tmp = x_46_re / -y_46_im; elseif (y_46_re <= 6.5e+139) tmp = t_0; else tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (y_46_im / y_46_re)); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$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]}, If[LessEqual[y$46$re, -1.65e+54], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 4.3e-234], t$95$0, If[LessEqual[y$46$re, 1.25e-204], N[(x$46$re / (-y$46$im)), $MachinePrecision], If[LessEqual[y$46$re, 6.5e+139], t$95$0, N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(x$46$re / y$46$re), $MachinePrecision] * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.re \leq -1.65 \cdot 10^{+54}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 4.3 \cdot 10^{-234}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.25 \cdot 10^{-204}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{elif}\;y.re \leq 6.5 \cdot 10^{+139}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{x.re}{y.re} \cdot \frac{y.im}{y.re}\\
\end{array}
\end{array}
if y.re < -1.65e54Initial program 46.7%
Taylor expanded in y.re around inf 79.8%
+-commutative79.8%
mul-1-neg79.8%
unsub-neg79.8%
Simplified79.8%
*-un-lft-identity79.8%
pow279.8%
times-frac81.7%
*-commutative81.7%
Applied egg-rr81.7%
Taylor expanded in x.im around 0 79.8%
+-commutative79.8%
mul-1-neg79.8%
sub-neg79.8%
*-commutative79.8%
*-rgt-identity79.8%
*-commutative79.8%
unpow279.8%
times-frac81.7%
associate-/l*81.6%
*-commutative81.6%
associate-*r/81.7%
*-rgt-identity81.7%
associate-*r/83.6%
div-sub83.6%
Simplified83.6%
if -1.65e54 < y.re < 4.3000000000000001e-234 or 1.25e-204 < y.re < 6.5000000000000003e139Initial program 82.9%
if 4.3000000000000001e-234 < y.re < 1.25e-204Initial program 46.4%
Taylor expanded in y.re around 0 100.0%
associate-*r/100.0%
neg-mul-1100.0%
Simplified100.0%
if 6.5000000000000003e139 < y.re Initial program 30.0%
Taylor expanded in y.re around inf 77.4%
+-commutative77.4%
mul-1-neg77.4%
unsub-neg77.4%
Simplified77.4%
*-commutative77.4%
pow277.4%
times-frac89.2%
Applied egg-rr89.2%
Final simplification84.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -6.5e-109)
(/ (- x.im (/ (* x.re y.im) y.re)) y.re)
(if (<= y.re 5.2e-66)
(/ x.re (- y.im))
(- (/ x.im y.re) (* (/ x.re y.re) (/ 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 <= -6.5e-109) {
tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_re <= 5.2e-66) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (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 <= (-6.5d-109)) then
tmp = (x_46im - ((x_46re * y_46im) / y_46re)) / y_46re
else if (y_46re <= 5.2d-66) then
tmp = x_46re / -y_46im
else
tmp = (x_46im / y_46re) - ((x_46re / y_46re) * (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 <= -6.5e-109) {
tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_re <= 5.2e-66) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (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 <= -6.5e-109: tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re elif y_46_re <= 5.2e-66: tmp = x_46_re / -y_46_im else: tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (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 <= -6.5e-109) tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_re <= 5.2e-66) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(x_46_re / y_46_re) * 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 <= -6.5e-109) tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re; elseif (y_46_re <= 5.2e-66) tmp = x_46_re / -y_46_im; else tmp = (x_46_im / y_46_re) - ((x_46_re / y_46_re) * (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[LessEqual[y$46$re, -6.5e-109], N[(N[(x$46$im - N[(N[(x$46$re * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 5.2e-66], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(x$46$re / y$46$re), $MachinePrecision] * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -6.5 \cdot 10^{-109}:\\
\;\;\;\;\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 5.2 \cdot 10^{-66}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{x.re}{y.re} \cdot \frac{y.im}{y.re}\\
\end{array}
\end{array}
if y.re < -6.49999999999999959e-109Initial program 62.1%
Taylor expanded in y.re around inf 71.7%
+-commutative71.7%
mul-1-neg71.7%
unsub-neg71.7%
Simplified71.7%
*-un-lft-identity71.7%
pow271.7%
times-frac72.8%
*-commutative72.8%
Applied egg-rr72.8%
Taylor expanded in x.im around 0 71.7%
+-commutative71.7%
mul-1-neg71.7%
sub-neg71.7%
*-commutative71.7%
*-rgt-identity71.7%
*-commutative71.7%
unpow271.7%
times-frac72.8%
associate-/l*72.7%
*-commutative72.7%
associate-*r/72.8%
*-rgt-identity72.8%
associate-*r/70.5%
div-sub70.5%
Simplified70.5%
associate-*r/72.8%
Applied egg-rr72.8%
if -6.49999999999999959e-109 < y.re < 5.1999999999999998e-66Initial program 79.8%
Taylor expanded in y.re around 0 74.3%
associate-*r/74.3%
neg-mul-174.3%
Simplified74.3%
if 5.1999999999999998e-66 < y.re Initial program 55.3%
Taylor expanded in y.re around inf 69.6%
+-commutative69.6%
mul-1-neg69.6%
unsub-neg69.6%
Simplified69.6%
*-commutative69.6%
pow269.6%
times-frac75.4%
Applied egg-rr75.4%
Final simplification74.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -8.3e-103) (not (<= y.re 4.5e-61))) (/ (- x.im (* y.im (/ x.re y.re))) 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_re <= -8.3e-103) || !(y_46_re <= 4.5e-61)) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / 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_46re <= (-8.3d-103)) .or. (.not. (y_46re <= 4.5d-61))) then
tmp = (x_46im - (y_46im * (x_46re / y_46re))) / 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_re <= -8.3e-103) || !(y_46_re <= 4.5e-61)) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / 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_re <= -8.3e-103) or not (y_46_re <= 4.5e-61): tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / 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_re <= -8.3e-103) || !(y_46_re <= 4.5e-61)) tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / y_46_re); else tmp = Float64(x_46_re / Float64(-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_re <= -8.3e-103) || ~((y_46_re <= 4.5e-61))) tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / 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[Or[LessEqual[y$46$re, -8.3e-103], N[Not[LessEqual[y$46$re, 4.5e-61]], $MachinePrecision]], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(x$46$re / (-y$46$im)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -8.3 \cdot 10^{-103} \lor \neg \left(y.re \leq 4.5 \cdot 10^{-61}\right):\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -8.30000000000000006e-103 or 4.5e-61 < y.re Initial program 59.1%
Taylor expanded in y.re around inf 70.8%
+-commutative70.8%
mul-1-neg70.8%
unsub-neg70.8%
Simplified70.8%
*-un-lft-identity70.8%
pow270.8%
times-frac70.8%
*-commutative70.8%
Applied egg-rr70.8%
Taylor expanded in x.im around 0 70.8%
+-commutative70.8%
mul-1-neg70.8%
sub-neg70.8%
*-commutative70.8%
*-rgt-identity70.8%
*-commutative70.8%
unpow270.8%
times-frac70.8%
associate-/l*70.8%
*-commutative70.8%
associate-*r/70.9%
*-rgt-identity70.9%
associate-*r/72.7%
div-sub72.7%
Simplified72.7%
if -8.30000000000000006e-103 < y.re < 4.5e-61Initial program 79.8%
Taylor expanded in y.re around 0 74.3%
associate-*r/74.3%
neg-mul-174.3%
Simplified74.3%
Final simplification73.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -2.4e-103)
(/ (- x.im (/ (* x.re y.im) y.re)) y.re)
(if (<= y.re 2.2e-60)
(/ x.re (- y.im))
(/ (- x.im (* y.im (/ x.re 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_re <= -2.4e-103) {
tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_re <= 2.2e-60) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (y_46_im * (x_46_re / 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_46re <= (-2.4d-103)) then
tmp = (x_46im - ((x_46re * y_46im) / y_46re)) / y_46re
else if (y_46re <= 2.2d-60) then
tmp = x_46re / -y_46im
else
tmp = (x_46im - (y_46im * (x_46re / 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_re <= -2.4e-103) {
tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_re <= 2.2e-60) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (y_46_im * (x_46_re / 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_re <= -2.4e-103: tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re elif y_46_re <= 2.2e-60: tmp = x_46_re / -y_46_im else: tmp = (x_46_im - (y_46_im * (x_46_re / 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_re <= -2.4e-103) tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_re <= 2.2e-60) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / 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_re <= -2.4e-103) tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re; elseif (y_46_re <= 2.2e-60) tmp = x_46_re / -y_46_im; else tmp = (x_46_im - (y_46_im * (x_46_re / 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[LessEqual[y$46$re, -2.4e-103], N[(N[(x$46$im - N[(N[(x$46$re * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 2.2e-60], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.4 \cdot 10^{-103}:\\
\;\;\;\;\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 2.2 \cdot 10^{-60}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -2.4000000000000002e-103Initial program 62.1%
Taylor expanded in y.re around inf 71.7%
+-commutative71.7%
mul-1-neg71.7%
unsub-neg71.7%
Simplified71.7%
*-un-lft-identity71.7%
pow271.7%
times-frac72.8%
*-commutative72.8%
Applied egg-rr72.8%
Taylor expanded in x.im around 0 71.7%
+-commutative71.7%
mul-1-neg71.7%
sub-neg71.7%
*-commutative71.7%
*-rgt-identity71.7%
*-commutative71.7%
unpow271.7%
times-frac72.8%
associate-/l*72.7%
*-commutative72.7%
associate-*r/72.8%
*-rgt-identity72.8%
associate-*r/70.5%
div-sub70.5%
Simplified70.5%
associate-*r/72.8%
Applied egg-rr72.8%
if -2.4000000000000002e-103 < y.re < 2.1999999999999999e-60Initial program 79.8%
Taylor expanded in y.re around 0 74.3%
associate-*r/74.3%
neg-mul-174.3%
Simplified74.3%
if 2.1999999999999999e-60 < y.re Initial program 55.3%
Taylor expanded in y.re around inf 69.6%
+-commutative69.6%
mul-1-neg69.6%
unsub-neg69.6%
Simplified69.6%
*-un-lft-identity69.6%
pow269.6%
times-frac68.4%
*-commutative68.4%
Applied egg-rr68.4%
Taylor expanded in x.im around 0 69.6%
+-commutative69.6%
mul-1-neg69.6%
sub-neg69.6%
*-commutative69.6%
*-rgt-identity69.6%
*-commutative69.6%
unpow269.6%
times-frac68.4%
associate-/l*68.4%
*-commutative68.4%
associate-*r/68.4%
*-rgt-identity68.4%
associate-*r/75.4%
div-sub75.4%
Simplified75.4%
Final simplification74.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3e-82) (not (<= y.re 0.0035))) (/ 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_re <= -3e-82) || !(y_46_re <= 0.0035)) {
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_46re <= (-3d-82)) .or. (.not. (y_46re <= 0.0035d0))) 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_re <= -3e-82) || !(y_46_re <= 0.0035)) {
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_re <= -3e-82) or not (y_46_re <= 0.0035): 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_re <= -3e-82) || !(y_46_re <= 0.0035)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(x_46_re / Float64(-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_re <= -3e-82) || ~((y_46_re <= 0.0035))) 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[Or[LessEqual[y$46$re, -3e-82], N[Not[LessEqual[y$46$re, 0.0035]], $MachinePrecision]], 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.re \leq -3 \cdot 10^{-82} \lor \neg \left(y.re \leq 0.0035\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -2.9999999999999999e-82 or 0.00350000000000000007 < y.re Initial program 55.2%
Taylor expanded in y.re around inf 65.6%
if -2.9999999999999999e-82 < y.re < 0.00350000000000000007Initial program 81.7%
Taylor expanded in y.re around 0 69.6%
associate-*r/69.6%
neg-mul-169.6%
Simplified69.6%
Final simplification67.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4e+162) (not (<= y.im 1.2e+167))) (/ 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 <= -4e+162) || !(y_46_im <= 1.2e+167)) {
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 <= (-4d+162)) .or. (.not. (y_46im <= 1.2d+167))) 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 <= -4e+162) || !(y_46_im <= 1.2e+167)) {
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 <= -4e+162) or not (y_46_im <= 1.2e+167): 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 <= -4e+162) || !(y_46_im <= 1.2e+167)) 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 <= -4e+162) || ~((y_46_im <= 1.2e+167))) 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, -4e+162], N[Not[LessEqual[y$46$im, 1.2e+167]], $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 -4 \cdot 10^{+162} \lor \neg \left(y.im \leq 1.2 \cdot 10^{+167}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -3.9999999999999998e162 or 1.19999999999999999e167 < y.im Initial program 37.4%
*-un-lft-identity37.4%
add-sqr-sqrt37.4%
times-frac37.4%
hypot-define37.4%
fma-neg37.4%
distribute-rgt-neg-in37.4%
hypot-define68.4%
Applied egg-rr68.4%
Taylor expanded in y.re around 0 64.4%
+-commutative64.4%
mul-1-neg64.4%
unsub-neg64.4%
*-commutative64.4%
Simplified64.4%
Taylor expanded in y.im around -inf 36.4%
if -3.9999999999999998e162 < y.im < 1.19999999999999999e167Initial program 76.5%
Taylor expanded in y.re around inf 52.4%
Final simplification48.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 67.0%
*-un-lft-identity67.0%
add-sqr-sqrt67.0%
times-frac67.0%
hypot-define67.0%
fma-neg67.0%
distribute-rgt-neg-in67.0%
hypot-define80.0%
Applied egg-rr80.0%
Taylor expanded in y.re around -inf 31.6%
neg-mul-131.6%
Simplified31.6%
Taylor expanded in y.im around -inf 12.0%
Final simplification12.0%
(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 67.0%
Taylor expanded in y.re around inf 44.2%
Final simplification44.2%
herbie shell --seed 2024046
(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))))