
(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 12 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 (fma (/ y.re (hypot y.re y.im)) (/ x.im (hypot y.re y.im)) (* (/ y.im (hypot y.im y.re)) (/ (- x.re) (hypot y.im y.re)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return fma((y_46_re / hypot(y_46_re, y_46_im)), (x_46_im / hypot(y_46_re, y_46_im)), ((y_46_im / hypot(y_46_im, y_46_re)) * (-x_46_re / hypot(y_46_im, y_46_re))));
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) return fma(Float64(y_46_re / hypot(y_46_re, y_46_im)), Float64(x_46_im / hypot(y_46_re, y_46_im)), Float64(Float64(y_46_im / hypot(y_46_im, y_46_re)) * Float64(Float64(-x_46_re) / hypot(y_46_im, y_46_re)))) end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := 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[(N[(y$46$im / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[((-x$46$re) / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\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)}, \frac{y.im}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{-x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\right)
\end{array}
Initial program 64.8%
div-sub61.9%
*-commutative61.9%
fma-define61.9%
add-sqr-sqrt61.9%
times-frac63.5%
fma-neg63.5%
fma-define63.5%
hypot-define63.5%
fma-define63.5%
hypot-define78.0%
Applied egg-rr78.0%
*-commutative78.0%
add-sqr-sqrt78.0%
hypot-undefine78.0%
hypot-undefine78.0%
times-frac96.6%
hypot-undefine80.1%
+-commutative80.1%
hypot-define96.6%
hypot-undefine80.1%
+-commutative80.1%
hypot-define96.6%
Applied egg-rr96.6%
Final simplification96.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
(if (<= (/ t_0 (+ (* y.re y.re) (* y.im y.im))) INFINITY)
(/ (/ t_0 (hypot y.re y.im)) (hypot y.re y.im))
(* (/ y.im (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 t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= ((double) INFINITY)) {
tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im);
} else {
tmp = (y_46_im / hypot(y_46_re, y_46_im)) * (-x_46_re / 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 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
double tmp;
if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= Double.POSITIVE_INFINITY) {
tmp = (t_0 / Math.hypot(y_46_re, y_46_im)) / Math.hypot(y_46_re, y_46_im);
} else {
tmp = (y_46_im / Math.hypot(y_46_re, y_46_im)) * (-x_46_re / 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 = (y_46_re * x_46_im) - (y_46_im * x_46_re) tmp = 0 if (t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= math.inf: tmp = (t_0 / math.hypot(y_46_re, y_46_im)) / math.hypot(y_46_re, y_46_im) else: tmp = (y_46_im / math.hypot(y_46_re, y_46_im)) * (-x_46_re / 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(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) <= Inf) tmp = Float64(Float64(t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)); else tmp = Float64(Float64(y_46_im / hypot(y_46_re, y_46_im)) * Float64(Float64(-x_46_re) / 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 = (y_46_re * x_46_im) - (y_46_im * x_46_re); tmp = 0.0; if ((t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im))) <= Inf) tmp = (t_0 / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im); else tmp = (y_46_im / hypot(y_46_re, y_46_im)) * (-x_46_re / 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[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $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], Infinity], N[(N[(t$95$0 / 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$im / 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}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;\frac{t\_0}{y.re \cdot y.re + y.im \cdot y.im} \leq \infty:\\
\;\;\;\;\frac{\frac{t\_0}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y.im}{\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.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < +inf.0Initial program 80.1%
fma-define80.1%
add-sqr-sqrt80.1%
associate-/r*80.3%
fma-define80.3%
hypot-define80.3%
fma-define80.3%
hypot-define95.7%
Applied egg-rr95.7%
if +inf.0 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) Initial program 0.0%
clear-num0.0%
associate-/r/0.0%
Applied egg-rr0.0%
Taylor expanded in x.im around 0 1.5%
mul-1-neg1.5%
distribute-rgt-neg-in1.5%
Simplified1.5%
associate-*l/1.5%
*-un-lft-identity1.5%
distribute-rgt-neg-out1.5%
remove-double-neg1.5%
distribute-rgt-neg-out1.5%
distribute-frac-neg1.5%
distribute-rgt-neg-out1.5%
remove-double-neg1.5%
+-commutative1.5%
add-sqr-sqrt1.5%
hypot-undefine1.5%
hypot-undefine1.5%
frac-times56.4%
*-commutative56.4%
distribute-rgt-neg-in56.4%
hypot-undefine3.7%
+-commutative3.7%
hypot-undefine56.4%
Applied egg-rr56.4%
Final simplification88.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -54000000000.0)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im 4.3e-116)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 3.1e+114)
(/
1.0
(/ (+ (* y.re y.re) (* y.im y.im)) (- (* y.re x.im) (* y.im x.re))))
(- (* (/ x.im y.im) (/ y.re y.im)) (* (/ x.re y.im) (/ 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 <= -54000000000.0) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 4.3e-116) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 3.1e+114) {
tmp = 1.0 / (((y_46_re * y_46_re) + (y_46_im * y_46_im)) / ((y_46_re * x_46_im) - (y_46_im * x_46_re)));
} else {
tmp = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - ((x_46_re / y_46_im) * (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 <= (-54000000000.0d0)) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else if (y_46im <= 4.3d-116) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if (y_46im <= 3.1d+114) then
tmp = 1.0d0 / (((y_46re * y_46re) + (y_46im * y_46im)) / ((y_46re * x_46im) - (y_46im * x_46re)))
else
tmp = ((x_46im / y_46im) * (y_46re / y_46im)) - ((x_46re / y_46im) * (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 <= -54000000000.0) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 4.3e-116) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 3.1e+114) {
tmp = 1.0 / (((y_46_re * y_46_re) + (y_46_im * y_46_im)) / ((y_46_re * x_46_im) - (y_46_im * x_46_re)));
} else {
tmp = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - ((x_46_re / y_46_im) * (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 <= -54000000000.0: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= 4.3e-116: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_im <= 3.1e+114: tmp = 1.0 / (((y_46_re * y_46_re) + (y_46_im * y_46_im)) / ((y_46_re * x_46_im) - (y_46_im * x_46_re))) else: tmp = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - ((x_46_re / y_46_im) * (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 <= -54000000000.0) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= 4.3e-116) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 3.1e+114) tmp = Float64(1.0 / Float64(Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)) / Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)))); else tmp = Float64(Float64(Float64(x_46_im / y_46_im) * Float64(y_46_re / y_46_im)) - Float64(Float64(x_46_re / y_46_im) * Float64(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 <= -54000000000.0) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= 4.3e-116) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_im <= 3.1e+114) tmp = 1.0 / (((y_46_re * y_46_re) + (y_46_im * y_46_im)) / ((y_46_re * x_46_im) - (y_46_im * x_46_re))); else tmp = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - ((x_46_re / y_46_im) * (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, -54000000000.0], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 4.3e-116], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 3.1e+114], N[(1.0 / N[(N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(N[(x$46$re / y$46$im), $MachinePrecision] * N[(y$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -54000000000:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 4.3 \cdot 10^{-116}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 3.1 \cdot 10^{+114}:\\
\;\;\;\;\frac{1}{\frac{y.re \cdot y.re + y.im \cdot y.im}{y.re \cdot x.im - y.im \cdot x.re}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} \cdot \frac{y.re}{y.im} - \frac{x.re}{y.im} \cdot \frac{y.im}{y.im}\\
\end{array}
\end{array}
if y.im < -5.4e10Initial program 53.6%
Taylor expanded in y.re around 0 70.5%
+-commutative70.5%
mul-1-neg70.5%
unsub-neg70.5%
unpow270.5%
associate-/r*73.6%
div-sub73.6%
*-commutative73.6%
associate-/l*78.6%
Simplified78.6%
if -5.4e10 < y.im < 4.2999999999999997e-116Initial program 73.1%
Taylor expanded in y.re around inf 90.6%
mul-1-neg90.6%
unsub-neg90.6%
associate-/l*90.6%
Simplified90.6%
associate-*r/90.6%
add-sqr-sqrt35.8%
sqrt-prod71.6%
sqr-neg71.6%
sqrt-unprod40.3%
add-sqr-sqrt71.0%
*-commutative71.0%
add-sqr-sqrt40.3%
sqrt-unprod71.6%
sqr-neg71.6%
sqrt-prod35.8%
add-sqr-sqrt90.6%
Applied egg-rr90.6%
if 4.2999999999999997e-116 < y.im < 3.1e114Initial program 83.2%
clear-num83.3%
Applied egg-rr83.3%
if 3.1e114 < y.im Initial program 37.7%
Taylor expanded in y.re around 0 37.7%
unpow237.7%
Simplified37.7%
div-sub37.7%
times-frac45.0%
times-frac86.2%
Applied egg-rr86.2%
Final simplification85.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -14600000000.0)
(/ (- (* y.re (/ x.im y.im)) x.re) y.im)
(if (<= y.im 1.7e-125)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 1.18e+114)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(- (* (/ x.im y.im) (/ y.re y.im)) (* (/ x.re y.im) (/ 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 <= -14600000000.0) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 1.7e-125) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.18e+114) {
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 = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - ((x_46_re / y_46_im) * (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 <= (-14600000000.0d0)) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else if (y_46im <= 1.7d-125) then
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
else if (y_46im <= 1.18d+114) then
tmp = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
else
tmp = ((x_46im / y_46im) * (y_46re / y_46im)) - ((x_46re / y_46im) * (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 <= -14600000000.0) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else if (y_46_im <= 1.7e-125) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 1.18e+114) {
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 = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - ((x_46_re / y_46_im) * (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 <= -14600000000.0: tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im elif y_46_im <= 1.7e-125: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re elif y_46_im <= 1.18e+114: 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 = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - ((x_46_re / y_46_im) * (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 <= -14600000000.0) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); elseif (y_46_im <= 1.7e-125) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 1.18e+114) 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(Float64(x_46_im / y_46_im) * Float64(y_46_re / y_46_im)) - Float64(Float64(x_46_re / y_46_im) * Float64(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 <= -14600000000.0) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; elseif (y_46_im <= 1.7e-125) tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; elseif (y_46_im <= 1.18e+114) 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 = ((x_46_im / y_46_im) * (y_46_re / y_46_im)) - ((x_46_re / y_46_im) * (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, -14600000000.0], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.7e-125], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.18e+114], 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[(N[(x$46$im / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - N[(N[(x$46$re / y$46$im), $MachinePrecision] * N[(y$46$im / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -14600000000:\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 1.7 \cdot 10^{-125}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.18 \cdot 10^{+114}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im} \cdot \frac{y.re}{y.im} - \frac{x.re}{y.im} \cdot \frac{y.im}{y.im}\\
\end{array}
\end{array}
if y.im < -1.46e10Initial program 53.6%
Taylor expanded in y.re around 0 70.5%
+-commutative70.5%
mul-1-neg70.5%
unsub-neg70.5%
unpow270.5%
associate-/r*73.6%
div-sub73.6%
*-commutative73.6%
associate-/l*78.6%
Simplified78.6%
if -1.46e10 < y.im < 1.69999999999999988e-125Initial program 72.9%
Taylor expanded in y.re around inf 90.6%
mul-1-neg90.6%
unsub-neg90.6%
associate-/l*90.5%
Simplified90.5%
associate-*r/90.6%
add-sqr-sqrt35.1%
sqrt-prod71.3%
sqr-neg71.3%
sqrt-unprod40.7%
add-sqr-sqrt70.7%
*-commutative70.7%
add-sqr-sqrt40.7%
sqrt-unprod71.3%
sqr-neg71.3%
sqrt-prod35.1%
add-sqr-sqrt90.6%
Applied egg-rr90.6%
if 1.69999999999999988e-125 < y.im < 1.18000000000000005e114Initial program 83.5%
if 1.18000000000000005e114 < y.im Initial program 37.7%
Taylor expanded in y.re around 0 37.7%
unpow237.7%
Simplified37.7%
div-sub37.7%
times-frac45.0%
times-frac86.2%
Applied egg-rr86.2%
Final simplification85.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.re (- y.im))))
(if (<= y.im -1.6e+89)
t_0
(if (<= y.im -8.5e+18)
(/ (/ (* y.re x.im) y.im) y.im)
(if (or (<= y.im -2.2e-28) (not (<= y.im 2.9e-41)))
t_0
(/ x.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_im;
double tmp;
if (y_46_im <= -1.6e+89) {
tmp = t_0;
} else if (y_46_im <= -8.5e+18) {
tmp = ((y_46_re * x_46_im) / y_46_im) / y_46_im;
} else if ((y_46_im <= -2.2e-28) || !(y_46_im <= 2.9e-41)) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = x_46re / -y_46im
if (y_46im <= (-1.6d+89)) then
tmp = t_0
else if (y_46im <= (-8.5d+18)) then
tmp = ((y_46re * x_46im) / y_46im) / y_46im
else if ((y_46im <= (-2.2d-28)) .or. (.not. (y_46im <= 2.9d-41))) then
tmp = t_0
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 t_0 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -1.6e+89) {
tmp = t_0;
} else if (y_46_im <= -8.5e+18) {
tmp = ((y_46_re * x_46_im) / y_46_im) / y_46_im;
} else if ((y_46_im <= -2.2e-28) || !(y_46_im <= 2.9e-41)) {
tmp = t_0;
} else {
tmp = x_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_im tmp = 0 if y_46_im <= -1.6e+89: tmp = t_0 elif y_46_im <= -8.5e+18: tmp = ((y_46_re * x_46_im) / y_46_im) / y_46_im elif (y_46_im <= -2.2e-28) or not (y_46_im <= 2.9e-41): tmp = t_0 else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_re / Float64(-y_46_im)) tmp = 0.0 if (y_46_im <= -1.6e+89) tmp = t_0; elseif (y_46_im <= -8.5e+18) tmp = Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) / y_46_im); elseif ((y_46_im <= -2.2e-28) || !(y_46_im <= 2.9e-41)) tmp = t_0; 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) t_0 = x_46_re / -y_46_im; tmp = 0.0; if (y_46_im <= -1.6e+89) tmp = t_0; elseif (y_46_im <= -8.5e+18) tmp = ((y_46_re * x_46_im) / y_46_im) / y_46_im; elseif ((y_46_im <= -2.2e-28) || ~((y_46_im <= 2.9e-41))) tmp = t_0; 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_] := Block[{t$95$0 = N[(x$46$re / (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$im, -1.6e+89], t$95$0, If[LessEqual[y$46$im, -8.5e+18], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] / y$46$im), $MachinePrecision], If[Or[LessEqual[y$46$im, -2.2e-28], N[Not[LessEqual[y$46$im, 2.9e-41]], $MachinePrecision]], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{-y.im}\\
\mathbf{if}\;y.im \leq -1.6 \cdot 10^{+89}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -8.5 \cdot 10^{+18}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im}}{y.im}\\
\mathbf{elif}\;y.im \leq -2.2 \cdot 10^{-28} \lor \neg \left(y.im \leq 2.9 \cdot 10^{-41}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.59999999999999994e89 or -8.5e18 < y.im < -2.19999999999999996e-28 or 2.89999999999999977e-41 < y.im Initial program 53.8%
Taylor expanded in y.re around 0 63.3%
mul-1-neg63.3%
distribute-neg-frac263.3%
Simplified63.3%
if -1.59999999999999994e89 < y.im < -8.5e18Initial program 80.0%
Taylor expanded in y.re around 0 68.2%
+-commutative68.2%
mul-1-neg68.2%
unsub-neg68.2%
unpow268.2%
associate-/r*68.4%
div-sub68.4%
*-commutative68.4%
associate-/l*68.3%
Simplified68.3%
Taylor expanded in y.re around inf 54.9%
if -2.19999999999999996e-28 < y.im < 2.89999999999999977e-41Initial program 74.0%
Taylor expanded in y.re around inf 68.6%
Final simplification65.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.re (- y.im))))
(if (<= y.im -2.75e+53)
t_0
(if (<= y.im -6.5e+22)
(/ (* x.im (/ y.re y.im)) y.im)
(if (or (<= y.im -1.15e-24) (not (<= y.im 5.8e-43)))
t_0
(/ x.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_im;
double tmp;
if (y_46_im <= -2.75e+53) {
tmp = t_0;
} else if (y_46_im <= -6.5e+22) {
tmp = (x_46_im * (y_46_re / y_46_im)) / y_46_im;
} else if ((y_46_im <= -1.15e-24) || !(y_46_im <= 5.8e-43)) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = x_46re / -y_46im
if (y_46im <= (-2.75d+53)) then
tmp = t_0
else if (y_46im <= (-6.5d+22)) then
tmp = (x_46im * (y_46re / y_46im)) / y_46im
else if ((y_46im <= (-1.15d-24)) .or. (.not. (y_46im <= 5.8d-43))) then
tmp = t_0
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 t_0 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -2.75e+53) {
tmp = t_0;
} else if (y_46_im <= -6.5e+22) {
tmp = (x_46_im * (y_46_re / y_46_im)) / y_46_im;
} else if ((y_46_im <= -1.15e-24) || !(y_46_im <= 5.8e-43)) {
tmp = t_0;
} else {
tmp = x_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_im tmp = 0 if y_46_im <= -2.75e+53: tmp = t_0 elif y_46_im <= -6.5e+22: tmp = (x_46_im * (y_46_re / y_46_im)) / y_46_im elif (y_46_im <= -1.15e-24) or not (y_46_im <= 5.8e-43): tmp = t_0 else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_re / Float64(-y_46_im)) tmp = 0.0 if (y_46_im <= -2.75e+53) tmp = t_0; elseif (y_46_im <= -6.5e+22) tmp = Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) / y_46_im); elseif ((y_46_im <= -1.15e-24) || !(y_46_im <= 5.8e-43)) tmp = t_0; 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) t_0 = x_46_re / -y_46_im; tmp = 0.0; if (y_46_im <= -2.75e+53) tmp = t_0; elseif (y_46_im <= -6.5e+22) tmp = (x_46_im * (y_46_re / y_46_im)) / y_46_im; elseif ((y_46_im <= -1.15e-24) || ~((y_46_im <= 5.8e-43))) tmp = t_0; 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_] := Block[{t$95$0 = N[(x$46$re / (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$im, -2.75e+53], t$95$0, If[LessEqual[y$46$im, -6.5e+22], N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision], If[Or[LessEqual[y$46$im, -1.15e-24], N[Not[LessEqual[y$46$im, 5.8e-43]], $MachinePrecision]], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{-y.im}\\
\mathbf{if}\;y.im \leq -2.75 \cdot 10^{+53}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -6.5 \cdot 10^{+22}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im}}{y.im}\\
\mathbf{elif}\;y.im \leq -1.15 \cdot 10^{-24} \lor \neg \left(y.im \leq 5.8 \cdot 10^{-43}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -2.74999999999999988e53 or -6.49999999999999979e22 < y.im < -1.1500000000000001e-24 or 5.8000000000000003e-43 < y.im Initial program 54.1%
Taylor expanded in y.re around 0 61.4%
mul-1-neg61.4%
distribute-neg-frac261.4%
Simplified61.4%
if -2.74999999999999988e53 < y.im < -6.49999999999999979e22Initial program 99.4%
Taylor expanded in y.re around 0 88.0%
+-commutative88.0%
mul-1-neg88.0%
unsub-neg88.0%
unpow288.0%
associate-/r*88.4%
div-sub88.4%
*-commutative88.4%
associate-/l*88.2%
Simplified88.2%
Taylor expanded in y.re around inf 88.2%
+-commutative88.2%
mul-1-neg88.2%
unsub-neg88.2%
Simplified88.2%
Taylor expanded in y.re around inf 77.1%
associate-/l*71.1%
Simplified71.1%
if -1.1500000000000001e-24 < y.im < 5.8000000000000003e-43Initial program 74.0%
Taylor expanded in y.re around inf 68.6%
Final simplification65.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ x.re (- y.im))))
(if (<= y.im -1.75e+55)
t_0
(if (<= y.im -2.4e+18)
(* (/ x.im y.im) (/ y.re y.im))
(if (or (<= y.im -7.4e-25) (not (<= y.im 3.2e-41)))
t_0
(/ x.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_im;
double tmp;
if (y_46_im <= -1.75e+55) {
tmp = t_0;
} else if (y_46_im <= -2.4e+18) {
tmp = (x_46_im / y_46_im) * (y_46_re / y_46_im);
} else if ((y_46_im <= -7.4e-25) || !(y_46_im <= 3.2e-41)) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = x_46re / -y_46im
if (y_46im <= (-1.75d+55)) then
tmp = t_0
else if (y_46im <= (-2.4d+18)) then
tmp = (x_46im / y_46im) * (y_46re / y_46im)
else if ((y_46im <= (-7.4d-25)) .or. (.not. (y_46im <= 3.2d-41))) then
tmp = t_0
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 t_0 = x_46_re / -y_46_im;
double tmp;
if (y_46_im <= -1.75e+55) {
tmp = t_0;
} else if (y_46_im <= -2.4e+18) {
tmp = (x_46_im / y_46_im) * (y_46_re / y_46_im);
} else if ((y_46_im <= -7.4e-25) || !(y_46_im <= 3.2e-41)) {
tmp = t_0;
} else {
tmp = x_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_im tmp = 0 if y_46_im <= -1.75e+55: tmp = t_0 elif y_46_im <= -2.4e+18: tmp = (x_46_im / y_46_im) * (y_46_re / y_46_im) elif (y_46_im <= -7.4e-25) or not (y_46_im <= 3.2e-41): tmp = t_0 else: tmp = x_46_im / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(x_46_re / Float64(-y_46_im)) tmp = 0.0 if (y_46_im <= -1.75e+55) tmp = t_0; elseif (y_46_im <= -2.4e+18) tmp = Float64(Float64(x_46_im / y_46_im) * Float64(y_46_re / y_46_im)); elseif ((y_46_im <= -7.4e-25) || !(y_46_im <= 3.2e-41)) tmp = t_0; 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) t_0 = x_46_re / -y_46_im; tmp = 0.0; if (y_46_im <= -1.75e+55) tmp = t_0; elseif (y_46_im <= -2.4e+18) tmp = (x_46_im / y_46_im) * (y_46_re / y_46_im); elseif ((y_46_im <= -7.4e-25) || ~((y_46_im <= 3.2e-41))) tmp = t_0; 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_] := Block[{t$95$0 = N[(x$46$re / (-y$46$im)), $MachinePrecision]}, If[LessEqual[y$46$im, -1.75e+55], t$95$0, If[LessEqual[y$46$im, -2.4e+18], N[(N[(x$46$im / y$46$im), $MachinePrecision] * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y$46$im, -7.4e-25], N[Not[LessEqual[y$46$im, 3.2e-41]], $MachinePrecision]], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.re}{-y.im}\\
\mathbf{if}\;y.im \leq -1.75 \cdot 10^{+55}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -2.4 \cdot 10^{+18}:\\
\;\;\;\;\frac{x.im}{y.im} \cdot \frac{y.re}{y.im}\\
\mathbf{elif}\;y.im \leq -7.4 \cdot 10^{-25} \lor \neg \left(y.im \leq 3.2 \cdot 10^{-41}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -1.75000000000000005e55 or -2.4e18 < y.im < -7.40000000000000017e-25 or 3.20000000000000012e-41 < y.im Initial program 54.1%
Taylor expanded in y.re around 0 61.4%
mul-1-neg61.4%
distribute-neg-frac261.4%
Simplified61.4%
if -1.75000000000000005e55 < y.im < -2.4e18Initial program 99.4%
Taylor expanded in y.re around 0 88.0%
+-commutative88.0%
mul-1-neg88.0%
unsub-neg88.0%
unpow288.0%
associate-/r*88.4%
div-sub88.4%
*-commutative88.4%
associate-/l*88.2%
Simplified88.2%
Taylor expanded in y.re around inf 88.2%
+-commutative88.2%
mul-1-neg88.2%
unsub-neg88.2%
Simplified88.2%
Taylor expanded in y.re around inf 76.7%
unpow276.7%
times-frac70.5%
Simplified70.5%
if -7.40000000000000017e-25 < y.im < 3.20000000000000012e-41Initial program 74.0%
Taylor expanded in y.re around inf 68.6%
Final simplification65.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -41000000000.0) (not (<= y.im 5.5e+42))) (/ (- (* y.re (/ x.im y.im)) x.re) y.im) (/ (- x.im (/ (* y.im x.re) y.re)) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -41000000000.0) || !(y_46_im <= 5.5e+42)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-41000000000.0d0)) .or. (.not. (y_46im <= 5.5d+42))) then
tmp = ((y_46re * (x_46im / y_46im)) - x_46re) / y_46im
else
tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -41000000000.0) || !(y_46_im <= 5.5e+42)) {
tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im;
} else {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -41000000000.0) or not (y_46_im <= 5.5e+42): tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im else: tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -41000000000.0) || !(y_46_im <= 5.5e+42)) tmp = Float64(Float64(Float64(y_46_re * Float64(x_46_im / y_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -41000000000.0) || ~((y_46_im <= 5.5e+42))) tmp = ((y_46_re * (x_46_im / y_46_im)) - x_46_re) / y_46_im; else tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -41000000000.0], N[Not[LessEqual[y$46$im, 5.5e+42]], $MachinePrecision]], N[(N[(N[(y$46$re * N[(x$46$im / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -41000000000 \lor \neg \left(y.im \leq 5.5 \cdot 10^{+42}\right):\\
\;\;\;\;\frac{y.re \cdot \frac{x.im}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -4.1e10 or 5.50000000000000001e42 < y.im Initial program 52.7%
Taylor expanded in y.re around 0 72.6%
+-commutative72.6%
mul-1-neg72.6%
unsub-neg72.6%
unpow272.6%
associate-/r*75.1%
div-sub75.1%
*-commutative75.1%
associate-/l*80.9%
Simplified80.9%
if -4.1e10 < y.im < 5.50000000000000001e42Initial program 75.2%
Taylor expanded in y.re around inf 83.4%
mul-1-neg83.4%
unsub-neg83.4%
associate-/l*83.3%
Simplified83.3%
associate-*r/83.4%
add-sqr-sqrt42.9%
sqrt-prod69.3%
sqr-neg69.3%
sqrt-unprod29.7%
add-sqr-sqrt64.9%
*-commutative64.9%
add-sqr-sqrt29.7%
sqrt-unprod69.3%
sqr-neg69.3%
sqrt-prod42.9%
add-sqr-sqrt83.4%
Applied egg-rr83.4%
Final simplification82.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -5.4e+112) (not (<= y.im 7e+41))) (/ x.re (- y.im)) (/ (- x.im (* x.re (/ y.im y.re))) y.re)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -5.4e+112) || !(y_46_im <= 7e+41)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46im <= (-5.4d+112)) .or. (.not. (y_46im <= 7d+41))) then
tmp = x_46re / -y_46im
else
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_im <= -5.4e+112) || !(y_46_im <= 7e+41)) {
tmp = x_46_re / -y_46_im;
} else {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_im <= -5.4e+112) or not (y_46_im <= 7e+41): tmp = x_46_re / -y_46_im else: tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_im <= -5.4e+112) || !(y_46_im <= 7e+41)) tmp = Float64(x_46_re / Float64(-y_46_im)); else tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -5.4e+112) || ~((y_46_im <= 7e+41))) tmp = x_46_re / -y_46_im; else tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$im, -5.4e+112], N[Not[LessEqual[y$46$im, 7e+41]], $MachinePrecision]], N[(x$46$re / (-y$46$im)), $MachinePrecision], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.4 \cdot 10^{+112} \lor \neg \left(y.im \leq 7 \cdot 10^{+41}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -5.4000000000000002e112 or 6.9999999999999998e41 < y.im Initial program 47.6%
Taylor expanded in y.re around 0 66.4%
mul-1-neg66.4%
distribute-neg-frac266.4%
Simplified66.4%
if -5.4000000000000002e112 < y.im < 6.9999999999999998e41Initial program 75.0%
Taylor expanded in y.re around inf 76.2%
mul-1-neg76.2%
unsub-neg76.2%
associate-/l*76.8%
Simplified76.8%
Final simplification72.9%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -4.5e+94) (not (<= y.im 1.15e-41))) (/ 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 <= -4.5e+94) || !(y_46_im <= 1.15e-41)) {
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 <= (-4.5d+94)) .or. (.not. (y_46im <= 1.15d-41))) 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 <= -4.5e+94) || !(y_46_im <= 1.15e-41)) {
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 <= -4.5e+94) or not (y_46_im <= 1.15e-41): 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 <= -4.5e+94) || !(y_46_im <= 1.15e-41)) 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 <= -4.5e+94) || ~((y_46_im <= 1.15e-41))) 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, -4.5e+94], N[Not[LessEqual[y$46$im, 1.15e-41]], $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 -4.5 \cdot 10^{+94} \lor \neg \left(y.im \leq 1.15 \cdot 10^{-41}\right):\\
\;\;\;\;\frac{x.re}{-y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -4.49999999999999972e94 or 1.15000000000000005e-41 < y.im Initial program 52.0%
Taylor expanded in y.re around 0 64.0%
mul-1-neg64.0%
distribute-neg-frac264.0%
Simplified64.0%
if -4.49999999999999972e94 < y.im < 1.15000000000000005e-41Initial program 74.5%
Taylor expanded in y.re around inf 62.9%
Final simplification63.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -2.5e+212) (not (<= y.im 1.32e+88))) (/ 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 <= -2.5e+212) || !(y_46_im <= 1.32e+88)) {
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 <= (-2.5d+212)) .or. (.not. (y_46im <= 1.32d+88))) 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 <= -2.5e+212) || !(y_46_im <= 1.32e+88)) {
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 <= -2.5e+212) or not (y_46_im <= 1.32e+88): 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 <= -2.5e+212) || !(y_46_im <= 1.32e+88)) 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 <= -2.5e+212) || ~((y_46_im <= 1.32e+88))) 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, -2.5e+212], N[Not[LessEqual[y$46$im, 1.32e+88]], $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 -2.5 \cdot 10^{+212} \lor \neg \left(y.im \leq 1.32 \cdot 10^{+88}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -2.49999999999999996e212 or 1.3200000000000001e88 < y.im Initial program 46.0%
Taylor expanded in y.re around 0 44.5%
unpow244.5%
Simplified44.5%
Taylor expanded in x.im around 0 39.0%
mul-1-neg40.4%
distribute-rgt-neg-in40.4%
Simplified39.0%
associate-/l*41.7%
clear-num41.7%
add-sqr-sqrt29.0%
sqrt-prod41.7%
sqr-neg41.7%
sqrt-unprod12.6%
add-sqr-sqrt37.2%
distribute-lft-neg-in37.2%
neg-sub037.2%
metadata-eval37.2%
neg-sub037.2%
sub-neg37.2%
add-sqr-sqrt12.6%
sqrt-unprod10.3%
sqr-neg10.3%
sqrt-prod29.0%
add-sqr-sqrt41.7%
flip--71.7%
neg-sub071.7%
add-sqr-sqrt20.5%
sqrt-unprod37.2%
sqr-neg37.2%
sqrt-prod24.2%
add-sqr-sqrt36.6%
Applied egg-rr36.6%
if -2.49999999999999996e212 < y.im < 1.3200000000000001e88Initial program 71.0%
Taylor expanded in y.re around inf 53.4%
Final simplification49.2%
(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.8%
Taylor expanded in y.re around inf 44.3%
herbie shell --seed 2024097
(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))))