
(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 (/ (- (* y.re (/ x.im (hypot y.re y.im))) (* y.im (/ x.re (hypot y.re y.im)))) (hypot y.re y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((y_46_re * (x_46_im / hypot(y_46_re, y_46_im))) - (y_46_im * (x_46_re / hypot(y_46_re, y_46_im)))) / hypot(y_46_re, y_46_im);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((y_46_re * (x_46_im / Math.hypot(y_46_re, y_46_im))) - (y_46_im * (x_46_re / Math.hypot(y_46_re, y_46_im)))) / Math.hypot(y_46_re, y_46_im);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((y_46_re * (x_46_im / math.hypot(y_46_re, y_46_im))) - (y_46_im * (x_46_re / math.hypot(y_46_re, y_46_im)))) / math.hypot(y_46_re, y_46_im)
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(y_46_re * Float64(x_46_im / hypot(y_46_re, y_46_im))) - Float64(y_46_im * Float64(x_46_re / hypot(y_46_re, y_46_im)))) / hypot(y_46_re, y_46_im)) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((y_46_re * (x_46_im / hypot(y_46_re, y_46_im))) - (y_46_im * (x_46_re / hypot(y_46_re, y_46_im)))) / hypot(y_46_re, y_46_im); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(y$46$re * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y$46$im * N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y.re \cdot \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)} - y.im \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}
\end{array}
Initial program 60.3%
div-sub58.6%
*-un-lft-identity58.6%
add-sqr-sqrt58.6%
times-frac58.6%
fmm-def59.0%
hypot-define59.0%
hypot-define63.3%
associate-/l*65.5%
add-sqr-sqrt65.5%
pow265.5%
hypot-define65.5%
Applied egg-rr65.5%
fmm-undef65.1%
*-commutative65.1%
associate-/l*79.1%
associate-*r/75.7%
*-commutative75.7%
associate-/l*74.6%
Simplified74.6%
*-un-lft-identity74.6%
unpow274.6%
times-frac83.9%
Applied egg-rr83.9%
associate-*l/83.9%
*-lft-identity83.9%
hypot-undefine74.7%
unpow274.7%
unpow274.7%
+-commutative74.7%
unpow274.7%
unpow274.7%
hypot-define83.9%
hypot-undefine74.7%
unpow274.7%
unpow274.7%
+-commutative74.7%
unpow274.7%
unpow274.7%
hypot-define83.9%
Simplified83.9%
associate-*l/84.1%
*-un-lft-identity84.1%
associate-*r/97.3%
hypot-undefine79.0%
+-commutative79.0%
hypot-undefine97.3%
sub-div97.3%
hypot-undefine79.0%
+-commutative79.0%
hypot-undefine97.3%
Applied egg-rr97.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -3.6e-22)
(/ (- (- x.im) (* y.im (/ x.re (hypot y.re y.im)))) (hypot y.re y.im))
(if (<= y.re 9.8e-111)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.re 1e+139)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(/ (- x.im (* y.im (/ x.re y.re))) (hypot y.re y.im))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -3.6e-22) {
tmp = (-x_46_im - (y_46_im * (x_46_re / hypot(y_46_re, y_46_im)))) / hypot(y_46_re, y_46_im);
} else if (y_46_re <= 9.8e-111) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1e+139) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / hypot(y_46_re, y_46_im);
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -3.6e-22) {
tmp = (-x_46_im - (y_46_im * (x_46_re / Math.hypot(y_46_re, y_46_im)))) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_re <= 9.8e-111) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1e+139) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / Math.hypot(y_46_re, y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_re <= -3.6e-22: tmp = (-x_46_im - (y_46_im * (x_46_re / math.hypot(y_46_re, y_46_im)))) / math.hypot(y_46_re, y_46_im) elif y_46_re <= 9.8e-111: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im elif y_46_re <= 1e+139: tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) else: tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / math.hypot(y_46_re, y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -3.6e-22) tmp = Float64(Float64(Float64(-x_46_im) - Float64(y_46_im * Float64(x_46_re / hypot(y_46_re, y_46_im)))) / hypot(y_46_re, y_46_im)); elseif (y_46_re <= 9.8e-111) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_re <= 1e+139) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / hypot(y_46_re, y_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_re <= -3.6e-22) tmp = (-x_46_im - (y_46_im * (x_46_re / hypot(y_46_re, y_46_im)))) / hypot(y_46_re, y_46_im); elseif (y_46_re <= 9.8e-111) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_re <= 1e+139) tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); else tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / hypot(y_46_re, y_46_im); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3.6e-22], N[(N[((-x$46$im) - N[(y$46$im * N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.8e-111], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1e+139], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.6 \cdot 10^{-22}:\\
\;\;\;\;\frac{\left(-x.im\right) - y.im \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.re \leq 9.8 \cdot 10^{-111}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 10^{+139}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -3.5999999999999998e-22Initial program 48.5%
div-sub48.5%
*-un-lft-identity48.5%
add-sqr-sqrt48.5%
times-frac48.4%
fmm-def48.4%
hypot-define48.4%
hypot-define53.2%
associate-/l*54.6%
add-sqr-sqrt54.6%
pow254.6%
hypot-define54.6%
Applied egg-rr54.6%
fmm-undef54.6%
*-commutative54.6%
associate-/l*85.4%
associate-*r/84.0%
*-commutative84.0%
associate-/l*85.5%
Simplified85.5%
*-un-lft-identity85.5%
unpow285.5%
times-frac96.6%
Applied egg-rr96.6%
associate-*l/96.6%
*-lft-identity96.6%
hypot-undefine85.5%
unpow285.5%
unpow285.5%
+-commutative85.5%
unpow285.5%
unpow285.5%
hypot-define96.6%
hypot-undefine85.5%
unpow285.5%
unpow285.5%
+-commutative85.5%
unpow285.5%
unpow285.5%
hypot-define96.6%
Simplified96.6%
associate-*l/96.9%
*-un-lft-identity96.9%
associate-*r/99.8%
hypot-undefine85.8%
+-commutative85.8%
hypot-undefine99.8%
sub-div99.8%
hypot-undefine85.8%
+-commutative85.8%
hypot-undefine99.8%
Applied egg-rr99.8%
Taylor expanded in y.re around -inf 90.5%
neg-mul-190.5%
Simplified90.5%
if -3.5999999999999998e-22 < y.re < 9.80000000000000038e-111Initial program 68.6%
div-sub64.4%
*-un-lft-identity64.4%
add-sqr-sqrt64.4%
times-frac64.3%
fmm-def65.3%
hypot-define65.3%
hypot-define65.5%
associate-/l*71.8%
add-sqr-sqrt71.8%
pow271.8%
hypot-define71.8%
Applied egg-rr71.8%
fmm-undef70.8%
*-commutative70.8%
associate-/l*69.9%
associate-*r/63.6%
*-commutative63.6%
associate-/l*62.1%
Simplified62.1%
Taylor expanded in y.im around inf 91.4%
associate-/l*91.6%
Simplified91.6%
if 9.80000000000000038e-111 < y.re < 1.00000000000000003e139Initial program 87.4%
if 1.00000000000000003e139 < y.re Initial program 24.5%
div-sub24.5%
*-un-lft-identity24.5%
add-sqr-sqrt24.5%
times-frac24.5%
fmm-def24.5%
hypot-define24.5%
hypot-define45.8%
associate-/l*46.2%
add-sqr-sqrt46.2%
pow246.2%
hypot-define46.2%
Applied egg-rr46.2%
fmm-undef46.2%
*-commutative46.2%
associate-/l*83.2%
associate-*r/74.2%
*-commutative74.2%
associate-/l*83.2%
Simplified83.2%
*-un-lft-identity83.2%
unpow283.2%
times-frac91.5%
Applied egg-rr91.5%
associate-*l/91.4%
*-lft-identity91.4%
hypot-undefine83.2%
unpow283.2%
unpow283.2%
+-commutative83.2%
unpow283.2%
unpow283.2%
hypot-define91.4%
hypot-undefine83.2%
unpow283.2%
unpow283.2%
+-commutative83.2%
unpow283.2%
unpow283.2%
hypot-define91.4%
Simplified91.4%
associate-*l/91.7%
*-un-lft-identity91.7%
associate-*r/99.9%
hypot-undefine83.5%
+-commutative83.5%
hypot-undefine99.9%
sub-div99.9%
hypot-undefine83.5%
+-commutative83.5%
hypot-undefine99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around inf 82.9%
mul-1-neg82.9%
sub-neg82.9%
*-commutative82.9%
associate-/l*85.0%
Simplified85.0%
Final simplification89.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))))
(t_1 (- x.im (* y.im (/ x.re y.re)))))
(if (<= y.re -1.6e+67)
(/ t_1 y.re)
(if (<= y.re -9.2e-37)
t_0
(if (<= y.re 2.5e-111)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.re 3.4e+139) t_0 (/ t_1 (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * 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_im * (x_46_re / y_46_re));
double tmp;
if (y_46_re <= -1.6e+67) {
tmp = t_1 / y_46_re;
} else if (y_46_re <= -9.2e-37) {
tmp = t_0;
} else if (y_46_re <= 2.5e-111) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 3.4e+139) {
tmp = t_0;
} else {
tmp = t_1 / 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 t_1 = x_46_im - (y_46_im * (x_46_re / y_46_re));
double tmp;
if (y_46_re <= -1.6e+67) {
tmp = t_1 / y_46_re;
} else if (y_46_re <= -9.2e-37) {
tmp = t_0;
} else if (y_46_re <= 2.5e-111) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 3.4e+139) {
tmp = t_0;
} else {
tmp = t_1 / 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)) t_1 = x_46_im - (y_46_im * (x_46_re / y_46_re)) tmp = 0 if y_46_re <= -1.6e+67: tmp = t_1 / y_46_re elif y_46_re <= -9.2e-37: tmp = t_0 elif y_46_re <= 2.5e-111: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im elif y_46_re <= 3.4e+139: tmp = t_0 else: tmp = t_1 / 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))) t_1 = Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) tmp = 0.0 if (y_46_re <= -1.6e+67) tmp = Float64(t_1 / y_46_re); elseif (y_46_re <= -9.2e-37) tmp = t_0; elseif (y_46_re <= 2.5e-111) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_re <= 3.4e+139) tmp = t_0; else tmp = Float64(t_1 / 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)); t_1 = x_46_im - (y_46_im * (x_46_re / y_46_re)); tmp = 0.0; if (y_46_re <= -1.6e+67) tmp = t_1 / y_46_re; elseif (y_46_re <= -9.2e-37) tmp = t_0; elseif (y_46_re <= 2.5e-111) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_re <= 3.4e+139) tmp = t_0; else tmp = t_1 / 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]}, Block[{t$95$1 = N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.6e+67], N[(t$95$1 / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -9.2e-37], t$95$0, If[LessEqual[y$46$re, 2.5e-111], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 3.4e+139], t$95$0, N[(t$95$1 / 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}\\
t_1 := x.im - y.im \cdot \frac{x.re}{y.re}\\
\mathbf{if}\;y.re \leq -1.6 \cdot 10^{+67}:\\
\;\;\;\;\frac{t\_1}{y.re}\\
\mathbf{elif}\;y.re \leq -9.2 \cdot 10^{-37}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-111}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 3.4 \cdot 10^{+139}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.re < -1.59999999999999991e67Initial program 39.2%
Taylor expanded in y.re around inf 84.8%
mul-1-neg84.8%
unsub-neg84.8%
*-commutative84.8%
associate-/l*88.2%
Simplified88.2%
if -1.59999999999999991e67 < y.re < -9.1999999999999999e-37 or 2.5000000000000001e-111 < y.re < 3.4000000000000002e139Initial program 85.6%
if -9.1999999999999999e-37 < y.re < 2.5000000000000001e-111Initial program 67.3%
div-sub62.9%
*-un-lft-identity62.9%
add-sqr-sqrt62.9%
times-frac62.9%
fmm-def63.9%
hypot-define63.9%
hypot-define64.1%
associate-/l*70.6%
add-sqr-sqrt70.6%
pow270.6%
hypot-define70.6%
Applied egg-rr70.6%
fmm-undef69.6%
*-commutative69.6%
associate-/l*68.6%
associate-*r/62.1%
*-commutative62.1%
associate-/l*61.4%
Simplified61.4%
Taylor expanded in y.im around inf 92.0%
associate-/l*92.2%
Simplified92.2%
if 3.4000000000000002e139 < y.re Initial program 24.5%
div-sub24.5%
*-un-lft-identity24.5%
add-sqr-sqrt24.5%
times-frac24.5%
fmm-def24.5%
hypot-define24.5%
hypot-define45.8%
associate-/l*46.2%
add-sqr-sqrt46.2%
pow246.2%
hypot-define46.2%
Applied egg-rr46.2%
fmm-undef46.2%
*-commutative46.2%
associate-/l*83.2%
associate-*r/74.2%
*-commutative74.2%
associate-/l*83.2%
Simplified83.2%
*-un-lft-identity83.2%
unpow283.2%
times-frac91.5%
Applied egg-rr91.5%
associate-*l/91.4%
*-lft-identity91.4%
hypot-undefine83.2%
unpow283.2%
unpow283.2%
+-commutative83.2%
unpow283.2%
unpow283.2%
hypot-define91.4%
hypot-undefine83.2%
unpow283.2%
unpow283.2%
+-commutative83.2%
unpow283.2%
unpow283.2%
hypot-define91.4%
Simplified91.4%
associate-*l/91.7%
*-un-lft-identity91.7%
associate-*r/99.9%
hypot-undefine83.5%
+-commutative83.5%
hypot-undefine99.9%
sub-div99.9%
hypot-undefine83.5%
+-commutative83.5%
hypot-undefine99.9%
Applied egg-rr99.9%
Taylor expanded in y.re around inf 82.9%
mul-1-neg82.9%
sub-neg82.9%
*-commutative82.9%
associate-/l*85.0%
Simplified85.0%
Final simplification88.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))))
(t_1 (/ (- x.im (* y.im (/ x.re y.re))) y.re)))
(if (<= y.re -1.14e+67)
t_1
(if (<= y.re -8e-37)
t_0
(if (<= y.re 1.2e-108)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.re 1.65e+143) 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_im * (x_46_re / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -1.14e+67) {
tmp = t_1;
} else if (y_46_re <= -8e-37) {
tmp = t_0;
} else if (y_46_re <= 1.2e-108) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.65e+143) {
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_46im * (x_46re / y_46re))) / y_46re
if (y_46re <= (-1.14d+67)) then
tmp = t_1
else if (y_46re <= (-8d-37)) then
tmp = t_0
else if (y_46re <= 1.2d-108) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else if (y_46re <= 1.65d+143) 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_im * (x_46_re / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -1.14e+67) {
tmp = t_1;
} else if (y_46_re <= -8e-37) {
tmp = t_0;
} else if (y_46_re <= 1.2e-108) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.65e+143) {
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_im * (x_46_re / y_46_re))) / y_46_re tmp = 0 if y_46_re <= -1.14e+67: tmp = t_1 elif y_46_re <= -8e-37: tmp = t_0 elif y_46_re <= 1.2e-108: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im elif y_46_re <= 1.65e+143: 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 - Float64(y_46_im * Float64(x_46_re / y_46_re))) / y_46_re) tmp = 0.0 if (y_46_re <= -1.14e+67) tmp = t_1; elseif (y_46_re <= -8e-37) tmp = t_0; elseif (y_46_re <= 1.2e-108) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_re <= 1.65e+143) 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_im * (x_46_re / y_46_re))) / y_46_re; tmp = 0.0; if (y_46_re <= -1.14e+67) tmp = t_1; elseif (y_46_re <= -8e-37) tmp = t_0; elseif (y_46_re <= 1.2e-108) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_re <= 1.65e+143) 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 - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -1.14e+67], t$95$1, If[LessEqual[y$46$re, -8e-37], t$95$0, If[LessEqual[y$46$re, 1.2e-108], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.65e+143], 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.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -1.14 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -8 \cdot 10^{-37}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-108}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.65 \cdot 10^{+143}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -1.1400000000000001e67 or 1.65e143 < y.re Initial program 33.7%
Taylor expanded in y.re around inf 84.0%
mul-1-neg84.0%
unsub-neg84.0%
*-commutative84.0%
associate-/l*86.9%
Simplified86.9%
if -1.1400000000000001e67 < y.re < -8.00000000000000053e-37 or 1.20000000000000009e-108 < y.re < 1.65e143Initial program 85.6%
if -8.00000000000000053e-37 < y.re < 1.20000000000000009e-108Initial program 67.3%
div-sub62.9%
*-un-lft-identity62.9%
add-sqr-sqrt62.9%
times-frac62.9%
fmm-def63.9%
hypot-define63.9%
hypot-define64.1%
associate-/l*70.6%
add-sqr-sqrt70.6%
pow270.6%
hypot-define70.6%
Applied egg-rr70.6%
fmm-undef69.6%
*-commutative69.6%
associate-/l*68.6%
associate-*r/62.1%
*-commutative62.1%
associate-/l*61.4%
Simplified61.4%
Taylor expanded in y.im around inf 92.0%
associate-/l*92.2%
Simplified92.2%
Final simplification88.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.9e+70) (not (<= y.re 2.5e-79))) (/ (- x.im (* y.im (/ x.re y.re))) y.re) (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -2.9e+70) || !(y_46_re <= 2.5e-79)) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - 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 <= (-2.9d+70)) .or. (.not. (y_46re <= 2.5d-79))) then
tmp = (x_46im - (y_46im * (x_46re / y_46re))) / y_46re
else
tmp = ((x_46im * (y_46re / y_46im)) - 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 <= -2.9e+70) || !(y_46_re <= 2.5e-79)) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -2.9e+70) or not (y_46_re <= 2.5e-79): tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re else: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -2.9e+70) || !(y_46_re <= 2.5e-79)) tmp = Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / y_46_re); else tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -2.9e+70) || ~((y_46_re <= 2.5e-79))) tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re; else tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.9e+70], N[Not[LessEqual[y$46$re, 2.5e-79]], $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[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.9 \cdot 10^{+70} \lor \neg \left(y.re \leq 2.5 \cdot 10^{-79}\right):\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -2.8999999999999998e70 or 2.5e-79 < y.re Initial program 50.5%
Taylor expanded in y.re around inf 79.8%
mul-1-neg79.8%
unsub-neg79.8%
*-commutative79.8%
associate-/l*81.8%
Simplified81.8%
if -2.8999999999999998e70 < y.re < 2.5e-79Initial program 70.1%
div-sub66.8%
*-un-lft-identity66.8%
add-sqr-sqrt66.8%
times-frac66.7%
fmm-def67.5%
hypot-define67.5%
hypot-define67.6%
associate-/l*73.3%
add-sqr-sqrt73.3%
pow273.3%
hypot-define73.3%
Applied egg-rr73.3%
fmm-undef72.6%
*-commutative72.6%
associate-/l*73.4%
associate-*r/67.6%
*-commutative67.6%
associate-/l*66.6%
Simplified66.6%
Taylor expanded in y.im around inf 83.2%
associate-/l*84.9%
Simplified84.9%
Final simplification83.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.8e-20) (not (<= y.re 2.2e-79))) (/ (- 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 <= -2.8e-20) || !(y_46_re <= 2.2e-79)) {
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 <= (-2.8d-20)) .or. (.not. (y_46re <= 2.2d-79))) 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 <= -2.8e-20) || !(y_46_re <= 2.2e-79)) {
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 <= -2.8e-20) or not (y_46_re <= 2.2e-79): 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 <= -2.8e-20) || !(y_46_re <= 2.2e-79)) 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 <= -2.8e-20) || ~((y_46_re <= 2.2e-79))) 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, -2.8e-20], N[Not[LessEqual[y$46$re, 2.2e-79]], $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 -2.8 \cdot 10^{-20} \lor \neg \left(y.re \leq 2.2 \cdot 10^{-79}\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 < -2.8000000000000003e-20 or 2.1999999999999999e-79 < y.re Initial program 53.2%
Taylor expanded in y.re around inf 75.0%
mul-1-neg75.0%
unsub-neg75.0%
*-commutative75.0%
associate-/l*76.7%
Simplified76.7%
if -2.8000000000000003e-20 < y.re < 2.1999999999999999e-79Initial program 70.0%
Taylor expanded in y.re around 0 74.6%
associate-*r/74.6%
neg-mul-174.6%
Simplified74.6%
Final simplification75.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1e+67) (not (<= y.re 2.35e-79))) (/ 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 <= -1e+67) || !(y_46_re <= 2.35e-79)) {
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 <= (-1d+67)) .or. (.not. (y_46re <= 2.35d-79))) 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 <= -1e+67) || !(y_46_re <= 2.35e-79)) {
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 <= -1e+67) or not (y_46_re <= 2.35e-79): 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 <= -1e+67) || !(y_46_re <= 2.35e-79)) 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 <= -1e+67) || ~((y_46_re <= 2.35e-79))) 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, -1e+67], N[Not[LessEqual[y$46$re, 2.35e-79]], $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 -1 \cdot 10^{+67} \lor \neg \left(y.re \leq 2.35 \cdot 10^{-79}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -9.99999999999999983e66 or 2.3500000000000001e-79 < y.re Initial program 49.8%
Taylor expanded in y.re around inf 68.5%
if -9.99999999999999983e66 < y.re < 2.3500000000000001e-79Initial program 71.2%
Taylor expanded in y.re around 0 69.8%
associate-*r/69.8%
neg-mul-169.8%
Simplified69.8%
Final simplification69.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 9.2e+228) (/ 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 <= 9.2e+228) {
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 <= 9.2d+228) 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 <= 9.2e+228) {
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 <= 9.2e+228: 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 <= 9.2e+228) 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 <= 9.2e+228) 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, 9.2e+228], 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 9.2 \cdot 10^{+228}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < 9.20000000000000052e228Initial program 61.5%
Taylor expanded in y.re around inf 45.4%
if 9.20000000000000052e228 < y.im Initial program 48.4%
Taylor expanded in y.re around 0 83.5%
associate-*r/83.5%
neg-mul-183.5%
Simplified83.5%
add-sqr-sqrt30.7%
sqrt-unprod57.9%
sqr-neg57.9%
sqrt-unprod27.1%
add-sqr-sqrt49.8%
*-un-lft-identity49.8%
Applied egg-rr49.8%
*-lft-identity49.8%
Simplified49.8%
(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.3%
Taylor expanded in y.re around inf 42.4%
herbie shell --seed 2024180
(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))))