
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im 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_re * y_46_re) + (x_46_im * 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_46re * y_46re) + (x_46im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + Float64(x_46_im * 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_re * y_46_re) + (x_46_im * 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$re * y$46$re), $MachinePrecision] + N[(x$46$im * 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.re \cdot y.re + x.im \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.re y.re) (* x.im 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_re * y_46_re) + (x_46_im * 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_46re * y_46re) + (x_46im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + Float64(x_46_im * 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_re * y_46_re) + (x_46_im * 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$re * y$46$re), $MachinePrecision] + N[(x$46$im * 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.re \cdot y.re + x.im \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 (<=
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
INFINITY)
(/ (/ (fma x.re y.re (* x.im y.im)) (hypot y.re y.im)) (hypot y.re y.im))
(* (/ y.re (hypot y.re y.im)) (/ x.re (hypot y.re y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= ((double) INFINITY)) {
tmp = (fma(x_46_re, y_46_re, (x_46_im * y_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
} else {
tmp = (y_46_re / hypot(y_46_re, y_46_im)) * (x_46_re / hypot(y_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 (Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= Inf) tmp = Float64(Float64(fma(x_46_re, y_46_re, Float64(x_46_im * y_46_im)) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)); else tmp = Float64(Float64(y_46_re / hypot(y_46_re, y_46_im)) * Float64(x_46_re / hypot(y_46_re, y_46_im))); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(x$46$re * y$46$re + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(y$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \leq \infty:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < +inf.0Initial program 78.1%
*-un-lft-identity78.1%
add-sqr-sqrt78.1%
times-frac78.0%
hypot-define78.0%
fma-define78.0%
hypot-define94.8%
Applied egg-rr94.8%
associate-*l/95.0%
*-un-lft-identity95.0%
Applied egg-rr95.0%
if +inf.0 < (/.f64 (+.f64 (*.f64 x.re y.re) (*.f64 x.im y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 0.0%
Taylor expanded in x.re around inf 1.6%
*-commutative1.6%
Simplified1.6%
add-sqr-sqrt1.6%
hypot-undefine1.6%
hypot-undefine1.6%
times-frac53.2%
Applied egg-rr53.2%
Final simplification86.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -1.22e+88)
(+ (/ y.re (* y.im (/ y.im x.re))) (/ x.im y.im))
(if (<= y.im -7e-127)
t_0
(if (<= y.im 2.6e-130)
(+ (/ x.re y.re) (* x.im (/ y.im (pow y.re 2.0))))
(if (<= y.im 7.2e+75)
t_0
(/ (+ x.im (* x.re (/ y.re y.im))) (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.22e+88) {
tmp = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im);
} else if (y_46_im <= -7e-127) {
tmp = t_0;
} else if (y_46_im <= 2.6e-130) {
tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / pow(y_46_re, 2.0)));
} else if (y_46_im <= 7.2e+75) {
tmp = t_0;
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / hypot(y_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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -1.22e+88) {
tmp = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im);
} else if (y_46_im <= -7e-127) {
tmp = t_0;
} else if (y_46_im <= 2.6e-130) {
tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / Math.pow(y_46_re, 2.0)));
} else if (y_46_im <= 7.2e+75) {
tmp = t_0;
} else {
tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / Math.hypot(y_46_re, y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -1.22e+88: tmp = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im) elif y_46_im <= -7e-127: tmp = t_0 elif y_46_im <= 2.6e-130: tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / math.pow(y_46_re, 2.0))) elif y_46_im <= 7.2e+75: tmp = t_0 else: tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / math.hypot(y_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(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -1.22e+88) tmp = Float64(Float64(y_46_re / Float64(y_46_im * Float64(y_46_im / x_46_re))) + Float64(x_46_im / y_46_im)); elseif (y_46_im <= -7e-127) tmp = t_0; elseif (y_46_im <= 2.6e-130) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im * Float64(y_46_im / (y_46_re ^ 2.0)))); elseif (y_46_im <= 7.2e+75) tmp = t_0; else tmp = Float64(Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) / hypot(y_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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -1.22e+88) tmp = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im); elseif (y_46_im <= -7e-127) tmp = t_0; elseif (y_46_im <= 2.6e-130) tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / (y_46_re ^ 2.0))); elseif (y_46_im <= 7.2e+75) tmp = t_0; else tmp = (x_46_im + (x_46_re * (y_46_re / y_46_im))) / hypot(y_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[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $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, -1.22e+88], N[(N[(y$46$re / N[(y$46$im * N[(y$46$im / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -7e-127], t$95$0, If[LessEqual[y$46$im, 2.6e-130], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im * N[(y$46$im / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 7.2e+75], t$95$0, N[(N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -1.22 \cdot 10^{+88}:\\
\;\;\;\;\frac{y.re}{y.im \cdot \frac{y.im}{x.re}} + \frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -7 \cdot 10^{-127}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.6 \cdot 10^{-130}:\\
\;\;\;\;\frac{x.re}{y.re} + x.im \cdot \frac{y.im}{{y.re}^{2}}\\
\mathbf{elif}\;y.im \leq 7.2 \cdot 10^{+75}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im + x.re \cdot \frac{y.re}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -1.22e88Initial program 43.7%
Taylor expanded in y.re around 0 77.5%
+-commutative77.5%
*-commutative77.5%
associate-/l*78.2%
fma-define78.2%
Simplified78.2%
fma-undefine78.2%
pow278.2%
clear-num78.2%
un-div-inv78.2%
pow278.2%
Applied egg-rr78.2%
unpow278.2%
*-un-lft-identity78.2%
times-frac81.9%
Applied egg-rr81.9%
if -1.22e88 < y.im < -6.99999999999999979e-127 or 2.6000000000000001e-130 < y.im < 7.2e75Initial program 82.7%
if -6.99999999999999979e-127 < y.im < 2.6000000000000001e-130Initial program 65.3%
Taylor expanded in y.re around inf 90.1%
associate-/l*90.1%
Simplified90.1%
if 7.2e75 < y.im Initial program 39.0%
*-un-lft-identity39.0%
add-sqr-sqrt39.0%
times-frac39.0%
hypot-define39.0%
fma-define39.0%
hypot-define63.1%
Applied egg-rr63.1%
associate-*l/63.3%
*-un-lft-identity63.3%
Applied egg-rr63.3%
Taylor expanded in y.re around 0 80.8%
associate-/l*83.9%
Simplified83.9%
Final simplification84.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (+ x.im (* x.re (/ y.re y.im)))))
(if (<= y.im -6.6e+88)
(/ t_1 (- (hypot y.re y.im)))
(if (<= y.im -2.4e-129)
t_0
(if (<= y.im 3.2e-136)
(+ (/ x.re y.re) (* x.im (/ y.im (pow y.re 2.0))))
(if (<= y.im 2.2e+74) t_0 (/ t_1 (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = x_46_im + (x_46_re * (y_46_re / y_46_im));
double tmp;
if (y_46_im <= -6.6e+88) {
tmp = t_1 / -hypot(y_46_re, y_46_im);
} else if (y_46_im <= -2.4e-129) {
tmp = t_0;
} else if (y_46_im <= 3.2e-136) {
tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / pow(y_46_re, 2.0)));
} else if (y_46_im <= 2.2e+74) {
tmp = t_0;
} else {
tmp = t_1 / hypot(y_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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = x_46_im + (x_46_re * (y_46_re / y_46_im));
double tmp;
if (y_46_im <= -6.6e+88) {
tmp = t_1 / -Math.hypot(y_46_re, y_46_im);
} else if (y_46_im <= -2.4e-129) {
tmp = t_0;
} else if (y_46_im <= 3.2e-136) {
tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / Math.pow(y_46_re, 2.0)));
} else if (y_46_im <= 2.2e+74) {
tmp = t_0;
} else {
tmp = t_1 / Math.hypot(y_46_re, y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = x_46_im + (x_46_re * (y_46_re / y_46_im)) tmp = 0 if y_46_im <= -6.6e+88: tmp = t_1 / -math.hypot(y_46_re, y_46_im) elif y_46_im <= -2.4e-129: tmp = t_0 elif y_46_im <= 3.2e-136: tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / math.pow(y_46_re, 2.0))) elif y_46_im <= 2.2e+74: tmp = t_0 else: tmp = t_1 / math.hypot(y_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(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(x_46_im + Float64(x_46_re * Float64(y_46_re / y_46_im))) tmp = 0.0 if (y_46_im <= -6.6e+88) tmp = Float64(t_1 / Float64(-hypot(y_46_re, y_46_im))); elseif (y_46_im <= -2.4e-129) tmp = t_0; elseif (y_46_im <= 3.2e-136) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im * Float64(y_46_im / (y_46_re ^ 2.0)))); elseif (y_46_im <= 2.2e+74) tmp = t_0; else tmp = Float64(t_1 / hypot(y_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 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = x_46_im + (x_46_re * (y_46_re / y_46_im)); tmp = 0.0; if (y_46_im <= -6.6e+88) tmp = t_1 / -hypot(y_46_re, y_46_im); elseif (y_46_im <= -2.4e-129) tmp = t_0; elseif (y_46_im <= 3.2e-136) tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / (y_46_re ^ 2.0))); elseif (y_46_im <= 2.2e+74) tmp = t_0; else tmp = t_1 / hypot(y_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[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x$46$im + N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6.6e+88], N[(t$95$1 / (-N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision])), $MachinePrecision], If[LessEqual[y$46$im, -2.4e-129], t$95$0, If[LessEqual[y$46$im, 3.2e-136], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im * N[(y$46$im / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.2e+74], t$95$0, N[(t$95$1 / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := x.im + x.re \cdot \frac{y.re}{y.im}\\
\mathbf{if}\;y.im \leq -6.6 \cdot 10^{+88}:\\
\;\;\;\;\frac{t\_1}{-\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{elif}\;y.im \leq -2.4 \cdot 10^{-129}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 3.2 \cdot 10^{-136}:\\
\;\;\;\;\frac{x.re}{y.re} + x.im \cdot \frac{y.im}{{y.re}^{2}}\\
\mathbf{elif}\;y.im \leq 2.2 \cdot 10^{+74}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\end{array}
\end{array}
if y.im < -6.6000000000000006e88Initial program 43.7%
*-un-lft-identity43.7%
add-sqr-sqrt43.7%
times-frac43.6%
hypot-define43.6%
fma-define43.6%
hypot-define62.4%
Applied egg-rr62.4%
associate-*l/62.5%
*-un-lft-identity62.5%
Applied egg-rr62.5%
Taylor expanded in y.im around -inf 79.8%
distribute-lft-out79.8%
associate-/l*85.6%
Simplified85.6%
if -6.6000000000000006e88 < y.im < -2.39999999999999989e-129 or 3.19999999999999993e-136 < y.im < 2.2000000000000001e74Initial program 82.7%
if -2.39999999999999989e-129 < y.im < 3.19999999999999993e-136Initial program 65.3%
Taylor expanded in y.re around inf 90.1%
associate-/l*90.1%
Simplified90.1%
if 2.2000000000000001e74 < y.im Initial program 39.0%
*-un-lft-identity39.0%
add-sqr-sqrt39.0%
times-frac39.0%
hypot-define39.0%
fma-define39.0%
hypot-define63.1%
Applied egg-rr63.1%
associate-*l/63.3%
*-un-lft-identity63.3%
Applied egg-rr63.3%
Taylor expanded in y.re around 0 80.8%
associate-/l*83.9%
Simplified83.9%
Final simplification85.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (+ (/ y.re (* y.im (/ y.im x.re))) (/ x.im y.im))))
(if (<= y.im -1.4e+89)
t_1
(if (<= y.im -3.4e-131)
t_0
(if (<= y.im 5e-132)
(+ (/ x.re y.re) (* x.im (/ y.im (pow y.re 2.0))))
(if (<= y.im 3.4e+61) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im);
double tmp;
if (y_46_im <= -1.4e+89) {
tmp = t_1;
} else if (y_46_im <= -3.4e-131) {
tmp = t_0;
} else if (y_46_im <= 5e-132) {
tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / pow(y_46_re, 2.0)));
} else if (y_46_im <= 3.4e+61) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (y_46re / (y_46im * (y_46im / x_46re))) + (x_46im / y_46im)
if (y_46im <= (-1.4d+89)) then
tmp = t_1
else if (y_46im <= (-3.4d-131)) then
tmp = t_0
else if (y_46im <= 5d-132) then
tmp = (x_46re / y_46re) + (x_46im * (y_46im / (y_46re ** 2.0d0)))
else if (y_46im <= 3.4d+61) then
tmp = t_0
else
tmp = t_1
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_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im);
double tmp;
if (y_46_im <= -1.4e+89) {
tmp = t_1;
} else if (y_46_im <= -3.4e-131) {
tmp = t_0;
} else if (y_46_im <= 5e-132) {
tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / Math.pow(y_46_re, 2.0)));
} else if (y_46_im <= 3.4e+61) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im) tmp = 0 if y_46_im <= -1.4e+89: tmp = t_1 elif y_46_im <= -3.4e-131: tmp = t_0 elif y_46_im <= 5e-132: tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / math.pow(y_46_re, 2.0))) elif y_46_im <= 3.4e+61: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(y_46_re / Float64(y_46_im * Float64(y_46_im / x_46_re))) + Float64(x_46_im / y_46_im)) tmp = 0.0 if (y_46_im <= -1.4e+89) tmp = t_1; elseif (y_46_im <= -3.4e-131) tmp = t_0; elseif (y_46_im <= 5e-132) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im * Float64(y_46_im / (y_46_re ^ 2.0)))); elseif (y_46_im <= 3.4e+61) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im); tmp = 0.0; if (y_46_im <= -1.4e+89) tmp = t_1; elseif (y_46_im <= -3.4e-131) tmp = t_0; elseif (y_46_im <= 5e-132) tmp = (x_46_re / y_46_re) + (x_46_im * (y_46_im / (y_46_re ^ 2.0))); elseif (y_46_im <= 3.4e+61) tmp = t_0; else tmp = t_1; 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[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y$46$re / N[(y$46$im * N[(y$46$im / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.4e+89], t$95$1, If[LessEqual[y$46$im, -3.4e-131], t$95$0, If[LessEqual[y$46$im, 5e-132], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im * N[(y$46$im / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.4e+61], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{y.re}{y.im \cdot \frac{y.im}{x.re}} + \frac{x.im}{y.im}\\
\mathbf{if}\;y.im \leq -1.4 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -3.4 \cdot 10^{-131}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{-132}:\\
\;\;\;\;\frac{x.re}{y.re} + x.im \cdot \frac{y.im}{{y.re}^{2}}\\
\mathbf{elif}\;y.im \leq 3.4 \cdot 10^{+61}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -1.3999999999999999e89 or 3.40000000000000026e61 < y.im Initial program 42.9%
Taylor expanded in y.re around 0 76.0%
+-commutative76.0%
*-commutative76.0%
associate-/l*78.4%
fma-define78.4%
Simplified78.4%
fma-undefine78.4%
pow278.4%
clear-num78.4%
un-div-inv78.4%
pow278.4%
Applied egg-rr78.4%
unpow278.4%
*-un-lft-identity78.4%
times-frac81.6%
Applied egg-rr81.6%
if -1.3999999999999999e89 < y.im < -3.39999999999999995e-131 or 4.9999999999999999e-132 < y.im < 3.40000000000000026e61Initial program 83.0%
if -3.39999999999999995e-131 < y.im < 4.9999999999999999e-132Initial program 65.3%
Taylor expanded in y.re around inf 90.1%
associate-/l*90.1%
Simplified90.1%
Final simplification84.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
(t_1 (+ (/ y.re (* y.im (/ y.im x.re))) (/ x.im y.im))))
(if (<= y.im -4.1e+89)
t_1
(if (<= y.im -1.25e-232)
t_0
(if (<= y.im 1.4e-136) (/ x.re y.re) (if (<= y.im 2.4e+57) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im);
double tmp;
if (y_46_im <= -4.1e+89) {
tmp = t_1;
} else if (y_46_im <= -1.25e-232) {
tmp = t_0;
} else if (y_46_im <= 1.4e-136) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 2.4e+57) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = (y_46re / (y_46im * (y_46im / x_46re))) + (x_46im / y_46im)
if (y_46im <= (-4.1d+89)) then
tmp = t_1
else if (y_46im <= (-1.25d-232)) then
tmp = t_0
else if (y_46im <= 1.4d-136) then
tmp = x_46re / y_46re
else if (y_46im <= 2.4d+57) then
tmp = t_0
else
tmp = t_1
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_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double t_1 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im);
double tmp;
if (y_46_im <= -4.1e+89) {
tmp = t_1;
} else if (y_46_im <= -1.25e-232) {
tmp = t_0;
} else if (y_46_im <= 1.4e-136) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 2.4e+57) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) t_1 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im) tmp = 0 if y_46_im <= -4.1e+89: tmp = t_1 elif y_46_im <= -1.25e-232: tmp = t_0 elif y_46_im <= 1.4e-136: tmp = x_46_re / y_46_re elif y_46_im <= 2.4e+57: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(y_46_re / Float64(y_46_im * Float64(y_46_im / x_46_re))) + Float64(x_46_im / y_46_im)) tmp = 0.0 if (y_46_im <= -4.1e+89) tmp = t_1; elseif (y_46_im <= -1.25e-232) tmp = t_0; elseif (y_46_im <= 1.4e-136) tmp = Float64(x_46_re / y_46_re); elseif (y_46_im <= 2.4e+57) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); t_1 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im); tmp = 0.0; if (y_46_im <= -4.1e+89) tmp = t_1; elseif (y_46_im <= -1.25e-232) tmp = t_0; elseif (y_46_im <= 1.4e-136) tmp = x_46_re / y_46_re; elseif (y_46_im <= 2.4e+57) tmp = t_0; else tmp = t_1; 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[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y$46$re / N[(y$46$im * N[(y$46$im / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -4.1e+89], t$95$1, If[LessEqual[y$46$im, -1.25e-232], t$95$0, If[LessEqual[y$46$im, 1.4e-136], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 2.4e+57], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{y.re}{y.im \cdot \frac{y.im}{x.re}} + \frac{x.im}{y.im}\\
\mathbf{if}\;y.im \leq -4.1 \cdot 10^{+89}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -1.25 \cdot 10^{-232}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 1.4 \cdot 10^{-136}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.im \leq 2.4 \cdot 10^{+57}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -4.09999999999999985e89 or 2.40000000000000005e57 < y.im Initial program 42.9%
Taylor expanded in y.re around 0 76.0%
+-commutative76.0%
*-commutative76.0%
associate-/l*78.4%
fma-define78.4%
Simplified78.4%
fma-undefine78.4%
pow278.4%
clear-num78.4%
un-div-inv78.4%
pow278.4%
Applied egg-rr78.4%
unpow278.4%
*-un-lft-identity78.4%
times-frac81.6%
Applied egg-rr81.6%
if -4.09999999999999985e89 < y.im < -1.25e-232 or 1.4e-136 < y.im < 2.40000000000000005e57Initial program 81.4%
if -1.25e-232 < y.im < 1.4e-136Initial program 62.2%
Taylor expanded in y.re around inf 86.3%
Final simplification82.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (* x.im y.im) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -3.2e+88)
(/ x.im y.im)
(if (<= y.im -2.4e-179)
t_0
(if (<= y.im 7.6e-124)
(/ x.re y.re)
(if (<= y.im 2.3e+51) t_0 (/ x.im y.im)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -3.2e+88) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -2.4e-179) {
tmp = t_0;
} else if (y_46_im <= 7.6e-124) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 2.3e+51) {
tmp = t_0;
} else {
tmp = x_46_im / 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) :: t_0
real(8) :: tmp
t_0 = (x_46im * y_46im) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46im <= (-3.2d+88)) then
tmp = x_46im / y_46im
else if (y_46im <= (-2.4d-179)) then
tmp = t_0
else if (y_46im <= 7.6d-124) then
tmp = x_46re / y_46re
else if (y_46im <= 2.3d+51) then
tmp = t_0
else
tmp = x_46im / 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 t_0 = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -3.2e+88) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -2.4e-179) {
tmp = t_0;
} else if (y_46_im <= 7.6e-124) {
tmp = x_46_re / y_46_re;
} else if (y_46_im <= 2.3e+51) {
tmp = t_0;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -3.2e+88: tmp = x_46_im / y_46_im elif y_46_im <= -2.4e-179: tmp = t_0 elif y_46_im <= 7.6e-124: tmp = x_46_re / y_46_re elif y_46_im <= 2.3e+51: tmp = t_0 else: tmp = x_46_im / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im * y_46_im) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -3.2e+88) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -2.4e-179) tmp = t_0; elseif (y_46_im <= 7.6e-124) tmp = Float64(x_46_re / y_46_re); elseif (y_46_im <= 2.3e+51) tmp = t_0; else tmp = Float64(x_46_im / 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 = (x_46_im * y_46_im) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -3.2e+88) tmp = x_46_im / y_46_im; elseif (y_46_im <= -2.4e-179) tmp = t_0; elseif (y_46_im <= 7.6e-124) tmp = x_46_re / y_46_re; elseif (y_46_im <= 2.3e+51) tmp = t_0; else tmp = x_46_im / 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[(x$46$im * y$46$im), $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, -3.2e+88], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -2.4e-179], t$95$0, If[LessEqual[y$46$im, 7.6e-124], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 2.3e+51], t$95$0, N[(x$46$im / y$46$im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -3.2 \cdot 10^{+88}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -2.4 \cdot 10^{-179}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 7.6 \cdot 10^{-124}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.im \leq 2.3 \cdot 10^{+51}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -3.1999999999999999e88 or 2.30000000000000005e51 < y.im Initial program 43.1%
Taylor expanded in y.re around 0 72.3%
if -3.1999999999999999e88 < y.im < -2.4e-179 or 7.60000000000000025e-124 < y.im < 2.30000000000000005e51Initial program 84.2%
Taylor expanded in x.re around 0 56.4%
if -2.4e-179 < y.im < 7.60000000000000025e-124Initial program 64.6%
Taylor expanded in y.re around inf 80.1%
Final simplification68.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (/ y.re (* y.im (/ y.im x.re))) (/ x.im y.im))))
(if (<= y.re -5.5e+86)
(/ x.re y.re)
(if (<= y.re 1.06e-23)
t_0
(if (<= y.re 1.2e+43)
(/ (* x.re y.re) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.re 6.2e+89) t_0 (/ x.re y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im);
double tmp;
if (y_46_re <= -5.5e+86) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= 1.06e-23) {
tmp = t_0;
} else if (y_46_re <= 1.2e+43) {
tmp = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 6.2e+89) {
tmp = t_0;
} else {
tmp = 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) :: t_0
real(8) :: tmp
t_0 = (y_46re / (y_46im * (y_46im / x_46re))) + (x_46im / y_46im)
if (y_46re <= (-5.5d+86)) then
tmp = x_46re / y_46re
else if (y_46re <= 1.06d-23) then
tmp = t_0
else if (y_46re <= 1.2d+43) then
tmp = (x_46re * y_46re) / ((y_46re * y_46re) + (y_46im * y_46im))
else if (y_46re <= 6.2d+89) then
tmp = t_0
else
tmp = 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 t_0 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im);
double tmp;
if (y_46_re <= -5.5e+86) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= 1.06e-23) {
tmp = t_0;
} else if (y_46_re <= 1.2e+43) {
tmp = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_re <= 6.2e+89) {
tmp = t_0;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im) tmp = 0 if y_46_re <= -5.5e+86: tmp = x_46_re / y_46_re elif y_46_re <= 1.06e-23: tmp = t_0 elif y_46_re <= 1.2e+43: tmp = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) elif y_46_re <= 6.2e+89: tmp = t_0 else: tmp = x_46_re / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(y_46_re / Float64(y_46_im * Float64(y_46_im / x_46_re))) + Float64(x_46_im / y_46_im)) tmp = 0.0 if (y_46_re <= -5.5e+86) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= 1.06e-23) tmp = t_0; elseif (y_46_re <= 1.2e+43) tmp = Float64(Float64(x_46_re * y_46_re) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_re <= 6.2e+89) tmp = t_0; else tmp = Float64(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) t_0 = (y_46_re / (y_46_im * (y_46_im / x_46_re))) + (x_46_im / y_46_im); tmp = 0.0; if (y_46_re <= -5.5e+86) tmp = x_46_re / y_46_re; elseif (y_46_re <= 1.06e-23) tmp = t_0; elseif (y_46_re <= 1.2e+43) tmp = (x_46_re * y_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); elseif (y_46_re <= 6.2e+89) tmp = t_0; else tmp = x_46_re / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re / N[(y$46$im * N[(y$46$im / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.5e+86], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 1.06e-23], t$95$0, If[LessEqual[y$46$re, 1.2e+43], N[(N[(x$46$re * y$46$re), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 6.2e+89], t$95$0, N[(x$46$re / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re}{y.im \cdot \frac{y.im}{x.re}} + \frac{x.im}{y.im}\\
\mathbf{if}\;y.re \leq -5.5 \cdot 10^{+86}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq 1.06 \cdot 10^{-23}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 1.2 \cdot 10^{+43}:\\
\;\;\;\;\frac{x.re \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 6.2 \cdot 10^{+89}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.re < -5.5000000000000002e86 or 6.2e89 < y.re Initial program 40.4%
Taylor expanded in y.re around inf 77.4%
if -5.5000000000000002e86 < y.re < 1.05999999999999994e-23 or 1.20000000000000012e43 < y.re < 6.2e89Initial program 71.7%
Taylor expanded in y.re around 0 71.6%
+-commutative71.6%
*-commutative71.6%
associate-/l*69.9%
fma-define69.9%
Simplified69.9%
fma-undefine69.9%
pow269.9%
clear-num69.9%
un-div-inv69.9%
pow269.9%
Applied egg-rr69.9%
unpow269.9%
*-un-lft-identity69.9%
times-frac72.5%
Applied egg-rr72.5%
if 1.05999999999999994e-23 < y.re < 1.20000000000000012e43Initial program 93.7%
Taylor expanded in x.re around inf 60.0%
*-commutative60.0%
Simplified60.0%
Final simplification73.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.7e+87) (not (<= y.im 1.7e-96))) (/ x.im 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 <= -3.7e+87) || !(y_46_im <= 1.7e-96)) {
tmp = x_46_im / y_46_im;
} else {
tmp = 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 <= (-3.7d+87)) .or. (.not. (y_46im <= 1.7d-96))) then
tmp = x_46im / y_46im
else
tmp = 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 <= -3.7e+87) || !(y_46_im <= 1.7e-96)) {
tmp = x_46_im / y_46_im;
} else {
tmp = 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 <= -3.7e+87) or not (y_46_im <= 1.7e-96): tmp = x_46_im / y_46_im else: tmp = 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 <= -3.7e+87) || !(y_46_im <= 1.7e-96)) tmp = Float64(x_46_im / y_46_im); else tmp = Float64(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 <= -3.7e+87) || ~((y_46_im <= 1.7e-96))) tmp = x_46_im / y_46_im; else tmp = 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, -3.7e+87], N[Not[LessEqual[y$46$im, 1.7e-96]], $MachinePrecision]], N[(x$46$im / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.7 \cdot 10^{+87} \lor \neg \left(y.im \leq 1.7 \cdot 10^{-96}\right):\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -3.70000000000000003e87 or 1.7e-96 < y.im Initial program 53.2%
Taylor expanded in y.re around 0 64.9%
if -3.70000000000000003e87 < y.im < 1.7e-96Initial program 72.7%
Taylor expanded in y.re around inf 62.1%
Final simplification63.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.re -4.2e+165) (/ x.im y.re) (/ x.im 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 <= -4.2e+165) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_im / 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 <= (-4.2d+165)) then
tmp = x_46im / y_46re
else
tmp = x_46im / 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 <= -4.2e+165) {
tmp = x_46_im / y_46_re;
} else {
tmp = x_46_im / 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 <= -4.2e+165: tmp = x_46_im / y_46_re else: tmp = x_46_im / 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 <= -4.2e+165) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(x_46_im / 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 <= -4.2e+165) tmp = x_46_im / y_46_re; else tmp = x_46_im / 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$re, -4.2e+165], N[(x$46$im / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -4.2 \cdot 10^{+165}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.re < -4.2000000000000001e165Initial program 35.9%
*-un-lft-identity35.9%
add-sqr-sqrt35.9%
times-frac35.9%
hypot-define35.9%
fma-define35.9%
hypot-define48.4%
Applied egg-rr48.4%
Taylor expanded in y.im around -inf 21.9%
mul-1-neg21.9%
Simplified21.9%
Taylor expanded in y.re around -inf 21.9%
if -4.2000000000000001e165 < y.re Initial program 66.6%
Taylor expanded in y.re around 0 50.0%
Final simplification46.2%
(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 62.5%
Taylor expanded in y.re around 0 44.6%
Final simplification44.6%
herbie shell --seed 2024043
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
:precision binary64
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))