
(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
(let* ((t_0 (fma y.im y.im (* y.re y.re)))
(t_1 (fma (/ y.re t_0) x.im (* (- y.im) (/ x.re t_0)))))
(if (<= y.re -2.6e+118)
(/ (- x.im (* x.re (/ y.im y.re))) y.re)
(if (<= y.re -4.6e-65)
t_1
(if (<= y.re 8.2e-105)
(/ (- (/ (* y.re x.im) y.im) x.re) y.im)
(if (<= y.re 8e+112)
t_1
(fma
(fma
(- (* (/ x.re (pow y.re 4.0)) y.im) (/ x.im (pow y.re 3.0)))
y.im
(/ (/ (- x.re) y.re) y.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 t_0 = fma(y_46_im, y_46_im, (y_46_re * y_46_re));
double t_1 = fma((y_46_re / t_0), x_46_im, (-y_46_im * (x_46_re / t_0)));
double tmp;
if (y_46_re <= -2.6e+118) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else if (y_46_re <= -4.6e-65) {
tmp = t_1;
} else if (y_46_re <= 8.2e-105) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else if (y_46_re <= 8e+112) {
tmp = t_1;
} else {
tmp = fma(fma((((x_46_re / pow(y_46_re, 4.0)) * y_46_im) - (x_46_im / pow(y_46_re, 3.0))), y_46_im, ((-x_46_re / y_46_re) / y_46_re)), y_46_im, (x_46_im / y_46_re));
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)) t_1 = fma(Float64(y_46_re / t_0), x_46_im, Float64(Float64(-y_46_im) * Float64(x_46_re / t_0))) tmp = 0.0 if (y_46_re <= -2.6e+118) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); elseif (y_46_re <= -4.6e-65) tmp = t_1; elseif (y_46_re <= 8.2e-105) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); elseif (y_46_re <= 8e+112) tmp = t_1; else tmp = fma(fma(Float64(Float64(Float64(x_46_re / (y_46_re ^ 4.0)) * y_46_im) - Float64(x_46_im / (y_46_re ^ 3.0))), y_46_im, Float64(Float64(Float64(-x_46_re) / y_46_re) / y_46_re)), y_46_im, Float64(x_46_im / y_46_re)); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y$46$re / t$95$0), $MachinePrecision] * x$46$im + N[((-y$46$im) * N[(x$46$re / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.6e+118], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -4.6e-65], t$95$1, If[LessEqual[y$46$re, 8.2e-105], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 8e+112], t$95$1, N[(N[(N[(N[(N[(x$46$re / N[Power[y$46$re, 4.0], $MachinePrecision]), $MachinePrecision] * y$46$im), $MachinePrecision] - N[(x$46$im / N[Power[y$46$re, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y$46$im + N[(N[((-x$46$re) / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] * y$46$im + N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
t_1 := \mathsf{fma}\left(\frac{y.re}{t\_0}, x.im, \left(-y.im\right) \cdot \frac{x.re}{t\_0}\right)\\
\mathbf{if}\;y.re \leq -2.6 \cdot 10^{+118}:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq -4.6 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 8.2 \cdot 10^{-105}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 8 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.re}{{y.re}^{4}} \cdot y.im - \frac{x.im}{{y.re}^{3}}, y.im, \frac{\frac{-x.re}{y.re}}{y.re}\right), y.im, \frac{x.im}{y.re}\right)\\
\end{array}
\end{array}
if y.re < -2.60000000000000016e118Initial program 40.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6473.6
Applied rewrites73.6%
Applied rewrites83.4%
if -2.60000000000000016e118 < y.re < -4.5999999999999999e-65 or 8.20000000000000061e-105 < y.re < 7.9999999999999994e112Initial program 76.6%
Applied rewrites81.4%
if -4.5999999999999999e-65 < y.re < 8.20000000000000061e-105Initial program 70.4%
Taylor expanded in y.re around 0
+-commutativeN/A
fp-cancel-sign-sub-invN/A
unpow2N/A
associate-/r*N/A
metadata-evalN/A
*-lft-identityN/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.2
Applied rewrites93.2%
if 7.9999999999999994e112 < y.re Initial program 31.2%
Taylor expanded in y.im around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites91.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (fma y.im y.im (* y.re y.re)))
(t_1 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.im -5.8e+122)
t_1
(if (<= y.im -3e-83)
(fma (/ y.re t_0) x.im (* (- y.im) (/ x.re t_0)))
(if (<= y.im 6.6e-99)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 7.5e+42)
(/ (- (* x.im y.re) (* x.re y.im)) (fma y.re y.re (* y.im y.im)))
t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(y_46_im, y_46_im, (y_46_re * y_46_re));
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -5.8e+122) {
tmp = t_1;
} else if (y_46_im <= -3e-83) {
tmp = fma((y_46_re / t_0), x_46_im, (-y_46_im * (x_46_re / t_0)));
} else if (y_46_im <= 6.6e-99) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 7.5e+42) {
tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
} else {
tmp = t_1;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)) t_1 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -5.8e+122) tmp = t_1; elseif (y_46_im <= -3e-83) tmp = fma(Float64(y_46_re / t_0), x_46_im, Float64(Float64(-y_46_im) * Float64(x_46_re / t_0))); elseif (y_46_im <= 6.6e-99) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 7.5e+42) tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im))); else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -5.8e+122], t$95$1, If[LessEqual[y$46$im, -3e-83], N[(N[(y$46$re / t$95$0), $MachinePrecision] * x$46$im + N[((-y$46$im) * N[(x$46$re / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.6e-99], 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, 7.5e+42], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
t_1 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -5.8 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -3 \cdot 10^{-83}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y.re}{t\_0}, x.im, \left(-y.im\right) \cdot \frac{x.re}{t\_0}\right)\\
\mathbf{elif}\;y.im \leq 6.6 \cdot 10^{-99}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;\frac{x.im \cdot y.re - x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -5.8000000000000002e122 or 7.50000000000000041e42 < y.im Initial program 35.7%
Taylor expanded in y.re around 0
+-commutativeN/A
fp-cancel-sign-sub-invN/A
unpow2N/A
associate-/r*N/A
metadata-evalN/A
*-lft-identityN/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6480.3
Applied rewrites80.3%
Applied rewrites85.1%
if -5.8000000000000002e122 < y.im < -3.0000000000000001e-83Initial program 79.6%
Applied rewrites82.7%
if -3.0000000000000001e-83 < y.im < 6.59999999999999973e-99Initial program 71.7%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6491.2
Applied rewrites91.2%
if 6.59999999999999973e-99 < y.im < 7.50000000000000041e42Initial program 86.0%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6486.1
Applied rewrites86.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (* x.im y.re) (* x.re y.im)) (fma y.re y.re (* y.im y.im))))
(t_1 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.im -2.5e+116)
t_1
(if (<= y.im -3.3e-83)
t_0
(if (<= y.im 6.6e-99)
(/ (- x.im (/ (* y.im x.re) y.re)) y.re)
(if (<= y.im 7.5e+42) 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_im * y_46_re) - (x_46_re * y_46_im)) / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
double t_1 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -2.5e+116) {
tmp = t_1;
} else if (y_46_im <= -3.3e-83) {
tmp = t_0;
} else if (y_46_im <= 6.6e-99) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else if (y_46_im <= 7.5e+42) {
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_im * y_46_re) - Float64(x_46_re * y_46_im)) / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im))) t_1 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_im <= -2.5e+116) tmp = t_1; elseif (y_46_im <= -3.3e-83) tmp = t_0; elseif (y_46_im <= 6.6e-99) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); elseif (y_46_im <= 7.5e+42) tmp = t_0; else tmp = t_1; end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2.5e+116], t$95$1, If[LessEqual[y$46$im, -3.3e-83], t$95$0, If[LessEqual[y$46$im, 6.6e-99], 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, 7.5e+42], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot y.re - x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\
t_1 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.im \leq -2.5 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq -3.3 \cdot 10^{-83}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 6.6 \cdot 10^{-99}:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 7.5 \cdot 10^{+42}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.im < -2.50000000000000013e116 or 7.50000000000000041e42 < y.im Initial program 36.4%
Taylor expanded in y.re around 0
+-commutativeN/A
fp-cancel-sign-sub-invN/A
unpow2N/A
associate-/r*N/A
metadata-evalN/A
*-lft-identityN/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6480.5
Applied rewrites80.5%
Applied rewrites85.2%
if -2.50000000000000013e116 < y.im < -3.2999999999999999e-83 or 6.59999999999999973e-99 < y.im < 7.50000000000000041e42Initial program 82.1%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6482.1
Applied rewrites82.1%
if -3.2999999999999999e-83 < y.im < 6.59999999999999973e-99Initial program 71.7%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6491.2
Applied rewrites91.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im)))
(if (<= y.im -1.75e+83)
t_0
(if (<= y.im -1e-58)
(/ (fma (- x.re) y.im (* y.re x.im)) (* y.im y.im))
(if (<= y.im 1720.0) (/ (- x.im (/ (* y.im x.re) y.re)) y.re) t_0)))))
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+83) {
tmp = t_0;
} else if (y_46_im <= -1e-58) {
tmp = fma(-x_46_re, y_46_im, (y_46_re * x_46_im)) / (y_46_im * y_46_im);
} else if (y_46_im <= 1720.0) {
tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
} else {
tmp = t_0;
}
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_im) tmp = 0.0 if (y_46_im <= -1.75e+83) tmp = t_0; elseif (y_46_im <= -1e-58) tmp = Float64(fma(Float64(-x_46_re), y_46_im, Float64(y_46_re * x_46_im)) / Float64(y_46_im * y_46_im)); elseif (y_46_im <= 1720.0) tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re); else tmp = t_0; end return 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+83], t$95$0, If[LessEqual[y$46$im, -1e-58], N[(N[((-x$46$re) * y$46$im + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1720.0], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.75 \cdot 10^{+83}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -1 \cdot 10^{-58}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x.re, y.im, y.re \cdot x.im\right)}{y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1720:\\
\;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.74999999999999989e83 or 1720 < y.im Initial program 43.8%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6473.5
Applied rewrites73.5%
if -1.74999999999999989e83 < y.im < -1e-58Initial program 82.1%
Taylor expanded in y.re around 0
unpow2N/A
lower-*.f6461.4
Applied rewrites61.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lower-fma.f6461.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.6
Applied rewrites61.6%
if -1e-58 < y.im < 1720Initial program 74.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6485.6
Applied rewrites85.6%
Final simplification77.9%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im)))
(if (<= y.im -1.75e+83)
t_0
(if (<= y.im -1e-58)
(/ (fma (- x.re) y.im (* y.re x.im)) (* y.im y.im))
(if (<= y.im 1720.0) (/ (- x.im (* x.re (/ y.im y.re))) y.re) t_0)))))
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+83) {
tmp = t_0;
} else if (y_46_im <= -1e-58) {
tmp = fma(-x_46_re, y_46_im, (y_46_re * x_46_im)) / (y_46_im * y_46_im);
} else if (y_46_im <= 1720.0) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = t_0;
}
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_im) tmp = 0.0 if (y_46_im <= -1.75e+83) tmp = t_0; elseif (y_46_im <= -1e-58) tmp = Float64(fma(Float64(-x_46_re), y_46_im, Float64(y_46_re * x_46_im)) / Float64(y_46_im * y_46_im)); elseif (y_46_im <= 1720.0) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = t_0; end return 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+83], t$95$0, If[LessEqual[y$46$im, -1e-58], N[(N[((-x$46$re) * y$46$im + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1720.0], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.75 \cdot 10^{+83}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -1 \cdot 10^{-58}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x.re, y.im, y.re \cdot x.im\right)}{y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1720:\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.74999999999999989e83 or 1720 < y.im Initial program 43.8%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6473.5
Applied rewrites73.5%
if -1.74999999999999989e83 < y.im < -1e-58Initial program 82.1%
Taylor expanded in y.re around 0
unpow2N/A
lower-*.f6461.4
Applied rewrites61.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lower-fma.f6461.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.6
Applied rewrites61.6%
if -1e-58 < y.im < 1720Initial program 74.3%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6485.6
Applied rewrites85.6%
Applied rewrites84.6%
Final simplification77.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.3e+15) (not (<= y.re 6.2e+16))) (/ (- x.im (* x.re (/ y.im y.re))) y.re) (/ (- (/ (* y.re x.im) y.im) x.re) y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.3e+15) || !(y_46_re <= 6.2e+16)) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.3d+15)) .or. (.not. (y_46re <= 6.2d+16))) then
tmp = (x_46im - (x_46re * (y_46im / y_46re))) / y_46re
else
tmp = (((y_46re * x_46im) / y_46im) - x_46re) / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.3e+15) || !(y_46_re <= 6.2e+16)) {
tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re;
} else {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.3e+15) or not (y_46_re <= 6.2e+16): tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re else: tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.3e+15) || !(y_46_re <= 6.2e+16)) tmp = Float64(Float64(x_46_im - Float64(x_46_re * Float64(y_46_im / y_46_re))) / y_46_re); else tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.3e+15) || ~((y_46_re <= 6.2e+16))) tmp = (x_46_im - (x_46_re * (y_46_im / y_46_re))) / y_46_re; else tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.3e+15], N[Not[LessEqual[y$46$re, 6.2e+16]], $MachinePrecision]], N[(N[(x$46$im - N[(x$46$re * N[(y$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.3 \cdot 10^{+15} \lor \neg \left(y.re \leq 6.2 \cdot 10^{+16}\right):\\
\;\;\;\;\frac{x.im - x.re \cdot \frac{y.im}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -1.3e15 or 6.2e16 < y.re Initial program 49.5%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6473.1
Applied rewrites73.1%
Applied rewrites78.5%
if -1.3e15 < y.re < 6.2e16Initial program 73.1%
Taylor expanded in y.re around 0
+-commutativeN/A
fp-cancel-sign-sub-invN/A
unpow2N/A
associate-/r*N/A
metadata-evalN/A
*-lft-identityN/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6483.0
Applied rewrites83.0%
Final simplification81.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -1.9e-76) (not (<= y.im 1650.0))) (/ (- (* x.im (/ y.re 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 <= -1.9e-76) || !(y_46_im <= 1650.0)) {
tmp = ((x_46_im * (y_46_re / 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 <= (-1.9d-76)) .or. (.not. (y_46im <= 1650.0d0))) then
tmp = ((x_46im * (y_46re / 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 <= -1.9e-76) || !(y_46_im <= 1650.0)) {
tmp = ((x_46_im * (y_46_re / 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 <= -1.9e-76) or not (y_46_im <= 1650.0): tmp = ((x_46_im * (y_46_re / 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 <= -1.9e-76) || !(y_46_im <= 1650.0)) tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / 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 <= -1.9e-76) || ~((y_46_im <= 1650.0))) tmp = ((x_46_im * (y_46_re / 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, -1.9e-76], N[Not[LessEqual[y$46$im, 1650.0]], $MachinePrecision]], N[(N[(N[(x$46$im * N[(y$46$re / 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 -1.9 \cdot 10^{-76} \lor \neg \left(y.im \leq 1650\right):\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{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 < -1.9000000000000001e-76 or 1650 < y.im Initial program 52.4%
Taylor expanded in y.re around 0
+-commutativeN/A
fp-cancel-sign-sub-invN/A
unpow2N/A
associate-/r*N/A
metadata-evalN/A
*-lft-identityN/A
div-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6473.6
Applied rewrites73.6%
Applied rewrites76.1%
if -1.9000000000000001e-76 < y.im < 1650Initial program 73.9%
Taylor expanded in y.re around inf
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6486.2
Applied rewrites86.2%
Final simplification80.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im)))
(if (<= y.im -1.75e+83)
t_0
(if (<= y.im -2.7e-59)
(/ (fma (- x.re) y.im (* y.re x.im)) (* y.im y.im))
(if (<= y.im 9.2e-9) (/ x.im y.re) t_0)))))
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+83) {
tmp = t_0;
} else if (y_46_im <= -2.7e-59) {
tmp = fma(-x_46_re, y_46_im, (y_46_re * x_46_im)) / (y_46_im * y_46_im);
} else if (y_46_im <= 9.2e-9) {
tmp = x_46_im / y_46_re;
} else {
tmp = t_0;
}
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_im) tmp = 0.0 if (y_46_im <= -1.75e+83) tmp = t_0; elseif (y_46_im <= -2.7e-59) tmp = Float64(fma(Float64(-x_46_re), y_46_im, Float64(y_46_re * x_46_im)) / Float64(y_46_im * y_46_im)); elseif (y_46_im <= 9.2e-9) tmp = Float64(x_46_im / y_46_re); else tmp = t_0; end return 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+83], t$95$0, If[LessEqual[y$46$im, -2.7e-59], N[(N[((-x$46$re) * y$46$im + N[(y$46$re * x$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.2e-9], N[(x$46$im / y$46$re), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -1.75 \cdot 10^{+83}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -2.7 \cdot 10^{-59}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x.re, y.im, y.re \cdot x.im\right)}{y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 9.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.74999999999999989e83 or 9.1999999999999997e-9 < y.im Initial program 43.9%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6473.1
Applied rewrites73.1%
if -1.74999999999999989e83 < y.im < -2.6999999999999999e-59Initial program 82.1%
Taylor expanded in y.re around 0
unpow2N/A
lower-*.f6461.4
Applied rewrites61.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
+-commutativeN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lower-fma.f6461.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6461.6
Applied rewrites61.6%
if -2.6999999999999999e-59 < y.im < 9.1999999999999997e-9Initial program 74.7%
Taylor expanded in y.re around inf
lower-/.f6473.6
Applied rewrites73.6%
Final simplification72.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.re) y.im)))
(if (<= y.im -4.8e+121)
t_0
(if (<= y.im -2.2e-64)
(* (- x.re) (/ y.im (fma y.im y.im (* y.re y.re))))
(if (<= y.im 9.2e-9) (/ x.im y.re) t_0)))))
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 <= -4.8e+121) {
tmp = t_0;
} else if (y_46_im <= -2.2e-64) {
tmp = -x_46_re * (y_46_im / fma(y_46_im, y_46_im, (y_46_re * y_46_re)));
} else if (y_46_im <= 9.2e-9) {
tmp = x_46_im / y_46_re;
} else {
tmp = t_0;
}
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_im) tmp = 0.0 if (y_46_im <= -4.8e+121) tmp = t_0; elseif (y_46_im <= -2.2e-64) tmp = Float64(Float64(-x_46_re) * Float64(y_46_im / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))); elseif (y_46_im <= 9.2e-9) tmp = Float64(x_46_im / y_46_re); else tmp = t_0; end return 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, -4.8e+121], t$95$0, If[LessEqual[y$46$im, -2.2e-64], N[((-x$46$re) * N[(y$46$im / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.2e-9], N[(x$46$im / y$46$re), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -4.8 \cdot 10^{+121}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq -2.2 \cdot 10^{-64}:\\
\;\;\;\;\left(-x.re\right) \cdot \frac{y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{elif}\;y.im \leq 9.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -4.8e121 or 9.1999999999999997e-9 < y.im Initial program 42.3%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6474.7
Applied rewrites74.7%
if -4.8e121 < y.im < -2.2e-64Initial program 77.9%
Taylor expanded in x.re around inf
associate-/l*N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6459.6
Applied rewrites59.6%
if -2.2e-64 < y.im < 9.1999999999999997e-9Initial program 74.7%
Taylor expanded in y.re around inf
lower-/.f6473.6
Applied rewrites73.6%
Final simplification72.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.5e-59) (not (<= y.im 9.2e-9))) (/ (- 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 <= -3.5e-59) || !(y_46_im <= 9.2e-9)) {
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 <= (-3.5d-59)) .or. (.not. (y_46im <= 9.2d-9))) 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 <= -3.5e-59) || !(y_46_im <= 9.2e-9)) {
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 <= -3.5e-59) or not (y_46_im <= 9.2e-9): 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 <= -3.5e-59) || !(y_46_im <= 9.2e-9)) tmp = Float64(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 <= -3.5e-59) || ~((y_46_im <= 9.2e-9))) 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, -3.5e-59], N[Not[LessEqual[y$46$im, 9.2e-9]], $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 -3.5 \cdot 10^{-59} \lor \neg \left(y.im \leq 9.2 \cdot 10^{-9}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -3.5000000000000001e-59 or 9.1999999999999997e-9 < y.im Initial program 51.7%
Taylor expanded in y.re around 0
mul-1-negN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6465.2
Applied rewrites65.2%
if -3.5000000000000001e-59 < y.im < 9.1999999999999997e-9Initial program 74.7%
Taylor expanded in y.re around inf
lower-/.f6473.6
Applied rewrites73.6%
Final simplification69.1%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -5.7e+160) (not (<= y.im 8.1e+192))) (/ 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 <= -5.7e+160) || !(y_46_im <= 8.1e+192)) {
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 <= (-5.7d+160)) .or. (.not. (y_46im <= 8.1d+192))) 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 <= -5.7e+160) || !(y_46_im <= 8.1e+192)) {
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 <= -5.7e+160) or not (y_46_im <= 8.1e+192): 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 <= -5.7e+160) || !(y_46_im <= 8.1e+192)) 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 <= -5.7e+160) || ~((y_46_im <= 8.1e+192))) 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, -5.7e+160], N[Not[LessEqual[y$46$im, 8.1e+192]], $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 -5.7 \cdot 10^{+160} \lor \neg \left(y.im \leq 8.1 \cdot 10^{+192}\right):\\
\;\;\;\;\frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -5.6999999999999999e160 or 8.10000000000000019e192 < y.im Initial program 28.2%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6428.2
Applied rewrites28.2%
Taylor expanded in y.re around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6483.2
Applied rewrites83.2%
Applied rewrites61.6%
Applied rewrites29.5%
if -5.6999999999999999e160 < y.im < 8.10000000000000019e192Initial program 72.6%
Taylor expanded in y.re around inf
lower-/.f6454.7
Applied rewrites54.7%
Final simplification48.9%
(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 62.4%
Taylor expanded in y.re around inf
lower-/.f6445.1
Applied rewrites45.1%
herbie shell --seed 2024339
(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))))