
(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 11 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 (<= y.im -1.3e+49)
(+ (/ x.im y.im) (* (/ y.re y.im) (/ x.re y.im)))
(if (<= y.im 5e-53)
(+ (/ x.re y.re) (/ (/ y.im y.re) (/ y.re x.im)))
(if (<= y.im 5.5e+64)
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im)))
(+ (/ x.im y.im) (/ (* x.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) {
double tmp;
if (y_46_im <= -1.3e+49) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else if (y_46_im <= 5e-53) {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) / (y_46_re / x_46_im));
} else if (y_46_im <= 5.5e+64) {
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));
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_46im <= (-1.3d+49)) then
tmp = (x_46im / y_46im) + ((y_46re / y_46im) * (x_46re / y_46im))
else if (y_46im <= 5d-53) then
tmp = (x_46re / y_46re) + ((y_46im / y_46re) / (y_46re / x_46im))
else if (y_46im <= 5.5d+64) then
tmp = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
else
tmp = (x_46im / y_46im) + ((x_46re * (y_46re / y_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_im <= -1.3e+49) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else if (y_46_im <= 5e-53) {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) / (y_46_re / x_46_im));
} else if (y_46_im <= 5.5e+64) {
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));
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_im <= -1.3e+49: tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)) elif y_46_im <= 5e-53: tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) / (y_46_re / x_46_im)) elif y_46_im <= 5.5e+64: 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)) else: tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_im <= -1.3e+49) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(y_46_re / y_46_im) * Float64(x_46_re / y_46_im))); elseif (y_46_im <= 5e-53) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im / y_46_re) / Float64(y_46_re / x_46_im))); elseif (y_46_im <= 5.5e+64) tmp = 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))); else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(x_46_re * Float64(y_46_re / y_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_im <= -1.3e+49) tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)); elseif (y_46_im <= 5e-53) tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) / (y_46_re / x_46_im)); elseif (y_46_im <= 5.5e+64) 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)); else tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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$im, -1.3e+49], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5e-53], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im / y$46$re), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.5e+64], 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], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.3 \cdot 10^{+49}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{-53}:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{\frac{y.im}{y.re}}{\frac{y.re}{x.im}}\\
\mathbf{elif}\;y.im \leq 5.5 \cdot 10^{+64}:\\
\;\;\;\;\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.im < -1.29999999999999994e49Initial program 63.4%
Taylor expanded in y.re around 0 77.4%
+-commutative77.4%
*-commutative77.4%
unpow277.4%
times-frac82.0%
Simplified82.0%
if -1.29999999999999994e49 < y.im < 5e-53Initial program 66.8%
Taylor expanded in y.re around inf 81.9%
associate-/l*78.9%
associate-/r/80.8%
unpow280.8%
associate-/r*84.9%
Simplified84.9%
associate-*l/86.7%
Applied egg-rr86.7%
associate-/l*85.8%
Simplified85.8%
if 5e-53 < y.im < 5.4999999999999996e64Initial program 88.2%
if 5.4999999999999996e64 < y.im Initial program 41.0%
Taylor expanded in y.re around 0 79.2%
+-commutative79.2%
*-commutative79.2%
unpow279.2%
times-frac91.3%
Simplified91.3%
associate-*r/91.4%
Applied egg-rr91.4%
Final simplification86.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (+ (* x.re y.re) (* x.im y.im))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) 5e+296)
(* (/ 1.0 (hypot y.re y.im)) (/ t_0 (hypot y.re y.im)))
(+ (/ x.im y.im) (/ 1.0 (/ y.im (/ x.re (/ y.im y.re))))))))
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);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+296) {
tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re / (y_46_im / y_46_re))));
}
return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+296) {
tmp = (1.0 / Math.hypot(y_46_re, y_46_im)) * (t_0 / Math.hypot(y_46_re, y_46_im));
} else {
tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re / (y_46_im / y_46_re))));
}
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) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+296: tmp = (1.0 / math.hypot(y_46_re, y_46_im)) * (t_0 / math.hypot(y_46_re, y_46_im)) else: tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re / (y_46_im / y_46_re)))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= 5e+296) 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(x_46_im / y_46_im) + Float64(1.0 / Float64(y_46_im / Float64(x_46_re / Float64(y_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) t_0 = (x_46_re * y_46_re) + (x_46_im * y_46_im); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= 5e+296) tmp = (1.0 / hypot(y_46_re, y_46_im)) * (t_0 / hypot(y_46_re, y_46_im)); else tmp = (x_46_im / y_46_im) + (1.0 / (y_46_im / (x_46_re / (y_46_im / 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[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 5e+296], 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[(x$46$im / y$46$im), $MachinePrecision] + N[(1.0 / N[(y$46$im / N[(x$46$re / N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x.re \cdot y.re + x.im \cdot y.im\\
\mathbf{if}\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im} \leq 5 \cdot 10^{+296}:\\
\;\;\;\;\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{x.im}{y.im} + \frac{1}{\frac{y.im}{\frac{x.re}{\frac{y.im}{y.re}}}}\\
\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))) < 5.0000000000000001e296Initial program 80.6%
*-un-lft-identity80.6%
add-sqr-sqrt80.6%
times-frac80.6%
hypot-def80.6%
fma-def80.6%
hypot-def96.6%
Applied egg-rr96.6%
fma-def96.7%
Applied egg-rr96.7%
if 5.0000000000000001e296 < (/.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 7.2%
Taylor expanded in y.re around 0 40.0%
+-commutative40.0%
*-commutative40.0%
unpow240.0%
times-frac52.8%
Simplified52.8%
*-commutative52.8%
clear-num52.8%
frac-times48.5%
*-un-lft-identity48.5%
Applied egg-rr48.5%
clear-num48.5%
inv-pow48.5%
*-commutative48.5%
Applied egg-rr48.5%
unpow-148.5%
associate-/l*52.8%
associate-/r/54.2%
associate-*l/42.1%
*-commutative42.1%
associate-/l*54.3%
Simplified54.3%
Final simplification85.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -3300000.0)
(/ x.re y.re)
(if (<= y.re 7.4e-56)
(/ x.im y.im)
(if (<= y.re 5.6e+130)
(* y.re (/ x.re (+ (* y.re y.re) (* y.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_re <= -3300000.0) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= 7.4e-56) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 5.6e+130) {
tmp = y_46_re * (x_46_re / ((y_46_re * y_46_re) + (y_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_46re <= (-3300000.0d0)) then
tmp = x_46re / y_46re
else if (y_46re <= 7.4d-56) then
tmp = x_46im / y_46im
else if (y_46re <= 5.6d+130) then
tmp = y_46re * (x_46re / ((y_46re * y_46re) + (y_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_re <= -3300000.0) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= 7.4e-56) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 5.6e+130) {
tmp = y_46_re * (x_46_re / ((y_46_re * y_46_re) + (y_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_re <= -3300000.0: tmp = x_46_re / y_46_re elif y_46_re <= 7.4e-56: tmp = x_46_im / y_46_im elif y_46_re <= 5.6e+130: tmp = y_46_re * (x_46_re / ((y_46_re * y_46_re) + (y_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_re <= -3300000.0) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= 7.4e-56) tmp = Float64(x_46_im / y_46_im); elseif (y_46_re <= 5.6e+130) tmp = Float64(y_46_re * Float64(x_46_re / Float64(Float64(y_46_re * y_46_re) + Float64(y_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_re <= -3300000.0) tmp = x_46_re / y_46_re; elseif (y_46_re <= 7.4e-56) tmp = x_46_im / y_46_im; elseif (y_46_re <= 5.6e+130) tmp = y_46_re * (x_46_re / ((y_46_re * y_46_re) + (y_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[LessEqual[y$46$re, -3300000.0], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 7.4e-56], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 5.6e+130], N[(y$46$re * N[(x$46$re / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3300000:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-56}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.re \leq 5.6 \cdot 10^{+130}:\\
\;\;\;\;y.re \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.re < -3.3e6 or 5.5999999999999997e130 < y.re Initial program 47.4%
Taylor expanded in y.re around inf 71.5%
if -3.3e6 < y.re < 7.4000000000000004e-56Initial program 70.1%
Taylor expanded in y.re around 0 75.3%
if 7.4000000000000004e-56 < y.re < 5.5999999999999997e130Initial program 77.4%
Taylor expanded in x.re around inf 51.4%
associate-/l*64.0%
associate-/r/59.2%
+-commutative59.2%
unpow259.2%
fma-def59.2%
unpow259.2%
Simplified59.2%
Taylor expanded in x.re around 0 59.2%
unpow259.2%
unpow259.2%
Simplified59.2%
Final simplification71.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3e+33) (not (<= y.im 1750.0))) (+ (/ x.im y.im) (* x.re (/ (/ y.re y.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 <= -3e+33) || !(y_46_im <= 1750.0)) {
tmp = (x_46_im / y_46_im) + (x_46_re * ((y_46_re / y_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 <= (-3d+33)) .or. (.not. (y_46im <= 1750.0d0))) then
tmp = (x_46im / y_46im) + (x_46re * ((y_46re / y_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 <= -3e+33) || !(y_46_im <= 1750.0)) {
tmp = (x_46_im / y_46_im) + (x_46_re * ((y_46_re / y_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 <= -3e+33) or not (y_46_im <= 1750.0): tmp = (x_46_im / y_46_im) + (x_46_re * ((y_46_re / y_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 <= -3e+33) || !(y_46_im <= 1750.0)) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(x_46_re * Float64(Float64(y_46_re / y_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 <= -3e+33) || ~((y_46_im <= 1750.0))) tmp = (x_46_im / y_46_im) + (x_46_re * ((y_46_re / y_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, -3e+33], N[Not[LessEqual[y$46$im, 1750.0]], $MachinePrecision]], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(x$46$re * N[(N[(y$46$re / y$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3 \cdot 10^{+33} \lor \neg \left(y.im \leq 1750\right):\\
\;\;\;\;\frac{x.im}{y.im} + x.re \cdot \frac{\frac{y.re}{y.im}}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -2.99999999999999984e33 or 1750 < y.im Initial program 54.7%
Taylor expanded in y.re around 0 75.6%
+-commutative75.6%
*-commutative75.6%
unpow275.6%
times-frac83.1%
Simplified83.1%
*-commutative83.1%
clear-num83.1%
frac-times79.1%
*-un-lft-identity79.1%
Applied egg-rr79.1%
Taylor expanded in y.re around 0 75.6%
unpow275.6%
times-frac83.1%
associate-*l/83.1%
*-rgt-identity83.1%
*-commutative83.1%
times-frac80.0%
/-rgt-identity80.0%
Simplified80.0%
if -2.99999999999999984e33 < y.im < 1750Initial program 69.7%
Taylor expanded in y.re around inf 67.4%
Final simplification73.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4e+33) (not (<= y.im 1100.0))) (+ (/ x.im y.im) (* (/ y.re y.im) (/ x.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 <= -4e+33) || !(y_46_im <= 1100.0)) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / 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 <= (-4d+33)) .or. (.not. (y_46im <= 1100.0d0))) then
tmp = (x_46im / y_46im) + ((y_46re / y_46im) * (x_46re / 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 <= -4e+33) || !(y_46_im <= 1100.0)) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / 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 <= -4e+33) or not (y_46_im <= 1100.0): tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / 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 <= -4e+33) || !(y_46_im <= 1100.0)) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(y_46_re / y_46_im) * Float64(x_46_re / 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 <= -4e+33) || ~((y_46_im <= 1100.0))) tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / 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, -4e+33], N[Not[LessEqual[y$46$im, 1100.0]], $MachinePrecision]], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4 \cdot 10^{+33} \lor \neg \left(y.im \leq 1100\right):\\
\;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.im < -3.9999999999999998e33 or 1100 < y.im Initial program 54.7%
Taylor expanded in y.re around 0 75.6%
+-commutative75.6%
*-commutative75.6%
unpow275.6%
times-frac83.1%
Simplified83.1%
if -3.9999999999999998e33 < y.im < 1100Initial program 69.7%
Taylor expanded in y.re around inf 67.4%
Final simplification75.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -2.7e+33)
(+ (/ x.im y.im) (* (/ y.re y.im) (/ x.re y.im)))
(if (<= y.im 950.0)
(/ x.re y.re)
(+ (/ x.im y.im) (/ (* x.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) {
double tmp;
if (y_46_im <= -2.7e+33) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else if (y_46_im <= 950.0) {
tmp = x_46_re / y_46_re;
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_46im <= (-2.7d+33)) then
tmp = (x_46im / y_46im) + ((y_46re / y_46im) * (x_46re / y_46im))
else if (y_46im <= 950.0d0) then
tmp = x_46re / y_46re
else
tmp = (x_46im / y_46im) + ((x_46re * (y_46re / y_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_im <= -2.7e+33) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else if (y_46_im <= 950.0) {
tmp = x_46_re / y_46_re;
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_im <= -2.7e+33: tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)) elif y_46_im <= 950.0: tmp = x_46_re / y_46_re else: tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_im <= -2.7e+33) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(y_46_re / y_46_im) * Float64(x_46_re / y_46_im))); elseif (y_46_im <= 950.0) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(x_46_re * Float64(y_46_re / y_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_im <= -2.7e+33) tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)); elseif (y_46_im <= 950.0) tmp = x_46_re / y_46_re; else tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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$im, -2.7e+33], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 950.0], N[(x$46$re / y$46$re), $MachinePrecision], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.7 \cdot 10^{+33}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 950:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.im < -2.69999999999999991e33Initial program 62.4%
Taylor expanded in y.re around 0 75.5%
+-commutative75.5%
*-commutative75.5%
unpow275.5%
times-frac79.8%
Simplified79.8%
if -2.69999999999999991e33 < y.im < 950Initial program 69.7%
Taylor expanded in y.re around inf 67.4%
if 950 < y.im Initial program 49.0%
Taylor expanded in y.re around 0 75.7%
+-commutative75.7%
*-commutative75.7%
unpow275.7%
times-frac85.5%
Simplified85.5%
associate-*r/85.5%
Applied egg-rr85.5%
Final simplification75.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.8e+50)
(+ (/ x.im y.im) (* (/ y.re y.im) (/ x.re y.im)))
(if (<= y.im 1600.0)
(+ (/ x.re y.re) (* (/ y.im y.re) (/ x.im y.re)))
(+ (/ x.im y.im) (/ (* x.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) {
double tmp;
if (y_46_im <= -5.8e+50) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else if (y_46_im <= 1600.0) {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_46im <= (-5.8d+50)) then
tmp = (x_46im / y_46im) + ((y_46re / y_46im) * (x_46re / y_46im))
else if (y_46im <= 1600.0d0) then
tmp = (x_46re / y_46re) + ((y_46im / y_46re) * (x_46im / y_46re))
else
tmp = (x_46im / y_46im) + ((x_46re * (y_46re / y_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_im <= -5.8e+50) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else if (y_46_im <= 1600.0) {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re));
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_im <= -5.8e+50: tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)) elif y_46_im <= 1600.0: tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)) else: tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_im <= -5.8e+50) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(y_46_re / y_46_im) * Float64(x_46_re / y_46_im))); elseif (y_46_im <= 1600.0) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im / y_46_re) * Float64(x_46_im / y_46_re))); else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(x_46_re * Float64(y_46_re / y_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_im <= -5.8e+50) tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)); elseif (y_46_im <= 1600.0) tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) * (x_46_im / y_46_re)); else tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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$im, -5.8e+50], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1600.0], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im / y$46$re), $MachinePrecision] * N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.8 \cdot 10^{+50}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 1600:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.im < -5.8e50Initial program 63.4%
Taylor expanded in y.re around 0 77.4%
+-commutative77.4%
*-commutative77.4%
unpow277.4%
times-frac82.0%
Simplified82.0%
if -5.8e50 < y.im < 1600Initial program 69.1%
Taylor expanded in y.re around inf 81.0%
unpow281.0%
times-frac82.6%
Simplified82.6%
if 1600 < y.im Initial program 49.0%
Taylor expanded in y.re around 0 75.7%
+-commutative75.7%
*-commutative75.7%
unpow275.7%
times-frac85.5%
Simplified85.5%
associate-*r/85.5%
Applied egg-rr85.5%
Final simplification83.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -3.4e+48)
(+ (/ x.im y.im) (* (/ y.re y.im) (/ x.re y.im)))
(if (<= y.im 1400.0)
(+ (/ x.re y.re) (* x.im (/ (/ y.im y.re) y.re)))
(+ (/ x.im y.im) (/ (* x.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) {
double tmp;
if (y_46_im <= -3.4e+48) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else if (y_46_im <= 1400.0) {
tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im / y_46_re) / y_46_re));
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_46_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_46im <= (-3.4d+48)) then
tmp = (x_46im / y_46im) + ((y_46re / y_46im) * (x_46re / y_46im))
else if (y_46im <= 1400.0d0) then
tmp = (x_46re / y_46re) + (x_46im * ((y_46im / y_46re) / y_46re))
else
tmp = (x_46im / y_46im) + ((x_46re * (y_46re / y_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_im <= -3.4e+48) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else if (y_46_im <= 1400.0) {
tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im / y_46_re) / y_46_re));
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_46_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_im <= -3.4e+48: tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)) elif y_46_im <= 1400.0: tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im / y_46_re) / y_46_re)) else: tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_46_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_im <= -3.4e+48) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(y_46_re / y_46_im) * Float64(x_46_re / y_46_im))); elseif (y_46_im <= 1400.0) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(x_46_im * Float64(Float64(y_46_im / y_46_re) / y_46_re))); else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(x_46_re * Float64(y_46_re / y_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_im <= -3.4e+48) tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)); elseif (y_46_im <= 1400.0) tmp = (x_46_re / y_46_re) + (x_46_im * ((y_46_im / y_46_re) / y_46_re)); else tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_46_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$im, -3.4e+48], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1400.0], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(x$46$im * N[(N[(y$46$im / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.4 \cdot 10^{+48}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 1400:\\
\;\;\;\;\frac{x.re}{y.re} + x.im \cdot \frac{\frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.im < -3.4000000000000003e48Initial program 63.4%
Taylor expanded in y.re around 0 77.4%
+-commutative77.4%
*-commutative77.4%
unpow277.4%
times-frac82.0%
Simplified82.0%
if -3.4000000000000003e48 < y.im < 1400Initial program 69.1%
Taylor expanded in y.re around inf 81.0%
associate-/l*78.1%
associate-/r/79.9%
unpow279.9%
associate-/r*83.7%
Simplified83.7%
if 1400 < y.im Initial program 49.0%
Taylor expanded in y.re around 0 75.7%
+-commutative75.7%
*-commutative75.7%
unpow275.7%
times-frac85.5%
Simplified85.5%
associate-*r/85.5%
Applied egg-rr85.5%
Final simplification83.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.8e+48)
(+ (/ x.im y.im) (* (/ y.re y.im) (/ x.re y.im)))
(if (<= y.im 2100.0)
(+ (/ x.re y.re) (/ (/ y.im y.re) (/ y.re x.im)))
(+ (/ x.im y.im) (/ (* x.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) {
double tmp;
if (y_46_im <= -1.8e+48) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else if (y_46_im <= 2100.0) {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) / (y_46_re / x_46_im));
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_46im <= (-1.8d+48)) then
tmp = (x_46im / y_46im) + ((y_46re / y_46im) * (x_46re / y_46im))
else if (y_46im <= 2100.0d0) then
tmp = (x_46re / y_46re) + ((y_46im / y_46re) / (y_46re / x_46im))
else
tmp = (x_46im / y_46im) + ((x_46re * (y_46re / y_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_im <= -1.8e+48) {
tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im));
} else if (y_46_im <= 2100.0) {
tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) / (y_46_re / x_46_im));
} else {
tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_im <= -1.8e+48: tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)) elif y_46_im <= 2100.0: tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) / (y_46_re / x_46_im)) else: tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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_im <= -1.8e+48) tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(y_46_re / y_46_im) * Float64(x_46_re / y_46_im))); elseif (y_46_im <= 2100.0) tmp = Float64(Float64(x_46_re / y_46_re) + Float64(Float64(y_46_im / y_46_re) / Float64(y_46_re / x_46_im))); else tmp = Float64(Float64(x_46_im / y_46_im) + Float64(Float64(x_46_re * Float64(y_46_re / y_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_im <= -1.8e+48) tmp = (x_46_im / y_46_im) + ((y_46_re / y_46_im) * (x_46_re / y_46_im)); elseif (y_46_im <= 2100.0) tmp = (x_46_re / y_46_re) + ((y_46_im / y_46_re) / (y_46_re / x_46_im)); else tmp = (x_46_im / y_46_im) + ((x_46_re * (y_46_re / y_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$im, -1.8e+48], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(y$46$re / y$46$im), $MachinePrecision] * N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2100.0], N[(N[(x$46$re / y$46$re), $MachinePrecision] + N[(N[(y$46$im / y$46$re), $MachinePrecision] / N[(y$46$re / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / y$46$im), $MachinePrecision] + N[(N[(x$46$re * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.8 \cdot 10^{+48}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 2100:\\
\;\;\;\;\frac{x.re}{y.re} + \frac{\frac{y.im}{y.re}}{\frac{y.re}{x.im}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} + \frac{x.re \cdot \frac{y.re}{y.im}}{y.im}\\
\end{array}
\end{array}
if y.im < -1.79999999999999992e48Initial program 63.4%
Taylor expanded in y.re around 0 77.4%
+-commutative77.4%
*-commutative77.4%
unpow277.4%
times-frac82.0%
Simplified82.0%
if -1.79999999999999992e48 < y.im < 2100Initial program 69.1%
Taylor expanded in y.re around inf 81.0%
associate-/l*78.1%
associate-/r/79.9%
unpow279.9%
associate-/r*83.7%
Simplified83.7%
associate-*l/85.4%
Applied egg-rr85.4%
associate-/l*84.6%
Simplified84.6%
if 2100 < y.im Initial program 49.0%
Taylor expanded in y.re around 0 75.7%
+-commutative75.7%
*-commutative75.7%
unpow275.7%
times-frac85.5%
Simplified85.5%
associate-*r/85.5%
Applied egg-rr85.5%
Final simplification84.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -3.9e+84) (/ x.im y.im) (if (<= y.im 1020.0) (/ x.re 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_im <= -3.9e+84) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1020.0) {
tmp = x_46_re / 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_46im <= (-3.9d+84)) then
tmp = x_46im / y_46im
else if (y_46im <= 1020.0d0) then
tmp = x_46re / 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_im <= -3.9e+84) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1020.0) {
tmp = x_46_re / 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_im <= -3.9e+84: tmp = x_46_im / y_46_im elif y_46_im <= 1020.0: tmp = x_46_re / 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_im <= -3.9e+84) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 1020.0) tmp = Float64(x_46_re / 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_im <= -3.9e+84) tmp = x_46_im / y_46_im; elseif (y_46_im <= 1020.0) tmp = x_46_re / 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$im, -3.9e+84], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1020.0], N[(x$46$re / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.9 \cdot 10^{+84}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 1020:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -3.90000000000000016e84 or 1020 < y.im Initial program 53.8%
Taylor expanded in y.re around 0 73.9%
if -3.90000000000000016e84 < y.im < 1020Initial program 69.3%
Taylor expanded in y.re around inf 65.7%
Final simplification69.6%
(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.0%
Taylor expanded in y.re around 0 44.2%
Final simplification44.2%
herbie shell --seed 2023172
(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))))