
(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 (fma (log1p (expm1 (/ y.re (hypot y.re y.im)))) (/ x.im (hypot y.re y.im)) (* x.re (/ (/ y.im (hypot y.im y.re)) (- (hypot y.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma(log1p(expm1((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 / hypot(y_46_im, y_46_re)) / -hypot(y_46_im, y_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return fma(log1p(expm1(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(Float64(y_46_im / hypot(y_46_im, y_46_re)) / Float64(-hypot(y_46_im, y_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[Log[1 + N[(Exp[N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision] * N[(x$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] + N[(x$46$re * N[(N[(y$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] / (-N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}\right)\right), \frac{x.im}{\mathsf{hypot}\left(y.re, y.im\right)}, x.re \cdot \frac{\frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)}}{-\mathsf{hypot}\left(y.im, y.re\right)}\right)
\end{array}
Initial program 58.3%
fma-neg58.3%
distribute-rgt-neg-out58.3%
+-commutative58.3%
fma-define58.3%
Simplified58.3%
distribute-rgt-neg-out58.3%
fma-neg58.3%
fma-undefine58.3%
+-commutative58.3%
div-sub57.4%
*-commutative57.4%
add-sqr-sqrt57.4%
times-frac57.0%
fma-neg57.0%
hypot-define57.0%
hypot-define72.3%
associate-/l*77.8%
add-sqr-sqrt77.8%
pow277.8%
Applied egg-rr77.8%
*-un-lft-identity77.8%
unpow277.8%
times-frac95.2%
Applied egg-rr95.2%
associate-*l/95.2%
*-lft-identity95.2%
hypot-undefine77.8%
unpow277.8%
unpow277.8%
+-commutative77.8%
unpow277.8%
unpow277.8%
hypot-define95.2%
hypot-undefine77.8%
unpow277.8%
unpow277.8%
+-commutative77.8%
unpow277.8%
unpow277.8%
hypot-define95.2%
Simplified95.2%
log1p-expm1-u95.2%
Applied egg-rr95.2%
Final simplification95.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(*
(/ (- x.im (* y.im (/ x.re y.re))) (hypot y.im y.re))
(/ y.re (hypot y.im y.re)))))
(if (<= y.re -4e+20)
t_0
(if (<= y.re -2.4e-115)
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(* (/ y.im (pow (hypot y.re y.im) 2.0)) (- x.re)))
(if (<= y.re 9.5e-53) (/ (- (* x.im (/ y.re y.im)) x.re) y.im) t_0)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im - (y_46_im * (x_46_re / y_46_re))) / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re));
double tmp;
if (y_46_re <= -4e+20) {
tmp = t_0;
} else if (y_46_re <= -2.4e-115) {
tmp = fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), ((y_46_im / pow(hypot(y_46_re, y_46_im), 2.0)) * -x_46_re));
} else if (y_46_re <= 9.5e-53) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = t_0;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / hypot(y_46_im, y_46_re)) * Float64(y_46_re / hypot(y_46_im, y_46_re))) tmp = 0.0 if (y_46_re <= -4e+20) tmp = t_0; elseif (y_46_re <= -2.4e-115) tmp = fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(y_46_im / (hypot(y_46_re, y_46_im) ^ 2.0)) * Float64(-x_46_re))); elseif (y_46_re <= 9.5e-53) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); 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[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -4e+20], t$95$0, If[LessEqual[y$46$re, -2.4e-115], 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[(N[(y$46$im / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * (-x$46$re)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.5e-53], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - y.im \cdot \frac{x.re}{y.re}}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{if}\;y.re \leq -4 \cdot 10^{+20}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -2.4 \cdot 10^{-115}:\\
\;\;\;\;\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{y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \cdot \left(-x.re\right)\right)\\
\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{-53}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -4e20 or 9.5000000000000008e-53 < y.re Initial program 45.5%
fma-neg45.5%
distribute-rgt-neg-out45.5%
+-commutative45.5%
fma-define45.5%
Simplified45.5%
Taylor expanded in y.re around inf 45.5%
mul-1-neg45.5%
unsub-neg45.5%
*-commutative45.5%
associate-/l*45.5%
Simplified45.5%
*-commutative45.5%
add-sqr-sqrt45.5%
fma-undefine45.5%
hypot-undefine45.5%
fma-undefine45.5%
hypot-undefine45.5%
times-frac96.6%
Applied egg-rr96.6%
if -4e20 < y.re < -2.40000000000000021e-115Initial program 87.6%
fma-neg87.6%
distribute-rgt-neg-out87.6%
+-commutative87.6%
fma-define87.6%
Simplified87.6%
distribute-rgt-neg-out87.6%
fma-neg87.6%
fma-undefine87.6%
+-commutative87.6%
div-sub87.6%
*-commutative87.6%
add-sqr-sqrt87.6%
times-frac87.7%
fma-neg87.7%
hypot-define87.7%
hypot-define87.7%
associate-/l*93.7%
add-sqr-sqrt93.7%
pow293.7%
Applied egg-rr93.7%
if -2.40000000000000021e-115 < y.re < 9.5000000000000008e-53Initial program 65.2%
fma-neg65.2%
distribute-rgt-neg-out65.2%
+-commutative65.2%
fma-define65.2%
Simplified65.2%
distribute-rgt-neg-out65.2%
fma-neg65.2%
fma-undefine65.2%
+-commutative65.2%
div-sub62.8%
*-commutative62.8%
add-sqr-sqrt62.8%
times-frac57.9%
fma-neg57.9%
hypot-define57.9%
hypot-define59.9%
associate-/l*65.4%
add-sqr-sqrt65.4%
pow265.4%
Applied egg-rr65.4%
Taylor expanded in y.im around inf 91.4%
associate-/l*91.9%
Simplified91.9%
Final simplification94.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (fma (/ y.re (hypot y.re y.im)) (/ x.im (hypot y.re y.im)) (* x.re (/ (/ y.im (hypot y.im y.re)) (- (hypot y.im y.re))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return 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 / hypot(y_46_im, y_46_re)) / -hypot(y_46_im, y_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return 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(Float64(y_46_im / hypot(y_46_im, y_46_re)) / Float64(-hypot(y_46_im, y_46_re))))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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 * N[(N[(y$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] / (-N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\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)}, x.re \cdot \frac{\frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)}}{-\mathsf{hypot}\left(y.im, y.re\right)}\right)
\end{array}
Initial program 58.3%
fma-neg58.3%
distribute-rgt-neg-out58.3%
+-commutative58.3%
fma-define58.3%
Simplified58.3%
distribute-rgt-neg-out58.3%
fma-neg58.3%
fma-undefine58.3%
+-commutative58.3%
div-sub57.4%
*-commutative57.4%
add-sqr-sqrt57.4%
times-frac57.0%
fma-neg57.0%
hypot-define57.0%
hypot-define72.3%
associate-/l*77.8%
add-sqr-sqrt77.8%
pow277.8%
Applied egg-rr77.8%
*-un-lft-identity77.8%
unpow277.8%
times-frac95.2%
Applied egg-rr95.2%
associate-*l/95.2%
*-lft-identity95.2%
hypot-undefine77.8%
unpow277.8%
unpow277.8%
+-commutative77.8%
unpow277.8%
unpow277.8%
hypot-define95.2%
hypot-undefine77.8%
unpow277.8%
unpow277.8%
+-commutative77.8%
unpow277.8%
unpow277.8%
hypot-define95.2%
Simplified95.2%
Final simplification95.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.re -3.4e-115) (not (<= y.re 9e-53)))
(*
(/ (- x.im (* y.im (/ x.re y.re))) (hypot y.im y.re))
(/ y.re (hypot y.im 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 <= -3.4e-115) || !(y_46_re <= 9e-53)) {
tmp = ((x_46_im - (y_46_im * (x_46_re / y_46_re))) / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, y_46_re));
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -3.4e-115) || !(y_46_re <= 9e-53)) {
tmp = ((x_46_im - (y_46_im * (x_46_re / y_46_re))) / Math.hypot(y_46_im, y_46_re)) * (y_46_re / Math.hypot(y_46_im, 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 <= -3.4e-115) or not (y_46_re <= 9e-53): tmp = ((x_46_im - (y_46_im * (x_46_re / y_46_re))) / math.hypot(y_46_im, y_46_re)) * (y_46_re / math.hypot(y_46_im, 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 <= -3.4e-115) || !(y_46_re <= 9e-53)) tmp = Float64(Float64(Float64(x_46_im - Float64(y_46_im * Float64(x_46_re / y_46_re))) / hypot(y_46_im, y_46_re)) * Float64(y_46_re / hypot(y_46_im, 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 <= -3.4e-115) || ~((y_46_re <= 9e-53))) tmp = ((x_46_im - (y_46_im * (x_46_re / y_46_re))) / hypot(y_46_im, y_46_re)) * (y_46_re / hypot(y_46_im, 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, -3.4e-115], N[Not[LessEqual[y$46$re, 9e-53]], $MachinePrecision]], N[(N[(N[(x$46$im - N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{-115} \lor \neg \left(y.re \leq 9 \cdot 10^{-53}\right):\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -3.3999999999999998e-115 or 8.9999999999999997e-53 < y.re Initial program 54.1%
fma-neg54.1%
distribute-rgt-neg-out54.1%
+-commutative54.1%
fma-define54.1%
Simplified54.1%
Taylor expanded in y.re around inf 54.0%
mul-1-neg54.0%
unsub-neg54.0%
*-commutative54.0%
associate-/l*52.2%
Simplified52.2%
*-commutative52.2%
add-sqr-sqrt52.2%
fma-undefine52.2%
hypot-undefine52.2%
fma-undefine52.2%
hypot-undefine52.2%
times-frac93.0%
Applied egg-rr93.0%
if -3.3999999999999998e-115 < y.re < 8.9999999999999997e-53Initial program 65.2%
fma-neg65.2%
distribute-rgt-neg-out65.2%
+-commutative65.2%
fma-define65.2%
Simplified65.2%
distribute-rgt-neg-out65.2%
fma-neg65.2%
fma-undefine65.2%
+-commutative65.2%
div-sub62.8%
*-commutative62.8%
add-sqr-sqrt62.8%
times-frac57.9%
fma-neg57.9%
hypot-define57.9%
hypot-define59.9%
associate-/l*65.4%
add-sqr-sqrt65.4%
pow265.4%
Applied egg-rr65.4%
Taylor expanded in y.im around inf 91.4%
associate-/l*91.9%
Simplified91.9%
Final simplification92.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 -3.9e+85)
(/ (- x.im (* y.im (/ x.re y.re))) y.re)
(if (<= y.re -2.7e-114)
t_0
(if (<= y.re 1.2e-52)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.re 1.4e+89)
t_0
(/ (- x.im (* x.re (/ y.im y.re))) y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double 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 <= -3.9e+85) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else if (y_46_re <= -2.7e-114) {
tmp = t_0;
} else if (y_46_re <= 1.2e-52) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.4e+89) {
tmp = t_0;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46re <= (-3.9d+85)) then
tmp = (x_46im - (y_46im * (x_46re / y_46re))) / y_46re
else if (y_46re <= (-2.7d-114)) then
tmp = t_0
else if (y_46re <= 1.2d-52) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else if (y_46re <= 1.4d+89) then
tmp = t_0
else
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double 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 <= -3.9e+85) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else if (y_46_re <= -2.7e-114) {
tmp = t_0;
} else if (y_46_re <= 1.2e-52) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.4e+89) {
tmp = t_0;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): 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 <= -3.9e+85: tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re elif y_46_re <= -2.7e-114: tmp = t_0 elif y_46_re <= 1.2e-52: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im elif y_46_re <= 1.4e+89: tmp = t_0 else: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) 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 <= -3.9e+85) 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.7e-114) tmp = t_0; elseif (y_46_re <= 1.2e-52) 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.4e+89) tmp = t_0; else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) 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 <= -3.9e+85) tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re; elseif (y_46_re <= -2.7e-114) tmp = t_0; elseif (y_46_re <= 1.2e-52) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_re <= 1.4e+89) tmp = t_0; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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, -3.9e+85], 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.7e-114], t$95$0, If[LessEqual[y$46$re, 1.2e-52], 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.4e+89], t$95$0, N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
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 -3.9 \cdot 10^{+85}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq -2.7 \cdot 10^{-114}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{-52}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.4 \cdot 10^{+89}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -3.90000000000000033e85Initial program 38.7%
fma-neg38.7%
distribute-rgt-neg-out38.7%
+-commutative38.7%
fma-define38.7%
Simplified38.7%
Taylor expanded in y.re around inf 69.5%
mul-1-neg69.5%
unsub-neg69.5%
*-commutative69.5%
associate-/l*87.2%
Simplified87.2%
if -3.90000000000000033e85 < y.re < -2.7e-114 or 1.2000000000000001e-52 < y.re < 1.3999999999999999e89Initial program 80.3%
if -2.7e-114 < y.re < 1.2000000000000001e-52Initial program 65.2%
fma-neg65.2%
distribute-rgt-neg-out65.2%
+-commutative65.2%
fma-define65.2%
Simplified65.2%
distribute-rgt-neg-out65.2%
fma-neg65.2%
fma-undefine65.2%
+-commutative65.2%
div-sub62.8%
*-commutative62.8%
add-sqr-sqrt62.8%
times-frac57.9%
fma-neg57.9%
hypot-define57.9%
hypot-define59.9%
associate-/l*65.4%
add-sqr-sqrt65.4%
pow265.4%
Applied egg-rr65.4%
Taylor expanded in y.im around inf 91.4%
associate-/l*91.9%
Simplified91.9%
if 1.3999999999999999e89 < y.re Initial program 20.6%
fma-neg20.6%
distribute-rgt-neg-out20.6%
+-commutative20.6%
fma-define20.6%
Simplified20.6%
Taylor expanded in y.re around inf 82.7%
associate-*r/82.7%
neg-mul-182.7%
distribute-lft-neg-in82.7%
Simplified82.7%
associate-/l*90.4%
add-sqr-sqrt45.5%
sqrt-unprod72.1%
sqr-neg72.1%
sqrt-unprod37.1%
add-sqr-sqrt82.6%
cancel-sign-sub82.6%
add-sqr-sqrt45.5%
sqrt-unprod74.8%
sqr-neg74.8%
sqrt-unprod44.8%
add-sqr-sqrt90.4%
Applied egg-rr90.4%
Final simplification87.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1550000.0) (not (<= y.re 3.7e-47))) (/ (- 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 <= -1550000.0) || !(y_46_re <= 3.7e-47)) {
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 <= (-1550000.0d0)) .or. (.not. (y_46re <= 3.7d-47))) 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 <= -1550000.0) || !(y_46_re <= 3.7e-47)) {
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 <= -1550000.0) or not (y_46_re <= 3.7e-47): 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 <= -1550000.0) || !(y_46_re <= 3.7e-47)) 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 <= -1550000.0) || ~((y_46_re <= 3.7e-47))) 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, -1550000.0], N[Not[LessEqual[y$46$re, 3.7e-47]], $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 -1550000 \lor \neg \left(y.re \leq 3.7 \cdot 10^{-47}\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 < -1.55e6 or 3.7e-47 < y.re Initial program 47.6%
fma-neg47.6%
distribute-rgt-neg-out47.6%
+-commutative47.6%
fma-define47.6%
Simplified47.6%
Taylor expanded in y.re around inf 68.7%
mul-1-neg68.7%
unsub-neg68.7%
*-commutative68.7%
associate-/l*77.0%
Simplified77.0%
if -1.55e6 < y.re < 3.7e-47Initial program 69.6%
fma-neg69.6%
distribute-rgt-neg-out69.6%
+-commutative69.6%
fma-define69.6%
Simplified69.6%
distribute-rgt-neg-out69.6%
fma-neg69.6%
fma-undefine69.6%
+-commutative69.6%
div-sub67.7%
*-commutative67.7%
add-sqr-sqrt67.7%
times-frac63.8%
fma-neg63.8%
hypot-define63.8%
hypot-define65.4%
associate-/l*71.3%
add-sqr-sqrt71.3%
pow271.3%
Applied egg-rr71.3%
Taylor expanded in y.im around inf 86.3%
associate-/l*86.7%
Simplified86.7%
Final simplification81.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.1e-87) (not (<= y.re 1.55e-52))) (/ (- x.im (* x.re (/ y.im 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 <= -3.1e-87) || !(y_46_re <= 1.55e-52)) {
tmp = (x_46_im - (x_46_re * (y_46_im / 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 <= (-3.1d-87)) .or. (.not. (y_46re <= 1.55d-52))) then
tmp = (x_46im - (x_46re * (y_46im / 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 <= -3.1e-87) || !(y_46_re <= 1.55e-52)) {
tmp = (x_46_im - (x_46_re * (y_46_im / 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 <= -3.1e-87) or not (y_46_re <= 1.55e-52): tmp = (x_46_im - (x_46_re * (y_46_im / 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 <= -3.1e-87) || !(y_46_re <= 1.55e-52)) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / 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 <= -3.1e-87) || ~((y_46_re <= 1.55e-52))) tmp = (x_46_im - (x_46_re * (y_46_im / 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, -3.1e-87], N[Not[LessEqual[y$46$re, 1.55e-52]], $MachinePrecision]], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / 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 -3.1 \cdot 10^{-87} \lor \neg \left(y.re \leq 1.55 \cdot 10^{-52}\right):\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -3.09999999999999998e-87 or 1.5499999999999999e-52 < y.re Initial program 52.0%
fma-neg52.0%
distribute-rgt-neg-out52.0%
+-commutative52.0%
fma-define52.0%
Simplified52.0%
Taylor expanded in y.re around inf 65.4%
associate-*r/65.4%
neg-mul-165.4%
distribute-lft-neg-in65.4%
Simplified65.4%
associate-/l*72.7%
add-sqr-sqrt30.8%
sqrt-unprod45.5%
sqr-neg45.5%
sqrt-unprod30.9%
add-sqr-sqrt54.5%
cancel-sign-sub54.5%
add-sqr-sqrt23.6%
sqrt-unprod48.9%
sqr-neg48.9%
sqrt-unprod41.8%
add-sqr-sqrt72.7%
Applied egg-rr72.7%
if -3.09999999999999998e-87 < y.re < 1.5499999999999999e-52Initial program 67.2%
fma-neg67.2%
distribute-rgt-neg-out67.2%
+-commutative67.2%
fma-define67.2%
Simplified67.2%
Taylor expanded in y.re around 0 73.2%
associate-*r/73.2%
neg-mul-173.2%
Simplified73.2%
Final simplification72.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -1.6e-90)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.re 1.8e-52)
(/ 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 <= -1.6e-90) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_re <= 1.8e-52) {
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 <= (-1.6d-90)) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else if (y_46re <= 1.8d-52) 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 <= -1.6e-90) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_re <= 1.8e-52) {
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 <= -1.6e-90: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re elif y_46_re <= 1.8e-52: 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 <= -1.6e-90) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_re <= 1.8e-52) 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 <= -1.6e-90) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; elseif (y_46_re <= 1.8e-52) 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, -1.6e-90], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 1.8e-52], 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 -1.6 \cdot 10^{-90}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 1.8 \cdot 10^{-52}:\\
\;\;\;\;\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 < -1.60000000000000004e-90Initial program 56.7%
fma-neg56.7%
distribute-rgt-neg-out56.7%
+-commutative56.7%
fma-define56.7%
Simplified56.7%
Taylor expanded in y.re around inf 62.5%
associate-*r/62.5%
neg-mul-162.5%
distribute-lft-neg-in62.5%
Simplified62.5%
associate-/l*72.4%
add-sqr-sqrt27.9%
sqrt-unprod41.4%
sqr-neg41.4%
sqrt-unprod33.1%
add-sqr-sqrt52.6%
cancel-sign-sub52.6%
add-sqr-sqrt19.5%
sqrt-unprod44.2%
sqr-neg44.2%
sqrt-unprod44.4%
add-sqr-sqrt72.4%
Applied egg-rr72.4%
if -1.60000000000000004e-90 < y.re < 1.79999999999999994e-52Initial program 67.2%
fma-neg67.2%
distribute-rgt-neg-out67.2%
+-commutative67.2%
fma-define67.2%
Simplified67.2%
Taylor expanded in y.re around 0 73.2%
associate-*r/73.2%
neg-mul-173.2%
Simplified73.2%
if 1.79999999999999994e-52 < y.re Initial program 46.5%
fma-neg46.5%
distribute-rgt-neg-out46.5%
+-commutative46.5%
fma-define46.5%
Simplified46.5%
Taylor expanded in y.re around inf 68.8%
mul-1-neg68.8%
unsub-neg68.8%
*-commutative68.8%
associate-/l*73.0%
Simplified73.0%
Final simplification72.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.02e-10) (not (<= y.re 4.5e+84))) (/ 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 <= -1.02e-10) || !(y_46_re <= 4.5e+84)) {
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 <= (-1.02d-10)) .or. (.not. (y_46re <= 4.5d+84))) 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 <= -1.02e-10) || !(y_46_re <= 4.5e+84)) {
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 <= -1.02e-10) or not (y_46_re <= 4.5e+84): 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 <= -1.02e-10) || !(y_46_re <= 4.5e+84)) 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 <= -1.02e-10) || ~((y_46_re <= 4.5e+84))) 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, -1.02e-10], N[Not[LessEqual[y$46$re, 4.5e+84]], $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.02 \cdot 10^{-10} \lor \neg \left(y.re \leq 4.5 \cdot 10^{+84}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{-y.im}\\
\end{array}
\end{array}
if y.re < -1.01999999999999997e-10 or 4.4999999999999997e84 < y.re Initial program 39.3%
fma-neg39.3%
distribute-rgt-neg-out39.3%
+-commutative39.3%
fma-define39.3%
Simplified39.3%
Taylor expanded in y.re around inf 70.4%
if -1.01999999999999997e-10 < y.re < 4.4999999999999997e84Initial program 70.9%
fma-neg70.9%
distribute-rgt-neg-out70.9%
+-commutative70.9%
fma-define70.9%
Simplified70.9%
Taylor expanded in y.re around 0 60.9%
associate-*r/60.9%
neg-mul-160.9%
Simplified60.9%
Final simplification64.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im 1.65e+112) (/ 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 <= 1.65e+112) {
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 <= 1.65d+112) 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 <= 1.65e+112) {
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 <= 1.65e+112: 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 <= 1.65e+112) 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 <= 1.65e+112) 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, 1.65e+112], 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 1.65 \cdot 10^{+112}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < 1.64999999999999995e112Initial program 62.7%
fma-neg62.7%
distribute-rgt-neg-out62.7%
+-commutative62.7%
fma-define62.7%
Simplified62.7%
Taylor expanded in y.re around inf 45.1%
if 1.64999999999999995e112 < y.im Initial program 40.9%
fma-neg40.9%
distribute-rgt-neg-out40.9%
+-commutative40.9%
fma-define40.9%
Simplified40.9%
Taylor expanded in y.re around 0 79.8%
associate-*r/79.8%
neg-mul-179.8%
Simplified79.8%
neg-sub079.8%
sub-neg79.8%
add-sqr-sqrt31.7%
sqrt-unprod50.5%
sqr-neg50.5%
sqrt-unprod18.8%
add-sqr-sqrt31.8%
Applied egg-rr31.8%
+-lft-identity31.8%
Simplified31.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 58.3%
fma-neg58.3%
distribute-rgt-neg-out58.3%
+-commutative58.3%
fma-define58.3%
Simplified58.3%
Taylor expanded in y.re around inf 38.3%
herbie shell --seed 2024141
(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))))