
(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 10 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 (* (/ x.re t_0) (- y.im))))
(t_2 (/ (fma x.im (/ y.re y.im) (- x.re)) y.im)))
(if (<= y.im -2.2e+103)
t_2
(if (<= y.im -1.9e-43)
t_1
(if (<= y.im 3.1e-163)
(/ (- x.im (/ (* x.re y.im) y.re)) y.re)
(if (<= y.im 2.5e+125) t_1 t_2))))))
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, ((x_46_re / t_0) * -y_46_im));
double t_2 = fma(x_46_im, (y_46_re / y_46_im), -x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -2.2e+103) {
tmp = t_2;
} else if (y_46_im <= -1.9e-43) {
tmp = t_1;
} else if (y_46_im <= 3.1e-163) {
tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= 2.5e+125) {
tmp = t_1;
} else {
tmp = t_2;
}
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(x_46_re / t_0) * Float64(-y_46_im))) t_2 = Float64(fma(x_46_im, Float64(y_46_re / y_46_im), Float64(-x_46_re)) / y_46_im) tmp = 0.0 if (y_46_im <= -2.2e+103) tmp = t_2; elseif (y_46_im <= -1.9e-43) tmp = t_1; elseif (y_46_im <= 3.1e-163) tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_im <= 2.5e+125) tmp = t_1; else tmp = t_2; 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[(N[(x$46$re / t$95$0), $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision] + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2.2e+103], t$95$2, If[LessEqual[y$46$im, -1.9e-43], t$95$1, If[LessEqual[y$46$im, 3.1e-163], N[(N[(x$46$im - N[(N[(x$46$re * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 2.5e+125], t$95$1, t$95$2]]]]]]]
\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, \frac{x.re}{t\_0} \cdot \left(-y.im\right)\right)\\
t_2 := \frac{\mathsf{fma}\left(x.im, \frac{y.re}{y.im}, -x.re\right)}{y.im}\\
\mathbf{if}\;y.im \leq -2.2 \cdot 10^{+103}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.im \leq -1.9 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.im \leq 3.1 \cdot 10^{-163}:\\
\;\;\;\;\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 2.5 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.im < -2.19999999999999992e103 or 2.49999999999999981e125 < y.im Initial program 37.8%
Taylor expanded in y.im around 0
lower-/.f649.0
Applied rewrites9.0%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6484.7
Applied rewrites84.7%
Applied rewrites91.9%
if -2.19999999999999992e103 < y.im < -1.89999999999999985e-43 or 3.09999999999999975e-163 < y.im < 2.49999999999999981e125Initial program 83.8%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
sub-negN/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
Applied rewrites86.0%
if -1.89999999999999985e-43 < y.im < 3.09999999999999975e-163Initial program 69.0%
Taylor expanded in y.im around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
unpow2N/A
associate-/r*N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6489.0
Applied rewrites89.0%
Final simplification88.6%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (- (* y.re x.im) (* x.re y.im))) (t_1 (/ t_0 (* y.re y.re))))
(if (<= y.re -1.8e+62)
(/ x.im y.re)
(if (<= y.re -2e-10)
t_1
(if (<= y.re 4e-286)
(/ (- x.re) y.im)
(if (<= y.re 13000000000.0)
(/ t_0 (* y.im y.im))
(if (<= y.re 2.1e+106) t_1 (/ 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 = (y_46_re * x_46_im) - (x_46_re * y_46_im);
double t_1 = t_0 / (y_46_re * y_46_re);
double tmp;
if (y_46_re <= -1.8e+62) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -2e-10) {
tmp = t_1;
} else if (y_46_re <= 4e-286) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 13000000000.0) {
tmp = t_0 / (y_46_im * y_46_im);
} else if (y_46_re <= 2.1e+106) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = (y_46re * x_46im) - (x_46re * y_46im)
t_1 = t_0 / (y_46re * y_46re)
if (y_46re <= (-1.8d+62)) then
tmp = x_46im / y_46re
else if (y_46re <= (-2d-10)) then
tmp = t_1
else if (y_46re <= 4d-286) then
tmp = -x_46re / y_46im
else if (y_46re <= 13000000000.0d0) then
tmp = t_0 / (y_46im * y_46im)
else if (y_46re <= 2.1d+106) then
tmp = t_1
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 = (y_46_re * x_46_im) - (x_46_re * y_46_im);
double t_1 = t_0 / (y_46_re * y_46_re);
double tmp;
if (y_46_re <= -1.8e+62) {
tmp = x_46_im / y_46_re;
} else if (y_46_re <= -2e-10) {
tmp = t_1;
} else if (y_46_re <= 4e-286) {
tmp = -x_46_re / y_46_im;
} else if (y_46_re <= 13000000000.0) {
tmp = t_0 / (y_46_im * y_46_im);
} else if (y_46_re <= 2.1e+106) {
tmp = t_1;
} 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 = (y_46_re * x_46_im) - (x_46_re * y_46_im) t_1 = t_0 / (y_46_re * y_46_re) tmp = 0 if y_46_re <= -1.8e+62: tmp = x_46_im / y_46_re elif y_46_re <= -2e-10: tmp = t_1 elif y_46_re <= 4e-286: tmp = -x_46_re / y_46_im elif y_46_re <= 13000000000.0: tmp = t_0 / (y_46_im * y_46_im) elif y_46_re <= 2.1e+106: tmp = t_1 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(Float64(y_46_re * x_46_im) - Float64(x_46_re * y_46_im)) t_1 = Float64(t_0 / Float64(y_46_re * y_46_re)) tmp = 0.0 if (y_46_re <= -1.8e+62) tmp = Float64(x_46_im / y_46_re); elseif (y_46_re <= -2e-10) tmp = t_1; elseif (y_46_re <= 4e-286) tmp = Float64(Float64(-x_46_re) / y_46_im); elseif (y_46_re <= 13000000000.0) tmp = Float64(t_0 / Float64(y_46_im * y_46_im)); elseif (y_46_re <= 2.1e+106) tmp = t_1; 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 = (y_46_re * x_46_im) - (x_46_re * y_46_im); t_1 = t_0 / (y_46_re * y_46_re); tmp = 0.0; if (y_46_re <= -1.8e+62) tmp = x_46_im / y_46_re; elseif (y_46_re <= -2e-10) tmp = t_1; elseif (y_46_re <= 4e-286) tmp = -x_46_re / y_46_im; elseif (y_46_re <= 13000000000.0) tmp = t_0 / (y_46_im * y_46_im); elseif (y_46_re <= 2.1e+106) tmp = t_1; 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[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.8e+62], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -2e-10], t$95$1, If[LessEqual[y$46$re, 4e-286], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 13000000000.0], N[(t$95$0 / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.1e+106], t$95$1, N[(x$46$im / y$46$re), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y.re \cdot x.im - x.re \cdot y.im\\
t_1 := \frac{t\_0}{y.re \cdot y.re}\\
\mathbf{if}\;y.re \leq -1.8 \cdot 10^{+62}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.re \leq -2 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 4 \cdot 10^{-286}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{elif}\;y.re \leq 13000000000:\\
\;\;\;\;\frac{t\_0}{y.im \cdot y.im}\\
\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{+106}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.re < -1.8e62 or 2.10000000000000005e106 < y.re Initial program 45.6%
Taylor expanded in y.im around 0
lower-/.f6479.0
Applied rewrites79.0%
if -1.8e62 < y.re < -2.00000000000000007e-10 or 1.3e10 < y.re < 2.10000000000000005e106Initial program 80.9%
Taylor expanded in y.im around 0
unpow2N/A
lower-*.f6473.7
Applied rewrites73.7%
if -2.00000000000000007e-10 < y.re < 4.0000000000000002e-286Initial program 65.5%
Taylor expanded in y.im around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6464.3
Applied rewrites64.3%
if 4.0000000000000002e-286 < y.re < 1.3e10Initial program 84.6%
Taylor expanded in y.im around inf
unpow2N/A
lower-*.f6475.0
Applied rewrites75.0%
Final simplification73.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (fma x.im (/ y.re y.im) (- x.re)) y.im)))
(if (<= y.im -3.7e+28)
t_0
(if (<= y.im 3.1e-163)
(/ (- x.im (/ (* x.re y.im) y.re)) y.re)
(if (<= y.im 5e+127)
(/ (- (* y.re x.im) (* x.re y.im)) (+ (* y.im 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 = fma(x_46_im, (y_46_re / y_46_im), -x_46_re) / y_46_im;
double tmp;
if (y_46_im <= -3.7e+28) {
tmp = t_0;
} else if (y_46_im <= 3.1e-163) {
tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= 5e+127) {
tmp = ((y_46_re * x_46_im) - (x_46_re * y_46_im)) / ((y_46_im * 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(fma(x_46_im, Float64(y_46_re / y_46_im), Float64(-x_46_re)) / y_46_im) tmp = 0.0 if (y_46_im <= -3.7e+28) tmp = t_0; elseif (y_46_im <= 3.1e-163) tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_im <= 5e+127) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_im * y_46_im) + Float64(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[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision] + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -3.7e+28], t$95$0, If[LessEqual[y$46$im, 3.1e-163], N[(N[(x$46$im - N[(N[(x$46$re * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5e+127], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$im * y$46$im), $MachinePrecision] + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x.im, \frac{y.re}{y.im}, -x.re\right)}{y.im}\\
\mathbf{if}\;y.im \leq -3.7 \cdot 10^{+28}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 3.1 \cdot 10^{-163}:\\
\;\;\;\;\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{+127}:\\
\;\;\;\;\frac{y.re \cdot x.im - x.re \cdot y.im}{y.im \cdot y.im + y.re \cdot y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -3.6999999999999999e28 or 5.0000000000000004e127 < y.im Initial program 44.5%
Taylor expanded in y.im around 0
lower-/.f649.6
Applied rewrites9.6%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6481.8
Applied rewrites81.8%
Applied rewrites87.4%
if -3.6999999999999999e28 < y.im < 3.09999999999999975e-163Initial program 71.1%
Taylor expanded in y.im around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
unpow2N/A
associate-/r*N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6487.1
Applied rewrites87.1%
if 3.09999999999999975e-163 < y.im < 5.0000000000000004e127Initial program 84.6%
Final simplification86.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -2.2e+30)
(/ -1.0 (/ y.im x.re))
(if (<= y.im 3.9e-82)
(/ (- x.im (/ (* x.re y.im) y.re)) y.re)
(if (<= y.im 5.2e+127)
(/ (- (* y.re x.im) (* x.re y.im)) (* y.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_im <= -2.2e+30) {
tmp = -1.0 / (y_46_im / x_46_re);
} else if (y_46_im <= 3.9e-82) {
tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= 5.2e+127) {
tmp = ((y_46_re * x_46_im) - (x_46_re * y_46_im)) / (y_46_im * y_46_im);
} else {
tmp = -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_46im <= (-2.2d+30)) then
tmp = (-1.0d0) / (y_46im / x_46re)
else if (y_46im <= 3.9d-82) then
tmp = (x_46im - ((x_46re * y_46im) / y_46re)) / y_46re
else if (y_46im <= 5.2d+127) then
tmp = ((y_46re * x_46im) - (x_46re * y_46im)) / (y_46im * y_46im)
else
tmp = -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_im <= -2.2e+30) {
tmp = -1.0 / (y_46_im / x_46_re);
} else if (y_46_im <= 3.9e-82) {
tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
} else if (y_46_im <= 5.2e+127) {
tmp = ((y_46_re * x_46_im) - (x_46_re * y_46_im)) / (y_46_im * y_46_im);
} else {
tmp = -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_im <= -2.2e+30: tmp = -1.0 / (y_46_im / x_46_re) elif y_46_im <= 3.9e-82: tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re elif y_46_im <= 5.2e+127: tmp = ((y_46_re * x_46_im) - (x_46_re * y_46_im)) / (y_46_im * y_46_im) else: tmp = -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_im <= -2.2e+30) tmp = Float64(-1.0 / Float64(y_46_im / x_46_re)); elseif (y_46_im <= 3.9e-82) tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re * y_46_im) / y_46_re)) / y_46_re); elseif (y_46_im <= 5.2e+127) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(x_46_re * y_46_im)) / Float64(y_46_im * y_46_im)); else tmp = Float64(Float64(-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_im <= -2.2e+30) tmp = -1.0 / (y_46_im / x_46_re); elseif (y_46_im <= 3.9e-82) tmp = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re; elseif (y_46_im <= 5.2e+127) tmp = ((y_46_re * x_46_im) - (x_46_re * y_46_im)) / (y_46_im * y_46_im); else tmp = -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[LessEqual[y$46$im, -2.2e+30], N[(-1.0 / N[(y$46$im / x$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.9e-82], N[(N[(x$46$im - N[(N[(x$46$re * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5.2e+127], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], N[((-x$46$re) / y$46$im), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -2.2 \cdot 10^{+30}:\\
\;\;\;\;\frac{-1}{\frac{y.im}{x.re}}\\
\mathbf{elif}\;y.im \leq 3.9 \cdot 10^{-82}:\\
\;\;\;\;\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 5.2 \cdot 10^{+127}:\\
\;\;\;\;\frac{y.re \cdot x.im - x.re \cdot y.im}{y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -2.2e30Initial program 48.9%
Taylor expanded in y.im around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6474.6
Applied rewrites74.6%
Applied rewrites75.3%
if -2.2e30 < y.im < 3.89999999999999973e-82Initial program 73.7%
Taylor expanded in y.im around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
unpow2N/A
associate-/r*N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6484.9
Applied rewrites84.9%
if 3.89999999999999973e-82 < y.im < 5.2000000000000004e127Initial program 84.8%
Taylor expanded in y.im around inf
unpow2N/A
lower-*.f6461.6
Applied rewrites61.6%
if 5.2000000000000004e127 < y.im Initial program 35.2%
Taylor expanded in y.im around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6476.2
Applied rewrites76.2%
Final simplification77.1%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.2e+28)
(/ -1.0 (/ y.im x.re))
(if (<= y.im 2.75e-82)
(/ x.im y.re)
(if (<= y.im 5.2e+127)
(/ (- (* y.re x.im) (* x.re y.im)) (* y.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_im <= -1.2e+28) {
tmp = -1.0 / (y_46_im / x_46_re);
} else if (y_46_im <= 2.75e-82) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 5.2e+127) {
tmp = ((y_46_re * x_46_im) - (x_46_re * y_46_im)) / (y_46_im * y_46_im);
} else {
tmp = -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_46im <= (-1.2d+28)) then
tmp = (-1.0d0) / (y_46im / x_46re)
else if (y_46im <= 2.75d-82) then
tmp = x_46im / y_46re
else if (y_46im <= 5.2d+127) then
tmp = ((y_46re * x_46im) - (x_46re * y_46im)) / (y_46im * y_46im)
else
tmp = -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_im <= -1.2e+28) {
tmp = -1.0 / (y_46_im / x_46_re);
} else if (y_46_im <= 2.75e-82) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 5.2e+127) {
tmp = ((y_46_re * x_46_im) - (x_46_re * y_46_im)) / (y_46_im * y_46_im);
} else {
tmp = -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_im <= -1.2e+28: tmp = -1.0 / (y_46_im / x_46_re) elif y_46_im <= 2.75e-82: tmp = x_46_im / y_46_re elif y_46_im <= 5.2e+127: tmp = ((y_46_re * x_46_im) - (x_46_re * y_46_im)) / (y_46_im * y_46_im) else: tmp = -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_im <= -1.2e+28) tmp = Float64(-1.0 / Float64(y_46_im / x_46_re)); elseif (y_46_im <= 2.75e-82) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 5.2e+127) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(x_46_re * y_46_im)) / Float64(y_46_im * y_46_im)); else tmp = Float64(Float64(-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_im <= -1.2e+28) tmp = -1.0 / (y_46_im / x_46_re); elseif (y_46_im <= 2.75e-82) tmp = x_46_im / y_46_re; elseif (y_46_im <= 5.2e+127) tmp = ((y_46_re * x_46_im) - (x_46_re * y_46_im)) / (y_46_im * y_46_im); else tmp = -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[LessEqual[y$46$im, -1.2e+28], N[(-1.0 / N[(y$46$im / x$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.75e-82], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 5.2e+127], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision], N[((-x$46$re) / y$46$im), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.2 \cdot 10^{+28}:\\
\;\;\;\;\frac{-1}{\frac{y.im}{x.re}}\\
\mathbf{elif}\;y.im \leq 2.75 \cdot 10^{-82}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 5.2 \cdot 10^{+127}:\\
\;\;\;\;\frac{y.re \cdot x.im - x.re \cdot y.im}{y.im \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -1.19999999999999991e28Initial program 48.9%
Taylor expanded in y.im around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6474.6
Applied rewrites74.6%
Applied rewrites75.3%
if -1.19999999999999991e28 < y.im < 2.7499999999999999e-82Initial program 73.7%
Taylor expanded in y.im around 0
lower-/.f6468.5
Applied rewrites68.5%
if 2.7499999999999999e-82 < y.im < 5.2000000000000004e127Initial program 84.8%
Taylor expanded in y.im around inf
unpow2N/A
lower-*.f6461.6
Applied rewrites61.6%
if 5.2000000000000004e127 < y.im Initial program 35.2%
Taylor expanded in y.im around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6476.2
Applied rewrites76.2%
Final simplification69.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -1.2e+28)
(/ -1.0 (/ y.im x.re))
(if (<= y.im 8.5e-103)
(/ x.im y.re)
(if (<= y.im 1.55e+125)
(* (/ x.re (fma y.im y.im (* y.re y.re))) (- 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_im <= -1.2e+28) {
tmp = -1.0 / (y_46_im / x_46_re);
} else if (y_46_im <= 8.5e-103) {
tmp = x_46_im / y_46_re;
} else if (y_46_im <= 1.55e+125) {
tmp = (x_46_re / fma(y_46_im, y_46_im, (y_46_re * y_46_re))) * -y_46_im;
} else {
tmp = -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_im <= -1.2e+28) tmp = Float64(-1.0 / Float64(y_46_im / x_46_re)); elseif (y_46_im <= 8.5e-103) tmp = Float64(x_46_im / y_46_re); elseif (y_46_im <= 1.55e+125) tmp = Float64(Float64(x_46_re / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))) * Float64(-y_46_im)); else tmp = Float64(Float64(-x_46_re) / y_46_im); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.2e+28], N[(-1.0 / N[(y$46$im / x$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.5e-103], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.55e+125], N[(N[(x$46$re / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-y$46$im)), $MachinePrecision], N[((-x$46$re) / y$46$im), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.2 \cdot 10^{+28}:\\
\;\;\;\;\frac{-1}{\frac{y.im}{x.re}}\\
\mathbf{elif}\;y.im \leq 8.5 \cdot 10^{-103}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{elif}\;y.im \leq 1.55 \cdot 10^{+125}:\\
\;\;\;\;\frac{x.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \left(-y.im\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -1.19999999999999991e28Initial program 48.9%
Taylor expanded in y.im around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6474.6
Applied rewrites74.6%
Applied rewrites75.3%
if -1.19999999999999991e28 < y.im < 8.50000000000000032e-103Initial program 73.3%
Taylor expanded in y.im around 0
lower-/.f6470.2
Applied rewrites70.2%
if 8.50000000000000032e-103 < y.im < 1.55e125Initial program 83.5%
Taylor expanded in x.im around 0
mul-1-negN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6456.4
Applied rewrites56.4%
if 1.55e125 < y.im Initial program 37.5%
Taylor expanded in y.im around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6473.7
Applied rewrites73.7%
Final simplification68.5%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- x.im (/ (* x.re y.im) y.re)) y.re)))
(if (<= y.re -3.8e-8)
t_0
(if (<= y.re 3e+19) (/ (- (/ (* y.re x.im) y.im) x.re) y.im) t_0))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
double tmp;
if (y_46_re <= -3.8e-8) {
tmp = t_0;
} else if (y_46_re <= 3e+19) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = (x_46im - ((x_46re * y_46im) / y_46re)) / y_46re
if (y_46re <= (-3.8d-8)) then
tmp = t_0
else if (y_46re <= 3d+19) then
tmp = (((y_46re * x_46im) / y_46im) - x_46re) / y_46im
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re;
double tmp;
if (y_46_re <= -3.8e-8) {
tmp = t_0;
} else if (y_46_re <= 3e+19) {
tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im;
} else {
tmp = t_0;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re tmp = 0 if y_46_re <= -3.8e-8: tmp = t_0 elif y_46_re <= 3e+19: tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im else: tmp = t_0 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(x_46_im - Float64(Float64(x_46_re * y_46_im) / y_46_re)) / y_46_re) tmp = 0.0 if (y_46_re <= -3.8e-8) tmp = t_0; elseif (y_46_re <= 3e+19) tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = (x_46_im - ((x_46_re * y_46_im) / y_46_re)) / y_46_re; tmp = 0.0; if (y_46_re <= -3.8e-8) tmp = t_0; elseif (y_46_re <= 3e+19) tmp = (((y_46_re * x_46_im) / y_46_im) - x_46_re) / y_46_im; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(N[(x$46$re * y$46$im), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -3.8e-8], t$95$0, If[LessEqual[y$46$re, 3e+19], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}\\
\mathbf{if}\;y.re \leq -3.8 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 3 \cdot 10^{+19}:\\
\;\;\;\;\frac{\frac{y.re \cdot x.im}{y.im} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.80000000000000028e-8 or 3e19 < y.re Initial program 56.5%
Taylor expanded in y.im around 0
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
unpow2N/A
associate-/r*N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6482.0
Applied rewrites82.0%
if -3.80000000000000028e-8 < y.re < 3e19Initial program 74.1%
Taylor expanded in y.im around inf
+-commutativeN/A
mul-1-negN/A
sub-negN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6484.7
Applied rewrites84.7%
Final simplification83.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -1.2e+28) (/ -1.0 (/ y.im x.re)) (if (<= y.im 2.7e+50) (/ x.im y.re) (/ (- 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_im <= -1.2e+28) {
tmp = -1.0 / (y_46_im / x_46_re);
} else if (y_46_im <= 2.7e+50) {
tmp = x_46_im / y_46_re;
} else {
tmp = -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_46im <= (-1.2d+28)) then
tmp = (-1.0d0) / (y_46im / x_46re)
else if (y_46im <= 2.7d+50) then
tmp = x_46im / y_46re
else
tmp = -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_im <= -1.2e+28) {
tmp = -1.0 / (y_46_im / x_46_re);
} else if (y_46_im <= 2.7e+50) {
tmp = x_46_im / y_46_re;
} else {
tmp = -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_im <= -1.2e+28: tmp = -1.0 / (y_46_im / x_46_re) elif y_46_im <= 2.7e+50: tmp = x_46_im / y_46_re else: tmp = -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_im <= -1.2e+28) tmp = Float64(-1.0 / Float64(y_46_im / x_46_re)); elseif (y_46_im <= 2.7e+50) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(-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_im <= -1.2e+28) tmp = -1.0 / (y_46_im / x_46_re); elseif (y_46_im <= 2.7e+50) tmp = x_46_im / y_46_re; else tmp = -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[LessEqual[y$46$im, -1.2e+28], N[(-1.0 / N[(y$46$im / x$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.7e+50], N[(x$46$im / y$46$re), $MachinePrecision], N[((-x$46$re) / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.2 \cdot 10^{+28}:\\
\;\;\;\;\frac{-1}{\frac{y.im}{x.re}}\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{+50}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -1.19999999999999991e28Initial program 48.9%
Taylor expanded in y.im around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6474.6
Applied rewrites74.6%
Applied rewrites75.3%
if -1.19999999999999991e28 < y.im < 2.7e50Initial program 75.2%
Taylor expanded in y.im around 0
lower-/.f6460.6
Applied rewrites60.6%
if 2.7e50 < y.im Initial program 57.9%
Taylor expanded in y.im around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6469.0
Applied rewrites69.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (let* ((t_0 (/ (- x.re) y.im))) (if (<= y.im -1.2e+28) t_0 (if (<= y.im 2.7e+50) (/ 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.2e+28) {
tmp = t_0;
} else if (y_46_im <= 2.7e+50) {
tmp = x_46_im / y_46_re;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = -x_46re / y_46im
if (y_46im <= (-1.2d+28)) then
tmp = t_0
else if (y_46im <= 2.7d+50) then
tmp = x_46im / y_46re
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = -x_46_re / y_46_im;
double tmp;
if (y_46_im <= -1.2e+28) {
tmp = t_0;
} else if (y_46_im <= 2.7e+50) {
tmp = x_46_im / y_46_re;
} else {
tmp = t_0;
}
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.2e+28: tmp = t_0 elif y_46_im <= 2.7e+50: 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.2e+28) tmp = t_0; elseif (y_46_im <= 2.7e+50) tmp = Float64(x_46_im / y_46_re); else tmp = t_0; end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = -x_46_re / y_46_im; tmp = 0.0; if (y_46_im <= -1.2e+28) tmp = t_0; elseif (y_46_im <= 2.7e+50) tmp = x_46_im / y_46_re; else tmp = t_0; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -1.2e+28], t$95$0, If[LessEqual[y$46$im, 2.7e+50], 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.2 \cdot 10^{+28}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.im \leq 2.7 \cdot 10^{+50}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.im < -1.19999999999999991e28 or 2.7e50 < y.im Initial program 52.7%
Taylor expanded in y.im around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6472.2
Applied rewrites72.2%
if -1.19999999999999991e28 < y.im < 2.7e50Initial program 75.2%
Taylor expanded in y.im around 0
lower-/.f6460.6
Applied rewrites60.6%
(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 66.2%
Taylor expanded in y.im around 0
lower-/.f6441.3
Applied rewrites41.3%
herbie shell --seed 2024250
(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))))