
(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
(let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
(if (<= y.im -8.4e+79)
(/ (* (/ (- y.im) (hypot y.re y.im)) x.re) (hypot y.re y.im))
(if (<= y.im -5.1e-93)
(/ t_0 (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 2.3e-153)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 8e+131)
(/ t_0 (pow (hypot y.re y.im) 2.0))
(/ (- (* 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 t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if (y_46_im <= -8.4e+79) {
tmp = ((-y_46_im / hypot(y_46_re, y_46_im)) * x_46_re) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -5.1e-93) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 2.3e-153) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 8e+131) {
tmp = t_0 / pow(hypot(y_46_re, y_46_im), 2.0);
} 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 t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if (y_46_im <= -8.4e+79) {
tmp = ((-y_46_im / Math.hypot(y_46_re, y_46_im)) * x_46_re) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_im <= -5.1e-93) {
tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 2.3e-153) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 8e+131) {
tmp = t_0 / Math.pow(Math.hypot(y_46_re, y_46_im), 2.0);
} 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): t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re) tmp = 0 if y_46_im <= -8.4e+79: tmp = ((-y_46_im / math.hypot(y_46_re, y_46_im)) * x_46_re) / math.hypot(y_46_re, y_46_im) elif y_46_im <= -5.1e-93: tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_im <= 2.3e-153: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_im <= 8e+131: tmp = t_0 / math.pow(math.hypot(y_46_re, y_46_im), 2.0) 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) t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (y_46_im <= -8.4e+79) tmp = Float64(Float64(Float64(Float64(-y_46_im) / hypot(y_46_re, y_46_im)) * x_46_re) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -5.1e-93) tmp = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 2.3e-153) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 8e+131) tmp = Float64(t_0 / (hypot(y_46_re, y_46_im) ^ 2.0)); 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) t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re); tmp = 0.0; if (y_46_im <= -8.4e+79) tmp = ((-y_46_im / hypot(y_46_re, y_46_im)) * x_46_re) / hypot(y_46_re, y_46_im); elseif (y_46_im <= -5.1e-93) tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_im <= 2.3e-153) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_im <= 8e+131) tmp = t_0 / (hypot(y_46_re, y_46_im) ^ 2.0); 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_] := Block[{t$95$0 = N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -8.4e+79], N[(N[(N[((-y$46$im) / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -5.1e-93], N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.3e-153], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 8e+131], N[(t$95$0 / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $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}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;y.im \leq -8.4 \cdot 10^{+79}:\\
\;\;\;\;\frac{\frac{-y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -5.1 \cdot 10^{-93}:\\
\;\;\;\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 2.3 \cdot 10^{-153}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 8 \cdot 10^{+131}:\\
\;\;\;\;\frac{t\_0}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -8.40000000000000032e79Initial program 41.3%
Taylor expanded in x.im around 0 41.5%
*-commutative41.5%
associate-/l*47.4%
associate-*r*47.4%
*-commutative47.4%
associate-*r/47.4%
mul-1-neg47.4%
rem-square-sqrt47.4%
+-commutative47.4%
unpow247.4%
unpow247.4%
hypot-undefine47.4%
+-commutative47.4%
unpow247.4%
unpow247.4%
hypot-undefine47.4%
unpow247.4%
Simplified47.4%
neg-mul-147.4%
unpow247.4%
times-frac90.1%
hypot-undefine47.4%
+-commutative47.4%
hypot-undefine90.1%
hypot-undefine47.4%
+-commutative47.4%
hypot-undefine90.1%
Applied egg-rr90.1%
*-commutative90.1%
associate-*l/90.1%
associate-*l/92.8%
associate-*r/92.8%
associate-*l/92.6%
frac-2neg92.6%
metadata-eval92.6%
associate-*l/92.8%
*-un-lft-identity92.8%
Applied egg-rr92.8%
if -8.40000000000000032e79 < y.im < -5.10000000000000023e-93Initial program 77.5%
if -5.10000000000000023e-93 < y.im < 2.29999999999999997e-153Initial program 68.8%
Taylor expanded in y.re around inf 93.0%
mul-1-neg93.0%
unsub-neg93.0%
unsub-neg93.0%
remove-double-neg93.0%
mul-1-neg93.0%
neg-mul-193.0%
mul-1-neg93.0%
distribute-lft-in93.0%
distribute-lft-in93.0%
neg-mul-193.0%
mul-1-neg93.0%
remove-double-neg93.0%
associate-*r/93.0%
associate-*r*93.0%
neg-mul-193.0%
Simplified93.0%
if 2.29999999999999997e-153 < y.im < 7.9999999999999993e131Initial program 80.3%
add-sqr-sqrt80.3%
pow280.3%
hypot-define80.3%
Applied egg-rr80.3%
if 7.9999999999999993e131 < y.im Initial program 21.4%
Taylor expanded in y.re around 0 73.5%
+-commutative73.5%
mul-1-neg73.5%
unsub-neg73.5%
unpow273.5%
associate-/r*78.9%
div-sub78.9%
*-commutative78.9%
associate-/l*84.3%
Simplified84.3%
Taylor expanded in y.re around 0 78.9%
associate-*r/84.3%
Simplified84.3%
Final simplification86.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -9.2e+79)
(/ (* (/ (- y.im) (hypot y.re y.im)) x.re) (hypot y.re y.im))
(if (<= y.im -1.42e-95)
t_0
(if (<= y.im 2e-153)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 2.35e+132)
t_0
(/ (- (* 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 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_im <= -9.2e+79) {
tmp = ((-y_46_im / hypot(y_46_re, y_46_im)) * x_46_re) / hypot(y_46_re, y_46_im);
} else if (y_46_im <= -1.42e-95) {
tmp = t_0;
} else if (y_46_im <= 2e-153) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 2.35e+132) {
tmp = t_0;
} 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 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_im <= -9.2e+79) {
tmp = ((-y_46_im / Math.hypot(y_46_re, y_46_im)) * x_46_re) / Math.hypot(y_46_re, y_46_im);
} else if (y_46_im <= -1.42e-95) {
tmp = t_0;
} else if (y_46_im <= 2e-153) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 2.35e+132) {
tmp = t_0;
} 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): 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_im <= -9.2e+79: tmp = ((-y_46_im / math.hypot(y_46_re, y_46_im)) * x_46_re) / math.hypot(y_46_re, y_46_im) elif y_46_im <= -1.42e-95: tmp = t_0 elif y_46_im <= 2e-153: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_im <= 2.35e+132: tmp = t_0 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) 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_im <= -9.2e+79) tmp = Float64(Float64(Float64(Float64(-y_46_im) / hypot(y_46_re, y_46_im)) * x_46_re) / hypot(y_46_re, y_46_im)); elseif (y_46_im <= -1.42e-95) tmp = t_0; elseif (y_46_im <= 2e-153) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 2.35e+132) tmp = t_0; 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) 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_im <= -9.2e+79) tmp = ((-y_46_im / hypot(y_46_re, y_46_im)) * x_46_re) / hypot(y_46_re, y_46_im); elseif (y_46_im <= -1.42e-95) tmp = t_0; elseif (y_46_im <= 2e-153) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_im <= 2.35e+132) tmp = t_0; 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_] := 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$im, -9.2e+79], N[(N[(N[((-y$46$im) / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * x$46$re), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.42e-95], t$95$0, If[LessEqual[y$46$im, 2e-153], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 2.35e+132], t$95$0, 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}
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.im \leq -9.2 \cdot 10^{+79}:\\
\;\;\;\;\frac{\frac{-y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -1.42 \cdot 10^{-95}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2 \cdot 10^{-153}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 2.35 \cdot 10^{+132}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -9.2000000000000002e79Initial program 41.3%
Taylor expanded in x.im around 0 41.5%
*-commutative41.5%
associate-/l*47.4%
associate-*r*47.4%
*-commutative47.4%
associate-*r/47.4%
mul-1-neg47.4%
rem-square-sqrt47.4%
+-commutative47.4%
unpow247.4%
unpow247.4%
hypot-undefine47.4%
+-commutative47.4%
unpow247.4%
unpow247.4%
hypot-undefine47.4%
unpow247.4%
Simplified47.4%
neg-mul-147.4%
unpow247.4%
times-frac90.1%
hypot-undefine47.4%
+-commutative47.4%
hypot-undefine90.1%
hypot-undefine47.4%
+-commutative47.4%
hypot-undefine90.1%
Applied egg-rr90.1%
*-commutative90.1%
associate-*l/90.1%
associate-*l/92.8%
associate-*r/92.8%
associate-*l/92.6%
frac-2neg92.6%
metadata-eval92.6%
associate-*l/92.8%
*-un-lft-identity92.8%
Applied egg-rr92.8%
if -9.2000000000000002e79 < y.im < -1.42000000000000007e-95 or 2.00000000000000008e-153 < y.im < 2.35e132Initial program 79.1%
if -1.42000000000000007e-95 < y.im < 2.00000000000000008e-153Initial program 68.8%
Taylor expanded in y.re around inf 93.0%
mul-1-neg93.0%
unsub-neg93.0%
unsub-neg93.0%
remove-double-neg93.0%
mul-1-neg93.0%
neg-mul-193.0%
mul-1-neg93.0%
distribute-lft-in93.0%
distribute-lft-in93.0%
neg-mul-193.0%
mul-1-neg93.0%
remove-double-neg93.0%
associate-*r/93.0%
associate-*r*93.0%
neg-mul-193.0%
Simplified93.0%
if 2.35e132 < y.im Initial program 21.4%
Taylor expanded in y.re around 0 73.5%
+-commutative73.5%
mul-1-neg73.5%
unsub-neg73.5%
unpow273.5%
associate-/r*78.9%
div-sub78.9%
*-commutative78.9%
associate-/l*84.3%
Simplified84.3%
Taylor expanded in y.re around 0 78.9%
associate-*r/84.3%
Simplified84.3%
Final simplification86.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
(if (<= y.re -112000000000.0)
t_0
(if (<= y.re 1.95e-47)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.re 1.4e+91)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im 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 - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -112000000000.0) {
tmp = t_0;
} else if (y_46_re <= 1.95e-47) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.4e+91) {
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 = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
if (y_46re <= (-112000000000.0d0)) then
tmp = t_0
else if (y_46re <= 1.95d-47) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else if (y_46re <= 1.4d+91) then
tmp = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
double tmp;
if (y_46_re <= -112000000000.0) {
tmp = t_0;
} else if (y_46_re <= 1.95e-47) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_re <= 1.4e+91) {
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 = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re tmp = 0 if y_46_re <= -112000000000.0: tmp = t_0 elif y_46_re <= 1.95e-47: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im elif y_46_re <= 1.4e+91: 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 = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re) tmp = 0.0 if (y_46_re <= -112000000000.0) tmp = t_0; elseif (y_46_re <= 1.95e-47) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_re <= 1.4e+91) 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 = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; tmp = 0.0; if (y_46_re <= -112000000000.0) tmp = t_0; elseif (y_46_re <= 1.95e-47) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_re <= 1.4e+91) 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 = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(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, -112000000000.0], t$95$0, If[LessEqual[y$46$re, 1.95e-47], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.4e+91], 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], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -112000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-47}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 1.4 \cdot 10^{+91}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -1.12e11 or 1.3999999999999999e91 < y.re Initial program 42.3%
Taylor expanded in y.re around inf 78.2%
mul-1-neg78.2%
unsub-neg78.2%
associate-/l*81.1%
Simplified81.1%
if -1.12e11 < y.re < 1.94999999999999989e-47Initial program 71.0%
Taylor expanded in y.re around 0 78.4%
+-commutative78.4%
mul-1-neg78.4%
unsub-neg78.4%
unpow278.4%
associate-/r*82.8%
div-sub85.3%
*-commutative85.3%
associate-/l*85.3%
Simplified85.3%
if 1.94999999999999989e-47 < y.re < 1.3999999999999999e91Initial program 96.4%
Final simplification84.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4e-50) (not (<= y.im 9.8e+92))) (/ 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 <= -4e-50) || !(y_46_im <= 9.8e+92)) {
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 <= (-4d-50)) .or. (.not. (y_46im <= 9.8d+92))) 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 <= -4e-50) || !(y_46_im <= 9.8e+92)) {
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 <= -4e-50) or not (y_46_im <= 9.8e+92): 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 <= -4e-50) || !(y_46_im <= 9.8e+92)) 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 <= -4e-50) || ~((y_46_im <= 9.8e+92))) 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, -4e-50], N[Not[LessEqual[y$46$im, 9.8e+92]], $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 -4 \cdot 10^{-50} \lor \neg \left(y.im \leq 9.8 \cdot 10^{+92}\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 < -4.00000000000000003e-50 or 9.8000000000000003e92 < y.im Initial program 47.6%
Taylor expanded in y.re around 0 73.1%
associate-*r/73.1%
neg-mul-173.1%
Simplified73.1%
if -4.00000000000000003e-50 < y.im < 9.8000000000000003e92Initial program 72.6%
Taylor expanded in y.re around inf 80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*80.8%
Simplified80.8%
Final simplification77.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -4300000000.0) (not (<= y.re 2.1e-27))) (/ (- x.im (* x.re (/ y.im 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 <= -4300000000.0) || !(y_46_re <= 2.1e-27)) {
tmp = (x_46_im - (x_46_re * (y_46_im / 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 <= (-4300000000.0d0)) .or. (.not. (y_46re <= 2.1d-27))) then
tmp = (x_46im - (x_46re * (y_46im / 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 <= -4300000000.0) || !(y_46_re <= 2.1e-27)) {
tmp = (x_46_im - (x_46_re * (y_46_im / 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 <= -4300000000.0) or not (y_46_re <= 2.1e-27): tmp = (x_46_im - (x_46_re * (y_46_im / 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 <= -4300000000.0) || !(y_46_re <= 2.1e-27)) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / 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 <= -4300000000.0) || ~((y_46_re <= 2.1e-27))) tmp = (x_46_im - (x_46_re * (y_46_im / 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, -4300000000.0], N[Not[LessEqual[y$46$re, 2.1e-27]], $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[(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 -4300000000 \lor \neg \left(y.re \leq 2.1 \cdot 10^{-27}\right):\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{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 < -4.3e9 or 2.10000000000000015e-27 < y.re Initial program 52.2%
Taylor expanded in y.re around inf 77.0%
mul-1-neg77.0%
unsub-neg77.0%
associate-/l*79.1%
Simplified79.1%
if -4.3e9 < y.re < 2.10000000000000015e-27Initial program 71.4%
Taylor expanded in y.re around 0 77.9%
+-commutative77.9%
mul-1-neg77.9%
unsub-neg77.9%
unpow277.9%
associate-/r*82.3%
div-sub84.8%
*-commutative84.8%
associate-/l*84.8%
Simplified84.8%
Taylor expanded in y.re around 0 84.8%
associate-*r/84.1%
Simplified84.1%
Final simplification81.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1e-91)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.im 82000000.0)
(/ (- x.im (* x.re (/ y.im 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_im <= -1e-91) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 82000000.0) {
tmp = (x_46_im - (x_46_re * (y_46_im / 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_46im <= (-1d-91)) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else if (y_46im <= 82000000.0d0) then
tmp = (x_46im - (x_46re * (y_46im / 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_im <= -1e-91) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 82000000.0) {
tmp = (x_46_im - (x_46_re * (y_46_im / 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_im <= -1e-91: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= 82000000.0: tmp = (x_46_im - (x_46_re * (y_46_im / 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_im <= -1e-91) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= 82000000.0) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / 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_im <= -1e-91) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= 82000000.0) tmp = (x_46_im - (x_46_re * (y_46_im / 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[LessEqual[y$46$im, -1e-91], 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$im, 82000000.0], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / 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.im \leq -1 \cdot 10^{-91}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 82000000:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{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.im < -1.00000000000000002e-91Initial program 59.2%
Taylor expanded in y.re around 0 75.8%
+-commutative75.8%
mul-1-neg75.8%
unsub-neg75.8%
unpow275.8%
associate-/r*77.0%
div-sub77.0%
*-commutative77.0%
associate-/l*77.1%
Simplified77.1%
Taylor expanded in y.re around 0 77.0%
associate-*r/77.2%
Simplified77.2%
if -1.00000000000000002e-91 < y.im < 8.2e7Initial program 73.1%
Taylor expanded in y.re around inf 88.3%
mul-1-neg88.3%
unsub-neg88.3%
associate-/l*87.5%
Simplified87.5%
if 8.2e7 < y.im Initial program 40.5%
Taylor expanded in y.re around 0 69.4%
+-commutative69.4%
mul-1-neg69.4%
unsub-neg69.4%
unpow269.4%
associate-/r*72.8%
div-sub72.8%
*-commutative72.8%
associate-/l*76.4%
Simplified76.4%
Final simplification81.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -2.25e-92)
(/ (- (* x.im (/ y.re y.im)) x.re) y.im)
(if (<= y.im 420000000.0)
(/ (- 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_im <= -2.25e-92) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 420000000.0) {
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_46im <= (-2.25d-92)) then
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
else if (y_46im <= 420000000.0d0) 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_im <= -2.25e-92) {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 420000000.0) {
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_im <= -2.25e-92: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= 420000000.0: 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_im <= -2.25e-92) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= 420000000.0) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * 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_im <= -2.25e-92) tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= 420000000.0) 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[LessEqual[y$46$im, -2.25e-92], 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$im, 420000000.0], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $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.im \leq -2.25 \cdot 10^{-92}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 420000000:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot 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.im < -2.25e-92Initial program 59.2%
Taylor expanded in y.re around 0 75.8%
+-commutative75.8%
mul-1-neg75.8%
unsub-neg75.8%
unpow275.8%
associate-/r*77.0%
div-sub77.0%
*-commutative77.0%
associate-/l*77.1%
Simplified77.1%
Taylor expanded in y.re around 0 77.0%
associate-*r/77.2%
Simplified77.2%
if -2.25e-92 < y.im < 4.2e8Initial program 73.1%
Taylor expanded in y.re around inf 88.3%
mul-1-neg88.3%
unsub-neg88.3%
unsub-neg88.3%
remove-double-neg88.3%
mul-1-neg88.3%
neg-mul-188.3%
mul-1-neg88.3%
distribute-lft-in88.3%
distribute-lft-in88.3%
neg-mul-188.3%
mul-1-neg88.3%
remove-double-neg88.3%
associate-*r/88.3%
associate-*r*88.3%
neg-mul-188.3%
Simplified88.3%
if 4.2e8 < y.im Initial program 40.5%
Taylor expanded in y.re around 0 69.4%
+-commutative69.4%
mul-1-neg69.4%
unsub-neg69.4%
unpow269.4%
associate-/r*72.8%
div-sub72.8%
*-commutative72.8%
associate-/l*76.4%
Simplified76.4%
Final simplification82.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.9e-50) (not (<= y.im 7500000000.0))) (/ 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 <= -3.9e-50) || !(y_46_im <= 7500000000.0)) {
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 <= (-3.9d-50)) .or. (.not. (y_46im <= 7500000000.0d0))) 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 <= -3.9e-50) || !(y_46_im <= 7500000000.0)) {
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 <= -3.9e-50) or not (y_46_im <= 7500000000.0): 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 <= -3.9e-50) || !(y_46_im <= 7500000000.0)) 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 <= -3.9e-50) || ~((y_46_im <= 7500000000.0))) 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, -3.9e-50], N[Not[LessEqual[y$46$im, 7500000000.0]], $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 -3.9 \cdot 10^{-50} \lor \neg \left(y.im \leq 7500000000\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -3.90000000000000021e-50 or 7.5e9 < y.im Initial program 50.3%
Taylor expanded in y.re around 0 69.3%
associate-*r/69.3%
neg-mul-169.3%
Simplified69.3%
if -3.90000000000000021e-50 < y.im < 7.5e9Initial program 72.7%
Taylor expanded in y.re around inf 71.3%
Final simplification70.3%
(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 61.7%
Taylor expanded in y.re around inf 46.1%
Final simplification46.1%
herbie shell --seed 2024100
(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))))