
(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 12 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 (/ 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 59.1%
div-sub57.2%
*-commutative57.2%
fma-define57.2%
add-sqr-sqrt57.2%
times-frac61.4%
fma-neg61.4%
fma-define61.4%
hypot-define61.4%
fma-define61.4%
hypot-define76.0%
associate-/l*78.9%
fma-define78.9%
add-sqr-sqrt78.9%
pow278.9%
Applied egg-rr78.9%
add-sqr-sqrt39.6%
sqrt-prod54.7%
*-un-lft-identity54.7%
sqr-neg54.7%
sqrt-unprod28.7%
add-sqr-sqrt56.6%
unpow256.6%
times-frac58.3%
hypot-undefine56.6%
+-commutative56.6%
hypot-undefine58.3%
add-sqr-sqrt29.9%
sqrt-unprod58.5%
sqr-neg58.5%
sqrt-prod48.4%
add-sqr-sqrt95.4%
hypot-undefine79.0%
+-commutative79.0%
hypot-undefine95.4%
Applied egg-rr95.4%
associate-*l/95.4%
*-lft-identity95.4%
Simplified95.4%
Final simplification95.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -1.25e+103) (not (<= y.im 6.4e+115)))
(*
(/ y.im (hypot y.im y.re))
(/ (- (* y.re (/ x.im y.im)) x.re) (hypot y.im y.re)))
(fma
(/ y.re (hypot y.re y.im))
(/ x.im (hypot y.re y.im))
(* x.re (/ (- y.im) (pow (hypot y.re y.im) 2.0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.25e+103) || !(y_46_im <= 6.4e+115)) {
tmp = (y_46_im / hypot(y_46_im, y_46_re)) * (((y_46_re * (x_46_im / y_46_im)) - x_46_re) / hypot(y_46_im, y_46_re));
} else {
tmp = 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 / pow(hypot(y_46_re, y_46_im), 2.0))));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.25e+103) || !(y_46_im <= 6.4e+115)) tmp = Float64(Float64(y_46_im / hypot(y_46_im, y_46_re)) * Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / hypot(y_46_im, y_46_re))); else 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(x_46_re * Float64(Float64(-y_46_im) / (hypot(y_46_re, y_46_im) ^ 2.0)))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.25e+103], N[Not[LessEqual[y$46$im, 6.4e+115]], $MachinePrecision]], N[(N[(y$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[((-y$46$im) / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.25 \cdot 10^{+103} \lor \neg \left(y.im \leq 6.4 \cdot 10^{+115}\right):\\
\;\;\;\;\frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re \cdot \frac{x.im}{y.im} - x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\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{-y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)\\
\end{array}
\end{array}
if y.im < -1.25e103 or 6.4e115 < y.im Initial program 36.3%
Taylor expanded in y.im around inf 36.3%
associate-/l*36.3%
Simplified36.3%
*-un-lft-identity36.3%
add-sqr-sqrt36.3%
hypot-undefine36.3%
hypot-undefine36.3%
times-frac60.9%
hypot-undefine36.4%
+-commutative36.4%
hypot-undefine60.9%
fma-neg60.9%
hypot-undefine36.4%
+-commutative36.4%
hypot-undefine60.9%
Applied egg-rr60.9%
associate-*l/61.1%
*-lft-identity61.1%
associate-/l*98.7%
associate-*l/98.7%
fma-neg98.7%
associate-*r/89.0%
*-commutative89.0%
associate-/l*98.7%
Simplified98.7%
if -1.25e103 < y.im < 6.4e115Initial program 69.4%
div-sub66.8%
*-commutative66.8%
fma-define66.8%
add-sqr-sqrt66.8%
times-frac72.7%
fma-neg72.7%
fma-define72.7%
hypot-define72.7%
fma-define72.7%
hypot-define88.4%
associate-/l*90.6%
fma-define90.6%
add-sqr-sqrt90.6%
pow290.6%
Applied egg-rr90.6%
Final simplification93.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -3.6e+91)
(/ (- x.im (/ y.im (/ y.re x.re))) y.re)
(if (<= y.re -1.95e-72)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 2.3e-88)
(/ (- (/ (* y.re x.im) y.im) x.re) y.im)
(if (<= y.re 1e+71)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.im y.im (* y.re y.re)))
(/ (- 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 <= -3.6e+91) {
tmp = (x_46_im - (y_46_im / (y_46_re / x_46_re))) / y_46_re;
} else if (y_46_re <= -1.95e-72) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 2.3e-88) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 1e+71) {
tmp = fma(x_46_im, y_46_re, (y_46_im * -x_46_re)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
} 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 <= -3.6e+91) tmp = Float64(Float64(x_46_im - Float64(y_46_im / Float64(y_46_re / x_46_re))) / y_46_re); elseif (y_46_re <= -1.95e-72) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_re <= 2.3e-88) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 1e+71) tmp = Float64(fma(x_46_im, y_46_re, Float64(y_46_im * Float64(-x_46_re))) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))); 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[y$46$re, -3.6e+91], N[(N[(x$46$im - N[(y$46$im / N[(y$46$re / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -1.95e-72], 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, 2.3e-88], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1e+71], N[(N[(x$46$im * y$46$re + N[(y$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $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}\;y.re \leq -3.6 \cdot 10^{+91}:\\
\;\;\;\;\frac{x.im - \frac{y.im}{\frac{y.re}{x.re}}}{y.re}\\
\mathbf{elif}\;y.re \leq -1.95 \cdot 10^{-72}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 2.3 \cdot 10^{-88}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 10^{+71}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, y.re, y.im \cdot \left(-x.re\right)\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -3.6e91Initial program 44.2%
Taylor expanded in y.re around inf 88.0%
mul-1-neg88.0%
unsub-neg88.0%
associate-/l*90.2%
Simplified90.2%
clear-num90.2%
un-div-inv90.2%
Applied egg-rr90.2%
associate-/r/90.9%
Simplified90.9%
*-commutative90.9%
clear-num90.9%
un-div-inv90.9%
Applied egg-rr90.9%
if -3.6e91 < y.re < -1.95e-72Initial program 89.3%
if -1.95e-72 < y.re < 2.29999999999999986e-88Initial program 64.5%
div-sub59.7%
*-commutative59.7%
fma-define59.7%
add-sqr-sqrt59.7%
times-frac56.9%
fma-neg56.9%
fma-define56.9%
hypot-define56.9%
fma-define56.9%
hypot-define57.9%
associate-/l*65.3%
fma-define65.3%
add-sqr-sqrt65.3%
pow265.3%
Applied egg-rr65.3%
Taylor expanded in y.im around inf 91.4%
if 2.29999999999999986e-88 < y.re < 1e71Initial program 78.7%
fma-neg78.9%
distribute-rgt-neg-out78.9%
+-commutative78.9%
fma-define78.9%
Simplified78.9%
if 1e71 < y.re Initial program 35.8%
Taylor expanded in y.re around inf 79.7%
mul-1-neg79.7%
unsub-neg79.7%
associate-/l*80.9%
Simplified80.9%
clear-num79.9%
un-div-inv79.9%
Applied egg-rr79.9%
associate-/r/81.6%
Simplified81.6%
Final simplification87.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -9e-69) (not (<= y.im 1e-111)))
(*
(/ y.im (hypot y.im y.re))
(/ (- (* y.re (/ x.im y.im)) x.re) (hypot y.im y.re)))
(/ (- 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_im <= -9e-69) || !(y_46_im <= 1e-111)) {
tmp = (y_46_im / hypot(y_46_im, y_46_re)) * (((y_46_re * (x_46_im / y_46_im)) - x_46_re) / hypot(y_46_im, y_46_re));
} else {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -9e-69) || !(y_46_im <= 1e-111)) {
tmp = (y_46_im / Math.hypot(y_46_im, y_46_re)) * (((y_46_re * (x_46_im / y_46_im)) - x_46_re) / Math.hypot(y_46_im, y_46_re));
} 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_im <= -9e-69) or not (y_46_im <= 1e-111): tmp = (y_46_im / math.hypot(y_46_im, y_46_re)) * (((y_46_re * (x_46_im / y_46_im)) - x_46_re) / math.hypot(y_46_im, y_46_re)) 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_im <= -9e-69) || !(y_46_im <= 1e-111)) tmp = Float64(Float64(y_46_im / hypot(y_46_im, y_46_re)) * Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / hypot(y_46_im, y_46_re))); else tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * 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_im <= -9e-69) || ~((y_46_im <= 1e-111))) tmp = (y_46_im / hypot(y_46_im, y_46_re)) * (((y_46_re * (x_46_im / y_46_im)) - x_46_re) / hypot(y_46_im, y_46_re)); 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[Or[LessEqual[y$46$im, -9e-69], N[Not[LessEqual[y$46$im, 1e-111]], $MachinePrecision]], N[(N[(y$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -9 \cdot 10^{-69} \lor \neg \left(y.im \leq 10^{-111}\right):\\
\;\;\;\;\frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.re \cdot \frac{x.im}{y.im} - x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -9.00000000000000019e-69 or 1.00000000000000009e-111 < y.im Initial program 56.6%
Taylor expanded in y.im around inf 56.0%
associate-/l*53.8%
Simplified53.8%
*-un-lft-identity53.8%
add-sqr-sqrt53.8%
hypot-undefine53.8%
hypot-undefine53.8%
times-frac69.1%
hypot-undefine53.8%
+-commutative53.8%
hypot-undefine69.1%
fma-neg69.1%
hypot-undefine53.8%
+-commutative53.8%
hypot-undefine69.1%
Applied egg-rr69.1%
associate-*l/69.3%
*-lft-identity69.3%
associate-/l*89.9%
associate-*l/89.8%
fma-neg89.8%
associate-*r/85.9%
*-commutative85.9%
associate-/l*91.5%
Simplified91.5%
if -9.00000000000000019e-69 < y.im < 1.00000000000000009e-111Initial program 64.2%
div-sub58.6%
*-commutative58.6%
fma-define58.6%
add-sqr-sqrt58.6%
times-frac67.3%
fma-neg67.3%
fma-define67.3%
hypot-define67.3%
fma-define67.3%
hypot-define84.6%
associate-/l*84.6%
fma-define84.6%
add-sqr-sqrt84.6%
pow284.6%
Applied egg-rr84.6%
Taylor expanded in y.re around inf 92.2%
mul-1-neg92.2%
unsub-neg92.2%
*-commutative92.2%
Simplified92.2%
Final simplification91.7%
(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 -2.1e+90)
(/ (- x.im (/ y.im (/ y.re x.re))) y.re)
(if (<= y.re -5.8e-72)
t_0
(if (<= y.re 1.5e-88)
(/ (- (/ (* y.re x.im) y.im) x.re) y.im)
(if (<= y.re 2.2e+70)
t_0
(/ (- 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 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 <= -2.1e+90) {
tmp = (x_46_im - (y_46_im / (y_46_re / x_46_re))) / y_46_re;
} else if (y_46_re <= -5.8e-72) {
tmp = t_0;
} else if (y_46_re <= 1.5e-88) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 2.2e+70) {
tmp = t_0;
} 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) :: 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 <= (-2.1d+90)) then
tmp = (x_46im - (y_46im / (y_46re / x_46re))) / y_46re
else if (y_46re <= (-5.8d-72)) then
tmp = t_0
else if (y_46re <= 1.5d-88) then
tmp = (((y_46re * x_46im) / y_46im) - x_46re) / y_46im
else if (y_46re <= 2.2d+70) then
tmp = t_0
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 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 <= -2.1e+90) {
tmp = (x_46_im - (y_46_im / (y_46_re / x_46_re))) / y_46_re;
} else if (y_46_re <= -5.8e-72) {
tmp = t_0;
} else if (y_46_re <= 1.5e-88) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 2.2e+70) {
tmp = t_0;
} 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): 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 <= -2.1e+90: tmp = (x_46_im - (y_46_im / (y_46_re / x_46_re))) / y_46_re elif y_46_re <= -5.8e-72: tmp = t_0 elif y_46_re <= 1.5e-88: tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im elif y_46_re <= 2.2e+70: tmp = t_0 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) 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 <= -2.1e+90) tmp = Float64(Float64(x_46_im - Float64(y_46_im / Float64(y_46_re / x_46_re))) / y_46_re); elseif (y_46_re <= -5.8e-72) tmp = t_0; elseif (y_46_re <= 1.5e-88) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 2.2e+70) tmp = t_0; 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) 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 <= -2.1e+90) tmp = (x_46_im - (y_46_im / (y_46_re / x_46_re))) / y_46_re; elseif (y_46_re <= -5.8e-72) tmp = t_0; elseif (y_46_re <= 1.5e-88) tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im; elseif (y_46_re <= 2.2e+70) tmp = t_0; 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_] := 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, -2.1e+90], N[(N[(x$46$im - N[(y$46$im / N[(y$46$re / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -5.8e-72], t$95$0, If[LessEqual[y$46$re, 1.5e-88], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.2e+70], t$95$0, 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}
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 -2.1 \cdot 10^{+90}:\\
\;\;\;\;\frac{x.im - \frac{y.im}{\frac{y.re}{x.re}}}{y.re}\\
\mathbf{elif}\;y.re \leq -5.8 \cdot 10^{-72}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.5 \cdot 10^{-88}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 2.2 \cdot 10^{+70}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.re < -2.09999999999999981e90Initial program 44.2%
Taylor expanded in y.re around inf 88.0%
mul-1-neg88.0%
unsub-neg88.0%
associate-/l*90.2%
Simplified90.2%
clear-num90.2%
un-div-inv90.2%
Applied egg-rr90.2%
associate-/r/90.9%
Simplified90.9%
*-commutative90.9%
clear-num90.9%
un-div-inv90.9%
Applied egg-rr90.9%
if -2.09999999999999981e90 < y.re < -5.79999999999999995e-72 or 1.5e-88 < y.re < 2.20000000000000001e70Initial program 84.2%
if -5.79999999999999995e-72 < y.re < 1.5e-88Initial program 64.5%
div-sub59.7%
*-commutative59.7%
fma-define59.7%
add-sqr-sqrt59.7%
times-frac56.9%
fma-neg56.9%
fma-define56.9%
hypot-define56.9%
fma-define56.9%
hypot-define57.9%
associate-/l*65.3%
fma-define65.3%
add-sqr-sqrt65.3%
pow265.3%
Applied egg-rr65.3%
Taylor expanded in y.im around inf 91.4%
if 2.20000000000000001e70 < y.re Initial program 35.8%
Taylor expanded in y.re around inf 79.7%
mul-1-neg79.7%
unsub-neg79.7%
associate-/l*80.9%
Simplified80.9%
clear-num79.9%
un-div-inv79.9%
Applied egg-rr79.9%
associate-/r/81.6%
Simplified81.6%
Final simplification87.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -8e-71) (not (<= y.re 1.02e+107))) (/ (- x.im (* y.im (/ x.re y.re))) y.re) (/ (- (/ (* y.re x.im) 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 <= -8e-71) || !(y_46_re <= 1.02e+107)) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else {
tmp = (((y_46_re * x_46_im) / 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 <= (-8d-71)) .or. (.not. (y_46re <= 1.02d+107))) then
tmp = (x_46im - (y_46im * (x_46re / y_46re))) / y_46re
else
tmp = (((y_46re * x_46im) / 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 <= -8e-71) || !(y_46_re <= 1.02e+107)) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else {
tmp = (((y_46_re * x_46_im) / 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 <= -8e-71) or not (y_46_re <= 1.02e+107): tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re else: tmp = (((y_46_re * x_46_im) / 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 <= -8e-71) || !(y_46_re <= 1.02e+107)) 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(Float64(y_46_re * x_46_im) / 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 <= -8e-71) || ~((y_46_re <= 1.02e+107))) tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re; else tmp = (((y_46_re * x_46_im) / 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, -8e-71], N[Not[LessEqual[y$46$re, 1.02e+107]], $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[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -8 \cdot 10^{-71} \lor \neg \left(y.re \leq 1.02 \cdot 10^{+107}\right):\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -7.9999999999999993e-71 or 1.01999999999999994e107 < y.re Initial program 52.4%
Taylor expanded in y.re around inf 84.7%
mul-1-neg84.7%
unsub-neg84.7%
associate-/l*86.0%
Simplified86.0%
clear-num85.5%
un-div-inv85.6%
Applied egg-rr85.6%
associate-/r/86.6%
Simplified86.6%
if -7.9999999999999993e-71 < y.re < 1.01999999999999994e107Initial program 65.2%
div-sub61.7%
*-commutative61.7%
fma-define61.7%
add-sqr-sqrt61.7%
times-frac62.0%
fma-neg62.0%
fma-define62.0%
hypot-define62.0%
fma-define62.0%
hypot-define63.4%
associate-/l*69.6%
fma-define69.6%
add-sqr-sqrt69.6%
pow269.6%
Applied egg-rr69.6%
Taylor expanded in y.im around inf 80.6%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -8e-71) (not (<= y.re 1.02e+107))) (/ (- x.im (* y.im (/ x.re y.re))) y.re) (/ (- (* y.re (/ x.im 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 <= -8e-71) || !(y_46_re <= 1.02e+107)) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else {
tmp = ((y_46_re * (x_46_im / 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 <= (-8d-71)) .or. (.not. (y_46re <= 1.02d+107))) then
tmp = (x_46im - (y_46im * (x_46re / y_46re))) / y_46re
else
tmp = ((y_46re * (x_46im / 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 <= -8e-71) || !(y_46_re <= 1.02e+107)) {
tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re;
} else {
tmp = ((y_46_re * (x_46_im / 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 <= -8e-71) or not (y_46_re <= 1.02e+107): tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re else: tmp = ((y_46_re * (x_46_im / 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 <= -8e-71) || !(y_46_re <= 1.02e+107)) 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(y_46_re * Float64(x_46_im / 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 <= -8e-71) || ~((y_46_re <= 1.02e+107))) tmp = (x_46_im - (y_46_im * (x_46_re / y_46_re))) / y_46_re; else tmp = ((y_46_re * (x_46_im / 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, -8e-71], N[Not[LessEqual[y$46$re, 1.02e+107]], $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[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -8 \cdot 10^{-71} \lor \neg \left(y.re \leq 1.02 \cdot 10^{+107}\right):\\
\;\;\;\;\frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -7.9999999999999993e-71 or 1.01999999999999994e107 < y.re Initial program 52.4%
Taylor expanded in y.re around inf 84.7%
mul-1-neg84.7%
unsub-neg84.7%
associate-/l*86.0%
Simplified86.0%
clear-num85.5%
un-div-inv85.6%
Applied egg-rr85.6%
associate-/r/86.6%
Simplified86.6%
if -7.9999999999999993e-71 < y.re < 1.01999999999999994e107Initial program 65.2%
div-sub61.7%
*-commutative61.7%
fma-define61.7%
add-sqr-sqrt61.7%
times-frac62.0%
fma-neg62.0%
fma-define62.0%
hypot-define62.0%
fma-define62.0%
hypot-define63.4%
associate-/l*69.6%
fma-define69.6%
add-sqr-sqrt69.6%
pow269.6%
Applied egg-rr69.6%
Taylor expanded in y.im around inf 80.6%
div-sub79.7%
associate-*r/80.5%
div-sub81.4%
associate-*r/80.6%
*-commutative80.6%
associate-/l*79.3%
Simplified79.3%
Final simplification82.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.15e-9) (not (<= y.im 6e+88))) (/ 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_im <= -1.15e-9) || !(y_46_im <= 6e+88)) {
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_46im <= (-1.15d-9)) .or. (.not. (y_46im <= 6d+88))) 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_im <= -1.15e-9) || !(y_46_im <= 6e+88)) {
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_im <= -1.15e-9) or not (y_46_im <= 6e+88): 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_im <= -1.15e-9) || !(y_46_im <= 6e+88)) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * 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_im <= -1.15e-9) || ~((y_46_im <= 6e+88))) 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[Or[LessEqual[y$46$im, -1.15e-9], N[Not[LessEqual[y$46$im, 6e+88]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.15 \cdot 10^{-9} \lor \neg \left(y.im \leq 6 \cdot 10^{+88}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -1.15e-9 or 6.00000000000000011e88 < y.im Initial program 47.4%
Taylor expanded in y.re around 0 72.7%
associate-*r/72.7%
neg-mul-172.7%
Simplified72.7%
if -1.15e-9 < y.im < 6.00000000000000011e88Initial program 67.8%
div-sub64.7%
*-commutative64.7%
fma-define64.7%
add-sqr-sqrt64.7%
times-frac71.0%
fma-neg71.0%
fma-define71.0%
hypot-define71.0%
fma-define71.0%
hypot-define88.0%
associate-/l*88.7%
fma-define88.7%
add-sqr-sqrt88.7%
pow288.7%
Applied egg-rr88.7%
Taylor expanded in y.re around inf 80.8%
mul-1-neg80.8%
unsub-neg80.8%
*-commutative80.8%
Simplified80.8%
Final simplification77.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.75e-8) (not (<= y.im 1.55e+89))) (/ x.re (- y.im)) (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.75e-8) || !(y_46_im <= 1.55e+89)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-1.75d-8)) .or. (.not. (y_46im <= 1.55d+89))) then
tmp = x_46re / -y_46im
else
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.75e-8) || !(y_46_im <= 1.55e+89)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.75e-8) or not (y_46_im <= 1.55e+89): tmp = x_46_re / -y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.75e-8) || !(y_46_im <= 1.55e+89)) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.75e-8) || ~((y_46_im <= 1.55e+89))) tmp = x_46_re / -y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -1.75e-8], N[Not[LessEqual[y$46$im, 1.55e+89]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.75 \cdot 10^{-8} \lor \neg \left(y.im \leq 1.55 \cdot 10^{+89}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -1.75000000000000012e-8 or 1.55e89 < y.im Initial program 47.4%
Taylor expanded in y.re around 0 72.7%
associate-*r/72.7%
neg-mul-172.7%
Simplified72.7%
if -1.75000000000000012e-8 < y.im < 1.55e89Initial program 67.8%
Taylor expanded in y.re around inf 80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*80.6%
Simplified80.6%
Final simplification77.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -7.6e-16) (not (<= y.im 3.1e+63))) (/ 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 <= -7.6e-16) || !(y_46_im <= 3.1e+63)) {
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 <= (-7.6d-16)) .or. (.not. (y_46im <= 3.1d+63))) 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 <= -7.6e-16) || !(y_46_im <= 3.1e+63)) {
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 <= -7.6e-16) or not (y_46_im <= 3.1e+63): 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 <= -7.6e-16) || !(y_46_im <= 3.1e+63)) tmp = Float64(x_46_re / Float64(-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 <= -7.6e-16) || ~((y_46_im <= 3.1e+63))) 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, -7.6e-16], N[Not[LessEqual[y$46$im, 3.1e+63]], $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 -7.6 \cdot 10^{-16} \lor \neg \left(y.im \leq 3.1 \cdot 10^{+63}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -7.60000000000000024e-16 or 3.1000000000000001e63 < y.im Initial program 49.2%
Taylor expanded in y.re around 0 70.1%
associate-*r/70.1%
neg-mul-170.1%
Simplified70.1%
if -7.60000000000000024e-16 < y.im < 3.1000000000000001e63Initial program 67.6%
Taylor expanded in y.re around inf 67.8%
Final simplification68.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4.5e+179) (not (<= y.im 1.45e+161))) (/ 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 <= -4.5e+179) || !(y_46_im <= 1.45e+161)) {
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 <= (-4.5d+179)) .or. (.not. (y_46im <= 1.45d+161))) 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 <= -4.5e+179) || !(y_46_im <= 1.45e+161)) {
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 <= -4.5e+179) or not (y_46_im <= 1.45e+161): 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 <= -4.5e+179) || !(y_46_im <= 1.45e+161)) 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 <= -4.5e+179) || ~((y_46_im <= 1.45e+161))) 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, -4.5e+179], N[Not[LessEqual[y$46$im, 1.45e+161]], $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.5 \cdot 10^{+179} \lor \neg \left(y.im \leq 1.45 \cdot 10^{+161}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -4.5000000000000003e179 or 1.45000000000000008e161 < y.im Initial program 29.9%
Taylor expanded in y.re around 0 83.1%
associate-*r/83.1%
neg-mul-183.1%
Simplified83.1%
neg-sub083.1%
sub-neg83.1%
add-sqr-sqrt51.9%
sqrt-unprod43.2%
sqr-neg43.2%
sqrt-unprod6.8%
add-sqr-sqrt30.7%
Applied egg-rr30.7%
+-lft-identity30.7%
Simplified30.7%
if -4.5000000000000003e179 < y.im < 1.45000000000000008e161Initial program 67.2%
Taylor expanded in y.re around inf 56.0%
Final simplification50.4%
(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 59.1%
Taylor expanded in y.re around inf 46.4%
herbie shell --seed 2024113
(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))))