
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(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))))))
(t_1 (/ 1.0 (hypot y.re y.im)))
(t_2 (* y.re (/ x.im y.im))))
(if (<= y.im -2.6e+141)
(* t_1 (- x.re t_2))
(if (<= y.im -9.8e-166)
t_0
(if (<= y.im 2.7e-165)
(* (/ -1.0 y.re) (- (* x.re (/ y.im y.re)) x.im))
(if (<= y.im 3.3e+71) t_0 (* t_1 (- t_2 x.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 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))));
double t_1 = 1.0 / hypot(y_46_re, y_46_im);
double t_2 = y_46_re * (x_46_im / y_46_im);
double tmp;
if (y_46_im <= -2.6e+141) {
tmp = t_1 * (x_46_re - t_2);
} else if (y_46_im <= -9.8e-166) {
tmp = t_0;
} else if (y_46_im <= 2.7e-165) {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_im <= 3.3e+71) {
tmp = t_0;
} else {
tmp = t_1 * (t_2 - x_46_re);
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 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(y_46_im / Float64(-(hypot(y_46_re, y_46_im) ^ 2.0))))) t_1 = Float64(1.0 / hypot(y_46_re, y_46_im)) t_2 = Float64(y_46_re * Float64(x_46_im / y_46_im)) tmp = 0.0 if (y_46_im <= -2.6e+141) tmp = Float64(t_1 * Float64(x_46_re - t_2)); elseif (y_46_im <= -9.8e-166) tmp = t_0; elseif (y_46_im <= 2.7e-165) tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(x_46_re * Float64(y_46_im / y_46_re)) - x_46_im)); elseif (y_46_im <= 3.3e+71) tmp = t_0; else tmp = Float64(t_1 * Float64(t_2 - x_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -2.6e+141], N[(t$95$1 * N[(x$46$re - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -9.8e-166], t$95$0, If[LessEqual[y$46$im, 2.7e-165], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[(N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.3e+71], t$95$0, N[(t$95$1 * N[(t$95$2 - x$46$re), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
t_1 := \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_2 := y.re \cdot \frac{x.im}{y.im}\\
\mathbf{if}\;y.im \leq -2.6 \cdot 10^{+141}:\\
\;\;\;\;t\_1 \cdot \left(x.re - t\_2\right)\\
\mathbf{elif}\;y.im \leq -9.8 \cdot 10^{-166}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{-165}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(x.re \cdot \frac{y.im}{y.re} - x.im\right)\\
\mathbf{elif}\;y.im \leq 3.3 \cdot 10^{+71}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_2 - x.re\right)\\
\end{array}
\end{array}
if y.im < -2.5999999999999999e141Initial program 43.5%
*-un-lft-identity43.5%
add-sqr-sqrt43.5%
times-frac43.6%
hypot-define43.6%
fma-neg43.6%
distribute-rgt-neg-in43.6%
hypot-define71.8%
Applied egg-rr71.8%
Taylor expanded in y.im around -inf 86.9%
mul-1-neg86.9%
unsub-neg86.9%
*-commutative86.9%
associate-/l*91.3%
Simplified91.3%
if -2.5999999999999999e141 < y.im < -9.7999999999999998e-166 or 2.6999999999999998e-165 < y.im < 3.2999999999999998e71Initial program 73.8%
div-sub73.8%
*-commutative73.8%
add-sqr-sqrt73.8%
times-frac74.8%
fma-neg74.8%
hypot-define74.8%
hypot-define89.2%
associate-/l*95.3%
add-sqr-sqrt95.3%
pow295.3%
hypot-define95.3%
Applied egg-rr95.3%
distribute-rgt-neg-in95.3%
distribute-neg-frac95.3%
Simplified95.3%
if -9.7999999999999998e-166 < y.im < 2.6999999999999998e-165Initial program 74.7%
*-un-lft-identity74.7%
add-sqr-sqrt74.7%
times-frac74.8%
hypot-define74.8%
fma-neg74.8%
distribute-rgt-neg-in74.8%
hypot-define83.9%
Applied egg-rr83.9%
Taylor expanded in y.re around -inf 49.8%
neg-mul-149.8%
+-commutative49.8%
associate-/l*49.8%
Simplified49.8%
Taylor expanded in y.re around -inf 96.9%
if 3.2999999999999998e71 < y.im Initial program 51.1%
*-un-lft-identity51.1%
add-sqr-sqrt51.1%
times-frac51.1%
hypot-define51.1%
fma-neg51.1%
distribute-rgt-neg-in51.1%
hypot-define67.5%
Applied egg-rr67.5%
Taylor expanded in y.re around 0 87.6%
+-commutative87.6%
mul-1-neg87.6%
unsub-neg87.6%
*-commutative87.6%
associate-/l*95.7%
Simplified95.7%
Final simplification95.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<=
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
5e+302)
(*
(/ 1.0 (hypot y.re y.im))
(/ (fma x.im y.re (* y.im (- x.re))) (hypot y.re y.im)))
(/ (/ x.im (hypot y.im y.re)) (/ (hypot 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_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+302) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (fma(x_46_im, y_46_re, (y_46_im * -x_46_re)) / hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_im / hypot(y_46_im, y_46_re)) / (hypot(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 (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))) <= 5e+302) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(fma(x_46_im, y_46_re, Float64(y_46_im * Float64(-x_46_re))) / hypot(y_46_re, y_46_im))); else tmp = Float64(Float64(x_46_im / hypot(y_46_im, y_46_re)) / Float64(hypot(y_46_im, 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[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], 5e+302], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(x$46$im * y$46$re + N[(y$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im} \leq 5 \cdot 10^{+302}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.im, y.re, y.im \cdot \left(-x.re\right)\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x.im}{\mathsf{hypot}\left(y.im, y.re\right)}}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{y.re}}\\
\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))) < 5e302Initial program 82.1%
*-un-lft-identity82.1%
add-sqr-sqrt82.0%
times-frac82.1%
hypot-define82.1%
fma-neg82.1%
distribute-rgt-neg-in82.1%
hypot-define96.6%
Applied egg-rr96.6%
if 5e302 < (/.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 11.6%
Taylor expanded in x.im around inf 9.6%
associate-/l*20.2%
Simplified20.2%
associate-*r/9.6%
pow29.6%
pow29.6%
+-commutative9.6%
add-sqr-sqrt9.6%
hypot-undefine9.6%
hypot-undefine9.6%
times-frac58.5%
*-commutative58.5%
clear-num58.5%
associate-*l/58.5%
*-un-lft-identity58.5%
hypot-undefine20.2%
+-commutative20.2%
hypot-define58.5%
hypot-undefine20.2%
+-commutative20.2%
hypot-define58.5%
Applied egg-rr58.5%
Final simplification87.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ 1.0 (hypot y.re y.im))) (t_1 (* y.re (/ x.im y.im))))
(if (<= y.im -1.35e+44)
(* t_0 (- x.re t_1))
(if (<= y.im 1.5e-132)
(* (/ -1.0 y.re) (- (* x.re (/ y.im y.re)) x.im))
(if (<= y.im 2.25e+67)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(* t_0 (- t_1 x.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = 1.0 / hypot(y_46_re, y_46_im);
double t_1 = y_46_re * (x_46_im / y_46_im);
double tmp;
if (y_46_im <= -1.35e+44) {
tmp = t_0 * (x_46_re - t_1);
} else if (y_46_im <= 1.5e-132) {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_im <= 2.25e+67) {
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 * (t_1 - x_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 t_0 = 1.0 / Math.hypot(y_46_re, y_46_im);
double t_1 = y_46_re * (x_46_im / y_46_im);
double tmp;
if (y_46_im <= -1.35e+44) {
tmp = t_0 * (x_46_re - t_1);
} else if (y_46_im <= 1.5e-132) {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_im <= 2.25e+67) {
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 * (t_1 - x_46_re);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = 1.0 / math.hypot(y_46_re, y_46_im) t_1 = y_46_re * (x_46_im / y_46_im) tmp = 0 if y_46_im <= -1.35e+44: tmp = t_0 * (x_46_re - t_1) elif y_46_im <= 1.5e-132: tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im) elif y_46_im <= 2.25e+67: 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 * (t_1 - x_46_re) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(1.0 / hypot(y_46_re, y_46_im)) t_1 = Float64(y_46_re * Float64(x_46_im / y_46_im)) tmp = 0.0 if (y_46_im <= -1.35e+44) tmp = Float64(t_0 * Float64(x_46_re - t_1)); elseif (y_46_im <= 1.5e-132) tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(x_46_re * Float64(y_46_im / y_46_re)) - x_46_im)); elseif (y_46_im <= 2.25e+67) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = Float64(t_0 * Float64(t_1 - x_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = 1.0 / hypot(y_46_re, y_46_im); t_1 = y_46_re * (x_46_im / y_46_im); tmp = 0.0; if (y_46_im <= -1.35e+44) tmp = t_0 * (x_46_re - t_1); elseif (y_46_im <= 1.5e-132) tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im); elseif (y_46_im <= 2.25e+67) 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 * (t_1 - x_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[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.35e+44], N[(t$95$0 * N[(x$46$re - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.5e-132], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[(N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.25e+67], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(t$95$1 - x$46$re), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
t_1 := y.re \cdot \frac{x.im}{y.im}\\
\mathbf{if}\;y.im \leq -1.35 \cdot 10^{+44}:\\
\;\;\;\;t\_0 \cdot \left(x.re - t\_1\right)\\
\mathbf{elif}\;y.im \leq 1.5 \cdot 10^{-132}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(x.re \cdot \frac{y.im}{y.re} - x.im\right)\\
\mathbf{elif}\;y.im \leq 2.25 \cdot 10^{+67}:\\
\;\;\;\;\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 \cdot \left(t\_1 - x.re\right)\\
\end{array}
\end{array}
if y.im < -1.35e44Initial program 47.2%
*-un-lft-identity47.2%
add-sqr-sqrt47.2%
times-frac47.2%
hypot-define47.2%
fma-neg47.2%
distribute-rgt-neg-in47.2%
hypot-define67.5%
Applied egg-rr67.5%
Taylor expanded in y.im around -inf 81.5%
mul-1-neg81.5%
unsub-neg81.5%
*-commutative81.5%
associate-/l*86.2%
Simplified86.2%
if -1.35e44 < y.im < 1.5e-132Initial program 76.5%
*-un-lft-identity76.5%
add-sqr-sqrt76.5%
times-frac76.6%
hypot-define76.6%
fma-neg76.6%
distribute-rgt-neg-in76.6%
hypot-define84.2%
Applied egg-rr84.2%
Taylor expanded in y.re around -inf 49.2%
neg-mul-149.2%
+-commutative49.2%
associate-/l*50.1%
Simplified50.1%
Taylor expanded in y.re around -inf 90.3%
if 1.5e-132 < y.im < 2.2499999999999999e67Initial program 80.0%
if 2.2499999999999999e67 < y.im Initial program 50.1%
*-un-lft-identity50.1%
add-sqr-sqrt50.1%
times-frac50.2%
hypot-define50.2%
fma-neg50.2%
distribute-rgt-neg-in50.2%
hypot-define65.7%
Applied egg-rr65.7%
Taylor expanded in y.re around 0 86.5%
+-commutative86.5%
mul-1-neg86.5%
unsub-neg86.5%
*-commutative86.5%
associate-/l*94.1%
Simplified94.1%
Final simplification88.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.05e+45)
(* (/ 1.0 (hypot y.re y.im)) (- x.re (* y.re (/ x.im y.im))))
(if (<= y.im 1.36e-132)
(* (/ -1.0 y.re) (- (* x.re (/ y.im y.re)) x.im))
(if (<= y.im 3.5e+67)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(* (/ 1.0 y.im) (- (* x.im (/ y.re y.im)) x.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.05e+45) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_re - (y_46_re * (x_46_im / y_46_im)));
} else if (y_46_im <= 1.36e-132) {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_im <= 3.5e+67) {
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 = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_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 <= -1.05e+45) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (x_46_re - (y_46_re * (x_46_im / y_46_im)));
} else if (y_46_im <= 1.36e-132) {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_im <= 3.5e+67) {
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 = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_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.05e+45: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (x_46_re - (y_46_re * (x_46_im / y_46_im))) elif y_46_im <= 1.36e-132: tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im) elif y_46_im <= 3.5e+67: 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 = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_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.05e+45) tmp = Float64(Float64(1.0 / hypot(y_46_re, y_46_im)) * Float64(x_46_re - Float64(y_46_re * Float64(x_46_im / y_46_im)))); elseif (y_46_im <= 1.36e-132) tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(x_46_re * Float64(y_46_im / y_46_re)) - x_46_im)); elseif (y_46_im <= 3.5e+67) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(1.0 / y_46_im) * Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_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.05e+45) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (x_46_re - (y_46_re * (x_46_im / y_46_im))); elseif (y_46_im <= 1.36e-132) tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im); elseif (y_46_im <= 3.5e+67) 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 = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_46_re); end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.05e+45], N[(N[(1.0 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re - N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.36e-132], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[(N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.5e+67], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y$46$im), $MachinePrecision] * N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.05 \cdot 10^{+45}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.re - y.re \cdot \frac{x.im}{y.im}\right)\\
\mathbf{elif}\;y.im \leq 1.36 \cdot 10^{-132}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(x.re \cdot \frac{y.im}{y.re} - x.im\right)\\
\mathbf{elif}\;y.im \leq 3.5 \cdot 10^{+67}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y.im} \cdot \left(x.im \cdot \frac{y.re}{y.im} - x.re\right)\\
\end{array}
\end{array}
if y.im < -1.04999999999999997e45Initial program 47.2%
*-un-lft-identity47.2%
add-sqr-sqrt47.2%
times-frac47.2%
hypot-define47.2%
fma-neg47.2%
distribute-rgt-neg-in47.2%
hypot-define67.5%
Applied egg-rr67.5%
Taylor expanded in y.im around -inf 81.5%
mul-1-neg81.5%
unsub-neg81.5%
*-commutative81.5%
associate-/l*86.2%
Simplified86.2%
if -1.04999999999999997e45 < y.im < 1.36000000000000002e-132Initial program 76.5%
*-un-lft-identity76.5%
add-sqr-sqrt76.5%
times-frac76.6%
hypot-define76.6%
fma-neg76.6%
distribute-rgt-neg-in76.6%
hypot-define84.2%
Applied egg-rr84.2%
Taylor expanded in y.re around -inf 49.2%
neg-mul-149.2%
+-commutative49.2%
associate-/l*50.1%
Simplified50.1%
Taylor expanded in y.re around -inf 90.3%
if 1.36000000000000002e-132 < y.im < 3.5e67Initial program 80.0%
if 3.5e67 < y.im Initial program 50.1%
*-un-lft-identity50.1%
add-sqr-sqrt50.1%
times-frac50.2%
hypot-define50.2%
fma-neg50.2%
distribute-rgt-neg-in50.2%
hypot-define65.7%
Applied egg-rr65.7%
Taylor expanded in y.re around 0 86.5%
mul-1-neg86.5%
associate-/l*94.1%
Simplified94.1%
Taylor expanded in y.re around 0 94.0%
Final simplification88.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (* (/ 1.0 y.im) (- (* x.im (/ y.re y.im)) x.re))))
(if (<= y.im -1.35e+45)
t_0
(if (<= y.im 1.55e-132)
(* (/ -1.0 y.re) (- (* x.re (/ y.im y.re)) x.im))
(if (<= y.im 5.5e+67)
(/ (- (* 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 = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_46_re);
double tmp;
if (y_46_im <= -1.35e+45) {
tmp = t_0;
} else if (y_46_im <= 1.55e-132) {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_im <= 5.5e+67) {
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 = (1.0d0 / y_46im) * ((x_46im * (y_46re / y_46im)) - x_46re)
if (y_46im <= (-1.35d+45)) then
tmp = t_0
else if (y_46im <= 1.55d-132) then
tmp = ((-1.0d0) / y_46re) * ((x_46re * (y_46im / y_46re)) - x_46im)
else if (y_46im <= 5.5d+67) 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 = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_46_re);
double tmp;
if (y_46_im <= -1.35e+45) {
tmp = t_0;
} else if (y_46_im <= 1.55e-132) {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
} else if (y_46_im <= 5.5e+67) {
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 = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_46_re) tmp = 0 if y_46_im <= -1.35e+45: tmp = t_0 elif y_46_im <= 1.55e-132: tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im) elif y_46_im <= 5.5e+67: 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(1.0 / y_46_im) * Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re)) tmp = 0.0 if (y_46_im <= -1.35e+45) tmp = t_0; elseif (y_46_im <= 1.55e-132) tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(x_46_re * Float64(y_46_im / y_46_re)) - x_46_im)); elseif (y_46_im <= 5.5e+67) 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 = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_46_re); tmp = 0.0; if (y_46_im <= -1.35e+45) tmp = t_0; elseif (y_46_im <= 1.55e-132) tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im); elseif (y_46_im <= 5.5e+67) 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[(1.0 / y$46$im), $MachinePrecision] * N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.35e+45], t$95$0, If[LessEqual[y$46$im, 1.55e-132], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[(N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.5e+67], 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{1}{y.im} \cdot \left(x.im \cdot \frac{y.re}{y.im} - x.re\right)\\
\mathbf{if}\;y.im \leq -1.35 \cdot 10^{+45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.55 \cdot 10^{-132}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(x.re \cdot \frac{y.im}{y.re} - x.im\right)\\
\mathbf{elif}\;y.im \leq 5.5 \cdot 10^{+67}:\\
\;\;\;\;\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.im < -1.34999999999999992e45 or 5.49999999999999968e67 < y.im Initial program 48.5%
*-un-lft-identity48.5%
add-sqr-sqrt48.5%
times-frac48.5%
hypot-define48.5%
fma-neg48.5%
distribute-rgt-neg-in48.5%
hypot-define66.7%
Applied egg-rr66.7%
Taylor expanded in y.re around 0 53.7%
mul-1-neg53.7%
associate-/l*57.2%
Simplified57.2%
Taylor expanded in y.re around 0 88.8%
if -1.34999999999999992e45 < y.im < 1.55000000000000004e-132Initial program 76.5%
*-un-lft-identity76.5%
add-sqr-sqrt76.5%
times-frac76.6%
hypot-define76.6%
fma-neg76.6%
distribute-rgt-neg-in76.6%
hypot-define84.2%
Applied egg-rr84.2%
Taylor expanded in y.re around -inf 49.2%
neg-mul-149.2%
+-commutative49.2%
associate-/l*50.1%
Simplified50.1%
Taylor expanded in y.re around -inf 90.3%
if 1.55000000000000004e-132 < y.im < 5.49999999999999968e67Initial program 80.0%
Final simplification88.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.6e+102) (not (<= y.im 9.5e+66))) (/ x.re (- y.im)) (* (/ -1.0 y.re) (- (* x.re (/ y.im y.re)) x.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.6e+102) || !(y_46_im <= 9.5e+66)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-1.6d+102)) .or. (.not. (y_46im <= 9.5d+66))) then
tmp = x_46re / -y_46im
else
tmp = ((-1.0d0) / y_46re) * ((x_46re * (y_46im / y_46re)) - x_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.6e+102) || !(y_46_im <= 9.5e+66)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.6e+102) or not (y_46_im <= 9.5e+66): tmp = x_46_re / -y_46_im else: tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.6e+102) || !(y_46_im <= 9.5e+66)) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(x_46_re * Float64(y_46_im / y_46_re)) - x_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.6e+102) || ~((y_46_im <= 9.5e+66))) tmp = x_46_re / -y_46_im; else tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_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$im, -1.6e+102], N[Not[LessEqual[y$46$im, 9.5e+66]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[(N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.6 \cdot 10^{+102} \lor \neg \left(y.im \leq 9.5 \cdot 10^{+66}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(x.re \cdot \frac{y.im}{y.re} - x.im\right)\\
\end{array}
\end{array}
if y.im < -1.6e102 or 9.50000000000000051e66 < y.im Initial program 47.4%
Taylor expanded in y.re around 0 78.5%
associate-*r/78.5%
neg-mul-178.5%
Simplified78.5%
if -1.6e102 < y.im < 9.50000000000000051e66Initial program 76.1%
*-un-lft-identity76.1%
add-sqr-sqrt76.1%
times-frac76.2%
hypot-define76.2%
fma-neg76.2%
distribute-rgt-neg-in76.2%
hypot-define82.5%
Applied egg-rr82.5%
Taylor expanded in y.re around -inf 43.8%
neg-mul-143.8%
+-commutative43.8%
associate-/l*45.1%
Simplified45.1%
Taylor expanded in y.re around -inf 80.3%
Final simplification79.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.3e+46) (not (<= y.im 8e+66))) (* (/ 1.0 y.im) (- (* x.im (/ y.re y.im)) x.re)) (* (/ -1.0 y.re) (- (* x.re (/ y.im y.re)) x.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.3e+46) || !(y_46_im <= 8e+66)) {
tmp = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_46_re);
} else {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-1.3d+46)) .or. (.not. (y_46im <= 8d+66))) then
tmp = (1.0d0 / y_46im) * ((x_46im * (y_46re / y_46im)) - x_46re)
else
tmp = ((-1.0d0) / y_46re) * ((x_46re * (y_46im / y_46re)) - x_46im)
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -1.3e+46) || !(y_46_im <= 8e+66)) {
tmp = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_46_re);
} else {
tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -1.3e+46) or not (y_46_im <= 8e+66): tmp = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_46_re) else: tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -1.3e+46) || !(y_46_im <= 8e+66)) tmp = Float64(Float64(1.0 / y_46_im) * Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re)); else tmp = Float64(Float64(-1.0 / y_46_re) * Float64(Float64(x_46_re * Float64(y_46_im / y_46_re)) - x_46_im)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -1.3e+46) || ~((y_46_im <= 8e+66))) tmp = (1.0 / y_46_im) * ((x_46_im * (y_46_re / y_46_im)) - x_46_re); else tmp = (-1.0 / y_46_re) * ((x_46_re * (y_46_im / y_46_re)) - x_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$im, -1.3e+46], N[Not[LessEqual[y$46$im, 8e+66]], $MachinePrecision]], N[(N[(1.0 / y$46$im), $MachinePrecision] * N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / y$46$re), $MachinePrecision] * N[(N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision] - x$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.3 \cdot 10^{+46} \lor \neg \left(y.im \leq 8 \cdot 10^{+66}\right):\\
\;\;\;\;\frac{1}{y.im} \cdot \left(x.im \cdot \frac{y.re}{y.im} - x.re\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{y.re} \cdot \left(x.re \cdot \frac{y.im}{y.re} - x.im\right)\\
\end{array}
\end{array}
if y.im < -1.30000000000000007e46 or 7.99999999999999956e66 < y.im Initial program 48.5%
*-un-lft-identity48.5%
add-sqr-sqrt48.5%
times-frac48.5%
hypot-define48.5%
fma-neg48.5%
distribute-rgt-neg-in48.5%
hypot-define66.7%
Applied egg-rr66.7%
Taylor expanded in y.re around 0 53.7%
mul-1-neg53.7%
associate-/l*57.2%
Simplified57.2%
Taylor expanded in y.re around 0 88.8%
if -1.30000000000000007e46 < y.im < 7.99999999999999956e66Initial program 77.3%
*-un-lft-identity77.3%
add-sqr-sqrt77.2%
times-frac77.3%
hypot-define77.3%
fma-neg77.3%
distribute-rgt-neg-in77.3%
hypot-define84.0%
Applied egg-rr84.0%
Taylor expanded in y.re around -inf 44.0%
neg-mul-144.0%
+-commutative44.0%
associate-/l*45.4%
Simplified45.4%
Taylor expanded in y.re around -inf 83.0%
Final simplification85.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -8.5e+101) (not (<= y.im 1.8e+60))) (/ 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 <= -8.5e+101) || !(y_46_im <= 1.8e+60)) {
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 <= (-8.5d+101)) .or. (.not. (y_46im <= 1.8d+60))) 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 <= -8.5e+101) || !(y_46_im <= 1.8e+60)) {
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 <= -8.5e+101) or not (y_46_im <= 1.8e+60): 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 <= -8.5e+101) || !(y_46_im <= 1.8e+60)) 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 <= -8.5e+101) || ~((y_46_im <= 1.8e+60))) 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, -8.5e+101], N[Not[LessEqual[y$46$im, 1.8e+60]], $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 -8.5 \cdot 10^{+101} \lor \neg \left(y.im \leq 1.8 \cdot 10^{+60}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -8.5000000000000001e101 or 1.79999999999999984e60 < y.im Initial program 47.9%
Taylor expanded in y.re around 0 77.8%
associate-*r/77.8%
neg-mul-177.8%
Simplified77.8%
if -8.5000000000000001e101 < y.im < 1.79999999999999984e60Initial program 76.0%
Taylor expanded in y.re around inf 65.5%
Final simplification70.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.02e+181) (not (<= y.im 1.05e+106))) (/ 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.02e+181) || !(y_46_im <= 1.05e+106)) {
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.02d+181)) .or. (.not. (y_46im <= 1.05d+106))) 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.02e+181) || !(y_46_im <= 1.05e+106)) {
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.02e+181) or not (y_46_im <= 1.05e+106): 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.02e+181) || !(y_46_im <= 1.05e+106)) 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.02e+181) || ~((y_46_im <= 1.05e+106))) 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.02e+181], N[Not[LessEqual[y$46$im, 1.05e+106]], $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.02 \cdot 10^{+181} \lor \neg \left(y.im \leq 1.05 \cdot 10^{+106}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.01999999999999991e181 or 1.05000000000000002e106 < y.im Initial program 49.0%
*-un-lft-identity49.0%
add-sqr-sqrt49.0%
times-frac49.0%
hypot-define49.0%
fma-neg49.0%
distribute-rgt-neg-in49.0%
hypot-define68.4%
Applied egg-rr68.4%
Taylor expanded in y.im around -inf 53.0%
Taylor expanded in y.re around 0 37.4%
if -1.01999999999999991e181 < y.im < 1.05000000000000002e106Initial program 70.4%
Taylor expanded in y.re around inf 56.6%
Final simplification51.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.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_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_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_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_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_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 64.5%
*-un-lft-identity64.5%
add-sqr-sqrt64.4%
times-frac64.5%
hypot-define64.5%
fma-neg64.5%
distribute-rgt-neg-in64.5%
hypot-define76.3%
Applied egg-rr76.3%
Taylor expanded in y.re around 0 34.1%
mul-1-neg34.1%
associate-/l*35.9%
Simplified35.9%
Taylor expanded in y.re around inf 9.7%
Final simplification9.7%
(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 64.5%
Taylor expanded in y.re around inf 44.9%
Final simplification44.9%
herbie shell --seed 2024048
(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))))