
(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 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.2e+135)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im 4.8e+159)
(-
(* (/ 1.0 (hypot y.re y.im)) (* x.im (/ y.re (hypot y.re y.im))))
(/ (* y.im x.re) (pow (hypot y.re y.im) 2.0)))
(/ (- (/ y.re (/ y.im x.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 <= -5.2e+135) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 4.8e+159) {
tmp = ((1.0 / hypot(y_46_re, y_46_im)) * (x_46_im * (y_46_re / hypot(y_46_re, y_46_im)))) - ((y_46_im * x_46_re) / pow(hypot(y_46_re, y_46_im), 2.0));
} else {
tmp = ((y_46_re / (y_46_im / x_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_im <= -5.2e+135) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 4.8e+159) {
tmp = ((1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_im * (y_46_re / Math.hypot(y_46_re, y_46_im)))) - ((y_46_im * x_46_re) / Math.pow(Math.hypot(y_46_re, y_46_im), 2.0));
} else {
tmp = ((y_46_re / (y_46_im / x_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 <= -5.2e+135: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= 4.8e+159: tmp = ((1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_im * (y_46_re / math.hypot(y_46_re, y_46_im)))) - ((y_46_im * x_46_re) / math.pow(math.hypot(y_46_re, y_46_im), 2.0)) else: tmp = ((y_46_re / (y_46_im / x_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 <= -5.2e+135) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= 4.8e+159) tmp = Float64(Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_im * Float64(y_46_re / hypot(y_46_re, y_46_im)))) - Float64(Float64(y_46_im * x_46_re) / (hypot(y_46_re, y_46_im) ^ 2.0))); else tmp = Float64(Float64(Float64(y_46_re / Float64(y_46_im / x_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 <= -5.2e+135) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= 4.8e+159) tmp = ((1.0 / hypot(y_46_re, y_46_im)) * (x_46_im * (y_46_re / hypot(y_46_re, y_46_im)))) - ((y_46_im * x_46_re) / (hypot(y_46_re, y_46_im) ^ 2.0)); else tmp = ((y_46_re / (y_46_im / x_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, -5.2e+135], 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$im, 4.8e+159], N[(N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$im * N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y$46$im * x$46$re), $MachinePrecision] / N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.2 \cdot 10^{+135}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 4.8 \cdot 10^{+159}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.im \cdot \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}\right) - \frac{y.im \cdot x.re}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y.re}{\frac{y.im}{x.im}} - x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -5.2e135Initial program 39.2%
Taylor expanded in y.re around 0 85.7%
+-commutative85.7%
mul-1-neg85.7%
unsub-neg85.7%
unpow285.7%
associate-/r*85.9%
div-sub85.9%
*-commutative85.9%
associate-/l*93.3%
Simplified93.3%
if -5.2e135 < y.im < 4.8e159Initial program 71.4%
div-sub67.0%
*-un-lft-identity67.0%
add-sqr-sqrt67.0%
times-frac67.0%
fmm-def67.0%
hypot-define67.0%
hypot-define76.8%
associate-/l*76.4%
add-sqr-sqrt76.4%
pow276.4%
hypot-define76.4%
Applied egg-rr76.4%
fmm-undef75.8%
associate-/l*91.8%
associate-*r/92.2%
*-commutative92.2%
Simplified92.2%
if 4.8e159 < y.im Initial program 35.9%
Taylor expanded in y.re around 0 67.8%
+-commutative67.8%
mul-1-neg67.8%
unsub-neg67.8%
unpow267.8%
associate-/r*75.7%
div-sub75.7%
*-commutative75.7%
associate-/l*87.0%
Simplified87.0%
clear-num87.0%
un-div-inv87.0%
Applied egg-rr87.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re)))
(t_1 (/ t_0 (+ (* y.re y.re) (* y.im y.im)))))
(if (<= t_1 (- INFINITY))
(/ (+ x.im (/ -1.0 (/ y.re (* y.im x.re)))) y.re)
(if (<= t_1 INFINITY)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(/ (- (* 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 t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double t_1 = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_46_re)))) / y_46_re;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = ((y_46_re * (x_46_im / 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 t_1 = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_46_re)))) / y_46_re;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (t_0 / Math.hypot(y_46_re, y_46_im));
} 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): t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re) t_1 = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if t_1 <= -math.inf: tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_46_re)))) / y_46_re elif t_1 <= math.inf: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (t_0 / math.hypot(y_46_re, y_46_im)) 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) t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) t_1 = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x_46_im + Float64(-1.0 / Float64(y_46_re / Float64(y_46_im * x_46_re)))) / y_46_re); elseif (t_1 <= Inf) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(t_0 / hypot(y_46_re, y_46_im))); 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) t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re); t_1 = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (t_1 <= -Inf) tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_46_re)))) / y_46_re; elseif (t_1 <= Inf) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im)); 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_] := Block[{t$95$0 = N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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[t$95$1, (-Infinity)], N[(N[(x$46$im + N[(-1.0 / N[(y$46$re / N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $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}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
t_1 := \frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x.im + \frac{-1}{\frac{y.re}{y.im \cdot x.re}}}{y.re}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < -inf.0Initial program 36.4%
div-sub25.3%
*-un-lft-identity25.3%
add-sqr-sqrt25.3%
times-frac25.3%
fmm-def25.3%
hypot-define25.3%
hypot-define25.3%
associate-/l*41.1%
add-sqr-sqrt41.1%
pow241.1%
hypot-define41.1%
Applied egg-rr41.1%
fmm-undef41.1%
associate-/l*83.3%
associate-*r/67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in y.re around inf 84.1%
mul-1-neg84.1%
unsub-neg84.1%
associate-/l*84.0%
Simplified84.0%
associate-*r/84.1%
clear-num84.1%
*-commutative84.1%
Applied egg-rr84.1%
if -inf.0 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < +inf.0Initial program 83.9%
*-un-lft-identity83.9%
add-sqr-sqrt83.8%
times-frac83.8%
hypot-define83.8%
hypot-define97.5%
Applied egg-rr97.5%
if +inf.0 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 0.0%
Taylor expanded in y.re around 0 42.5%
+-commutative42.5%
mul-1-neg42.5%
unsub-neg42.5%
unpow242.5%
associate-/r*42.9%
div-sub43.0%
*-commutative43.0%
associate-/l*56.7%
Simplified56.7%
Final simplification87.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5e+101)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im -2.9e-71)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 800000000000.0)
(/ (+ x.im (/ -1.0 (/ y.re (* y.im x.re)))) y.re)
(/ (- (/ y.re (/ y.im x.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 <= -5e+101) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= -2.9e-71) {
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_im <= 800000000000.0) {
tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_46_re)))) / y_46_re;
} else {
tmp = ((y_46_re / (y_46_im / x_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 <= (-5d+101)) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else if (y_46im <= (-2.9d-71)) then
tmp = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46im <= 800000000000.0d0) then
tmp = (x_46im + ((-1.0d0) / (y_46re / (y_46im * x_46re)))) / y_46re
else
tmp = ((y_46re / (y_46im / x_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 <= -5e+101) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= -2.9e-71) {
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_im <= 800000000000.0) {
tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_46_re)))) / y_46_re;
} else {
tmp = ((y_46_re / (y_46_im / x_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 <= -5e+101: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= -2.9e-71: 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)) elif y_46_im <= 800000000000.0: tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_46_re)))) / y_46_re else: tmp = ((y_46_re / (y_46_im / x_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 <= -5e+101) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= -2.9e-71) 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_im <= 800000000000.0) tmp = Float64(Float64(x_46_im + Float64(-1.0 / Float64(y_46_re / Float64(y_46_im * x_46_re)))) / y_46_re); else tmp = Float64(Float64(Float64(y_46_re / Float64(y_46_im / x_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 <= -5e+101) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= -2.9e-71) 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)); elseif (y_46_im <= 800000000000.0) tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_46_re)))) / y_46_re; else tmp = ((y_46_re / (y_46_im / x_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, -5e+101], 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$im, -2.9e-71], 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, 800000000000.0], N[(N[(x$46$im + N[(-1.0 / N[(y$46$re / N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5 \cdot 10^{+101}:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -2.9 \cdot 10^{-71}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 800000000000:\\
\;\;\;\;\frac{x.im + \frac{-1}{\frac{y.re}{y.im \cdot x.re}}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y.re}{\frac{y.im}{x.im}} - x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -4.99999999999999989e101Initial program 43.9%
Taylor expanded in y.re around 0 83.7%
+-commutative83.7%
mul-1-neg83.7%
unsub-neg83.7%
unpow283.7%
associate-/r*83.8%
div-sub83.8%
*-commutative83.8%
associate-/l*90.1%
Simplified90.1%
if -4.99999999999999989e101 < y.im < -2.8999999999999999e-71Initial program 77.6%
if -2.8999999999999999e-71 < y.im < 8e11Initial program 72.5%
div-sub65.5%
*-un-lft-identity65.5%
add-sqr-sqrt65.5%
times-frac65.5%
fmm-def65.5%
hypot-define65.5%
hypot-define77.0%
associate-/l*74.5%
add-sqr-sqrt74.5%
pow274.5%
hypot-define74.5%
Applied egg-rr74.5%
fmm-undef73.6%
associate-/l*88.8%
associate-*r/91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in y.re around inf 92.2%
mul-1-neg92.2%
unsub-neg92.2%
associate-/l*90.8%
Simplified90.8%
associate-*r/92.2%
clear-num92.2%
*-commutative92.2%
Applied egg-rr92.2%
if 8e11 < y.im Initial program 45.0%
Taylor expanded in y.re around 0 63.6%
+-commutative63.6%
mul-1-neg63.6%
unsub-neg63.6%
unpow263.6%
associate-/r*68.2%
div-sub68.2%
*-commutative68.2%
associate-/l*74.9%
Simplified74.9%
clear-num74.9%
un-div-inv74.9%
Applied egg-rr74.9%
Final simplification85.8%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.5e-26) (not (<= y.im 105000000.0))) (/ (- (/ y.re (/ y.im x.im)) x.re) y.im) (/ (+ x.im (/ -1.0 (/ y.re (* y.im x.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 <= -2.5e-26) || !(y_46_im <= 105000000.0)) {
tmp = ((y_46_re / (y_46_im / x_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_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 <= (-2.5d-26)) .or. (.not. (y_46im <= 105000000.0d0))) then
tmp = ((y_46re / (y_46im / x_46im)) - x_46re) / y_46im
else
tmp = (x_46im + ((-1.0d0) / (y_46re / (y_46im * x_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 <= -2.5e-26) || !(y_46_im <= 105000000.0)) {
tmp = ((y_46_re / (y_46_im / x_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_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 <= -2.5e-26) or not (y_46_im <= 105000000.0): tmp = ((y_46_re / (y_46_im / x_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_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 <= -2.5e-26) || !(y_46_im <= 105000000.0)) tmp = Float64(Float64(Float64(y_46_re / Float64(y_46_im / x_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im + Float64(-1.0 / Float64(y_46_re / Float64(y_46_im * x_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 <= -2.5e-26) || ~((y_46_im <= 105000000.0))) tmp = ((y_46_re / (y_46_im / x_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im + (-1.0 / (y_46_re / (y_46_im * x_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, -2.5e-26], N[Not[LessEqual[y$46$im, 105000000.0]], $MachinePrecision]], N[(N[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im + N[(-1.0 / N[(y$46$re / N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.5 \cdot 10^{-26} \lor \neg \left(y.im \leq 105000000\right):\\
\;\;\;\;\frac{\frac{y.re}{\frac{y.im}{x.im}} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + \frac{-1}{\frac{y.re}{y.im \cdot x.re}}}{y.re}\\
\end{array}
\end{array}
if y.im < -2.5000000000000001e-26 or 1.05e8 < y.im Initial program 51.7%
Taylor expanded in y.re around 0 69.3%
+-commutative69.3%
mul-1-neg69.3%
unsub-neg69.3%
unpow269.3%
associate-/r*71.4%
div-sub71.4%
*-commutative71.4%
associate-/l*76.5%
Simplified76.5%
clear-num76.5%
un-div-inv76.5%
Applied egg-rr76.5%
if -2.5000000000000001e-26 < y.im < 1.05e8Initial program 72.9%
div-sub66.1%
*-un-lft-identity66.1%
add-sqr-sqrt66.1%
times-frac66.1%
fmm-def66.1%
hypot-define66.1%
hypot-define77.2%
associate-/l*74.8%
add-sqr-sqrt74.8%
pow274.8%
hypot-define74.8%
Applied egg-rr74.8%
fmm-undef73.9%
associate-/l*89.3%
associate-*r/91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in y.re around inf 91.0%
mul-1-neg91.0%
unsub-neg91.0%
associate-/l*89.6%
Simplified89.6%
associate-*r/91.0%
clear-num91.0%
*-commutative91.0%
Applied egg-rr91.0%
Final simplification83.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2e-25) (not (<= y.im 1500000000000.0))) (/ (- (/ y.re (/ y.im x.im)) 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 <= -2e-25) || !(y_46_im <= 1500000000000.0)) {
tmp = ((y_46_re / (y_46_im / x_46_im)) - 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 <= (-2d-25)) .or. (.not. (y_46im <= 1500000000000.0d0))) then
tmp = ((y_46re / (y_46im / x_46im)) - 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 <= -2e-25) || !(y_46_im <= 1500000000000.0)) {
tmp = ((y_46_re / (y_46_im / x_46_im)) - 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 <= -2e-25) or not (y_46_im <= 1500000000000.0): tmp = ((y_46_re / (y_46_im / x_46_im)) - 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 <= -2e-25) || !(y_46_im <= 1500000000000.0)) tmp = Float64(Float64(Float64(y_46_re / Float64(y_46_im / x_46_im)) - x_46_re) / 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 <= -2e-25) || ~((y_46_im <= 1500000000000.0))) tmp = ((y_46_re / (y_46_im / x_46_im)) - 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, -2e-25], N[Not[LessEqual[y$46$im, 1500000000000.0]], $MachinePrecision]], N[(N[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / 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 -2 \cdot 10^{-25} \lor \neg \left(y.im \leq 1500000000000\right):\\
\;\;\;\;\frac{\frac{y.re}{\frac{y.im}{x.im}} - 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 < -2.00000000000000008e-25 or 1.5e12 < y.im Initial program 51.7%
Taylor expanded in y.re around 0 69.3%
+-commutative69.3%
mul-1-neg69.3%
unsub-neg69.3%
unpow269.3%
associate-/r*71.4%
div-sub71.4%
*-commutative71.4%
associate-/l*76.5%
Simplified76.5%
clear-num76.5%
un-div-inv76.5%
Applied egg-rr76.5%
if -2.00000000000000008e-25 < y.im < 1.5e12Initial program 72.9%
div-sub66.1%
*-un-lft-identity66.1%
add-sqr-sqrt66.1%
times-frac66.1%
fmm-def66.1%
hypot-define66.1%
hypot-define77.2%
associate-/l*74.8%
add-sqr-sqrt74.8%
pow274.8%
hypot-define74.8%
Applied egg-rr74.8%
fmm-undef73.9%
associate-/l*89.3%
associate-*r/91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in y.re around inf 91.0%
mul-1-neg91.0%
unsub-neg91.0%
associate-/l*89.6%
Simplified89.6%
Final simplification82.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3e-25) (not (<= y.im 2700000000.0))) (/ (- (* y.re (/ x.im y.im)) 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 <= -3e-25) || !(y_46_im <= 2700000000.0)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - 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 <= (-3d-25)) .or. (.not. (y_46im <= 2700000000.0d0))) then
tmp = ((y_46re * (x_46im / y_46im)) - 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 <= -3e-25) || !(y_46_im <= 2700000000.0)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - 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 <= -3e-25) or not (y_46_im <= 2700000000.0): tmp = ((y_46_re * (x_46_im / y_46_im)) - 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 <= -3e-25) || !(y_46_im <= 2700000000.0)) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / 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 <= -3e-25) || ~((y_46_im <= 2700000000.0))) tmp = ((y_46_re * (x_46_im / y_46_im)) - 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, -3e-25], N[Not[LessEqual[y$46$im, 2700000000.0]], $MachinePrecision]], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / 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 -3 \cdot 10^{-25} \lor \neg \left(y.im \leq 2700000000\right):\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - 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 < -2.9999999999999998e-25 or 2.7e9 < y.im Initial program 51.7%
Taylor expanded in y.re around 0 69.3%
+-commutative69.3%
mul-1-neg69.3%
unsub-neg69.3%
unpow269.3%
associate-/r*71.4%
div-sub71.4%
*-commutative71.4%
associate-/l*76.5%
Simplified76.5%
if -2.9999999999999998e-25 < y.im < 2.7e9Initial program 72.9%
div-sub66.1%
*-un-lft-identity66.1%
add-sqr-sqrt66.1%
times-frac66.1%
fmm-def66.1%
hypot-define66.1%
hypot-define77.2%
associate-/l*74.8%
add-sqr-sqrt74.8%
pow274.8%
hypot-define74.8%
Applied egg-rr74.8%
fmm-undef73.9%
associate-/l*89.3%
associate-*r/91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in y.re around inf 91.0%
mul-1-neg91.0%
unsub-neg91.0%
associate-/l*89.6%
Simplified89.6%
Final simplification82.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.6e+63) (not (<= y.im 1.95e+167))) (/ (- 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 <= -3.6e+63) || !(y_46_im <= 1.95e+167)) {
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 <= (-3.6d+63)) .or. (.not. (y_46im <= 1.95d+167))) 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 <= -3.6e+63) || !(y_46_im <= 1.95e+167)) {
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 <= -3.6e+63) or not (y_46_im <= 1.95e+167): 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 <= -3.6e+63) || !(y_46_im <= 1.95e+167)) tmp = Float64(Float64(-x_46_re) / 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 <= -3.6e+63) || ~((y_46_im <= 1.95e+167))) 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, -3.6e+63], N[Not[LessEqual[y$46$im, 1.95e+167]], $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 -3.6 \cdot 10^{+63} \lor \neg \left(y.im \leq 1.95 \cdot 10^{+167}\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 < -3.59999999999999999e63 or 1.9499999999999999e167 < y.im Initial program 43.4%
Taylor expanded in y.re around 0 81.9%
associate-*r/81.9%
neg-mul-181.9%
Simplified81.9%
if -3.59999999999999999e63 < y.im < 1.9499999999999999e167Initial program 69.9%
div-sub65.3%
*-un-lft-identity65.3%
add-sqr-sqrt65.3%
times-frac65.3%
fmm-def65.3%
hypot-define65.3%
hypot-define75.5%
associate-/l*75.1%
add-sqr-sqrt75.1%
pow275.1%
hypot-define75.1%
Applied egg-rr75.1%
fmm-undef74.5%
associate-/l*89.9%
associate-*r/90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in y.re around inf 75.2%
mul-1-neg75.2%
unsub-neg75.2%
associate-/l*76.5%
Simplified76.5%
Final simplification78.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -6.8e+74) (not (<= y.re 200000.0))) (/ 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 <= -6.8e+74) || !(y_46_re <= 200000.0)) {
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 <= (-6.8d+74)) .or. (.not. (y_46re <= 200000.0d0))) 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 <= -6.8e+74) || !(y_46_re <= 200000.0)) {
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 <= -6.8e+74) or not (y_46_re <= 200000.0): 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 <= -6.8e+74) || !(y_46_re <= 200000.0)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(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_re <= -6.8e+74) || ~((y_46_re <= 200000.0))) 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, -6.8e+74], N[Not[LessEqual[y$46$re, 200000.0]], $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 -6.8 \cdot 10^{+74} \lor \neg \left(y.re \leq 200000\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -6.7999999999999998e74 or 2e5 < y.re Initial program 43.0%
Taylor expanded in y.re around inf 77.0%
if -6.7999999999999998e74 < y.re < 2e5Initial program 76.9%
Taylor expanded in y.re around 0 65.1%
associate-*r/65.1%
neg-mul-165.1%
Simplified65.1%
Final simplification70.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.7e+152) (not (<= y.im 2.15e+206))) (/ 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 <= -1.7e+152) || !(y_46_im <= 2.15e+206)) {
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 <= (-1.7d+152)) .or. (.not. (y_46im <= 2.15d+206))) 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 <= -1.7e+152) || !(y_46_im <= 2.15e+206)) {
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 <= -1.7e+152) or not (y_46_im <= 2.15e+206): 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 <= -1.7e+152) || !(y_46_im <= 2.15e+206)) 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 <= -1.7e+152) || ~((y_46_im <= 2.15e+206))) 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, -1.7e+152], N[Not[LessEqual[y$46$im, 2.15e+206]], $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 -1.7 \cdot 10^{+152} \lor \neg \left(y.im \leq 2.15 \cdot 10^{+206}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.7000000000000001e152 or 2.14999999999999994e206 < y.im Initial program 41.1%
Taylor expanded in y.re around 0 83.1%
+-commutative83.1%
mul-1-neg83.1%
unsub-neg83.1%
unpow283.1%
associate-/r*85.8%
div-sub85.8%
*-commutative85.8%
associate-/l*97.2%
Simplified97.2%
clear-num94.7%
sub-neg94.7%
associate-*r/83.4%
*-commutative83.4%
mul-1-neg83.4%
+-commutative83.4%
inv-pow83.4%
+-commutative83.4%
add-sqr-sqrt54.0%
sqrt-unprod50.3%
mul-1-neg50.3%
mul-1-neg50.3%
sqr-neg50.3%
sqrt-unprod12.0%
add-sqr-sqrt42.2%
*-commutative42.2%
associate-*r/48.7%
fma-define48.7%
Applied egg-rr48.7%
unpow-148.7%
fma-define48.7%
*-commutative48.7%
associate-*l/42.2%
associate-*r/48.6%
fma-undefine48.6%
Simplified48.6%
Taylor expanded in y.im around inf 39.6%
if -1.7000000000000001e152 < y.im < 2.14999999999999994e206Initial program 67.9%
Taylor expanded in y.re around inf 55.4%
Final simplification51.6%
(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.5%
Taylor expanded in y.re around inf 45.5%
herbie shell --seed 2024172
(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))))