
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = ((x_46re * y_46re) + (x_46im * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (fma y.im x.im (* x.re y.re)))
(t_1 (fma y.im y.im (* y.re y.re))))
(if (<= y.re -3.3e+172)
(/
(fma
(/ (- x.re) y.re)
(* (/ y.im y.re) y.im)
(fma x.im (- (/ y.im y.re) (pow (/ y.im y.re) 3.0)) x.re))
y.re)
(if (<= y.re -2.7e-89)
(/ t_0 t_1)
(if (<= y.re 2.8e-149)
(/ (fma (/ y.re y.im) x.re x.im) y.im)
(if (<= y.re 6e+58)
(/ 1.0 (/ t_1 t_0))
(/ (fma (/ y.im y.re) x.im x.re) y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(y_46_im, x_46_im, (x_46_re * y_46_re));
double t_1 = fma(y_46_im, y_46_im, (y_46_re * y_46_re));
double tmp;
if (y_46_re <= -3.3e+172) {
tmp = fma((-x_46_re / y_46_re), ((y_46_im / y_46_re) * y_46_im), fma(x_46_im, ((y_46_im / y_46_re) - pow((y_46_im / y_46_re), 3.0)), x_46_re)) / y_46_re;
} else if (y_46_re <= -2.7e-89) {
tmp = t_0 / t_1;
} else if (y_46_re <= 2.8e-149) {
tmp = fma((y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im;
} else if (y_46_re <= 6e+58) {
tmp = 1.0 / (t_1 / t_0);
} else {
tmp = fma((y_46_im / y_46_re), x_46_im, x_46_re) / 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, x_46_im, Float64(x_46_re * y_46_re)) t_1 = fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)) tmp = 0.0 if (y_46_re <= -3.3e+172) tmp = Float64(fma(Float64(Float64(-x_46_re) / y_46_re), Float64(Float64(y_46_im / y_46_re) * y_46_im), fma(x_46_im, Float64(Float64(y_46_im / y_46_re) - (Float64(y_46_im / y_46_re) ^ 3.0)), x_46_re)) / y_46_re); elseif (y_46_re <= -2.7e-89) tmp = Float64(t_0 / t_1); elseif (y_46_re <= 2.8e-149) tmp = Float64(fma(Float64(y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im); elseif (y_46_re <= 6e+58) tmp = Float64(1.0 / Float64(t_1 / t_0)); else tmp = Float64(fma(Float64(y_46_im / y_46_re), x_46_im, x_46_re) / 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 * x$46$im + N[(x$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.3e+172], N[(N[(N[((-x$46$re) / y$46$re), $MachinePrecision] * N[(N[(y$46$im / y$46$re), $MachinePrecision] * y$46$im), $MachinePrecision] + N[(x$46$im * N[(N[(y$46$im / y$46$re), $MachinePrecision] - N[Power[N[(y$46$im / y$46$re), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] + x$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -2.7e-89], N[(t$95$0 / t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 2.8e-149], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * x$46$re + x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 6e+58], N[(1.0 / N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, x.im, x.re \cdot y.re\right)\\
t_1 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
\mathbf{if}\;y.re \leq -3.3 \cdot 10^{+172}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re} \cdot y.im, \mathsf{fma}\left(x.im, \frac{y.im}{y.re} - {\left(\frac{y.im}{y.re}\right)}^{3}, x.re\right)\right)}{y.re}\\
\mathbf{elif}\;y.re \leq -2.7 \cdot 10^{-89}:\\
\;\;\;\;\frac{t\_0}{t\_1}\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-149}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.re}{y.im}, x.re, x.im\right)}{y.im}\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{+58}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.im}{y.re}, x.im, x.re\right)}{y.re}\\
\end{array}
\end{array}
if y.re < -3.29999999999999983e172Initial program 14.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6414.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6414.5
Applied rewrites14.5%
Taylor expanded in y.re around inf
lower-/.f64N/A
Applied rewrites88.9%
if -3.29999999999999983e172 < y.re < -2.69999999999999988e-89Initial program 81.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6481.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6481.5
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6481.5
Applied rewrites81.5%
if -2.69999999999999988e-89 < y.re < 2.7999999999999999e-149Initial program 67.6%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.6
Applied rewrites67.6%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
if 2.7999999999999999e-149 < y.re < 6.0000000000000005e58Initial program 76.5%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6476.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6476.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.6
Applied rewrites76.6%
if 6.0000000000000005e58 < y.re Initial program 53.7%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6453.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6453.7
Applied rewrites53.7%
Taylor expanded in y.re around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.0
Applied rewrites93.0%
Final simplification87.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (fma y.im x.im (* x.re y.re)))
(t_1 (fma y.im y.im (* y.re y.re)))
(t_2 (/ (fma (/ y.im y.re) x.im x.re) y.re)))
(if (<= y.re -3.3e+172)
t_2
(if (<= y.re -2.7e-89)
(/ t_0 t_1)
(if (<= y.re 2.8e-149)
(/ (fma (/ y.re y.im) x.re x.im) y.im)
(if (<= y.re 6e+58) (/ 1.0 (/ t_1 t_0)) 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, x_46_im, (x_46_re * y_46_re));
double t_1 = fma(y_46_im, y_46_im, (y_46_re * y_46_re));
double t_2 = fma((y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re;
double tmp;
if (y_46_re <= -3.3e+172) {
tmp = t_2;
} else if (y_46_re <= -2.7e-89) {
tmp = t_0 / t_1;
} else if (y_46_re <= 2.8e-149) {
tmp = fma((y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im;
} else if (y_46_re <= 6e+58) {
tmp = 1.0 / (t_1 / t_0);
} 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, x_46_im, Float64(x_46_re * y_46_re)) t_1 = fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)) t_2 = Float64(fma(Float64(y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re) tmp = 0.0 if (y_46_re <= -3.3e+172) tmp = t_2; elseif (y_46_re <= -2.7e-89) tmp = Float64(t_0 / t_1); elseif (y_46_re <= 2.8e-149) tmp = Float64(fma(Float64(y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im); elseif (y_46_re <= 6e+58) tmp = Float64(1.0 / Float64(t_1 / t_0)); 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 * x$46$im + N[(x$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -3.3e+172], t$95$2, If[LessEqual[y$46$re, -2.7e-89], N[(t$95$0 / t$95$1), $MachinePrecision], If[LessEqual[y$46$re, 2.8e-149], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * x$46$re + x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 6e+58], N[(1.0 / N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, x.im, x.re \cdot y.re\right)\\
t_1 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
t_2 := \frac{\mathsf{fma}\left(\frac{y.im}{y.re}, x.im, x.re\right)}{y.re}\\
\mathbf{if}\;y.re \leq -3.3 \cdot 10^{+172}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y.re \leq -2.7 \cdot 10^{-89}:\\
\;\;\;\;\frac{t\_0}{t\_1}\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-149}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.re}{y.im}, x.re, x.im\right)}{y.im}\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{+58}:\\
\;\;\;\;\frac{1}{\frac{t\_1}{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y.re < -3.29999999999999983e172 or 6.0000000000000005e58 < y.re Initial program 40.8%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6440.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8
Applied rewrites40.8%
Taylor expanded in y.re around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6491.6
Applied rewrites91.6%
if -3.29999999999999983e172 < y.re < -2.69999999999999988e-89Initial program 81.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6481.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6481.5
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6481.5
Applied rewrites81.5%
if -2.69999999999999988e-89 < y.re < 2.7999999999999999e-149Initial program 67.6%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.6
Applied rewrites67.6%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
if 2.7999999999999999e-149 < y.re < 6.0000000000000005e58Initial program 76.5%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6476.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6476.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.6
Applied rewrites76.6%
Final simplification87.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (fma (/ y.im y.re) x.im x.re) y.re)))
(if (<= y.re -3.3e+172)
t_0
(if (<= y.re -2.7e-89)
(/ (fma y.im x.im (* x.re y.re)) (fma y.im y.im (* y.re y.re)))
(if (<= y.re 2.8e-149)
(/ (fma (/ y.re y.im) x.re x.im) y.im)
(if (<= y.re 6e+58)
(/ (fma y.re x.re (* x.im 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((y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re;
double tmp;
if (y_46_re <= -3.3e+172) {
tmp = t_0;
} else if (y_46_re <= -2.7e-89) {
tmp = fma(y_46_im, x_46_im, (x_46_re * y_46_re)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
} else if (y_46_re <= 2.8e-149) {
tmp = fma((y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im;
} else if (y_46_re <= 6e+58) {
tmp = fma(y_46_re, x_46_re, (x_46_im * 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(Float64(y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re) tmp = 0.0 if (y_46_re <= -3.3e+172) tmp = t_0; elseif (y_46_re <= -2.7e-89) tmp = Float64(fma(y_46_im, x_46_im, Float64(x_46_re * y_46_re)) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))); elseif (y_46_re <= 2.8e-149) tmp = Float64(fma(Float64(y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im); elseif (y_46_re <= 6e+58) tmp = Float64(fma(y_46_re, x_46_re, Float64(x_46_im * 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[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -3.3e+172], t$95$0, If[LessEqual[y$46$re, -2.7e-89], N[(N[(y$46$im * x$46$im + N[(x$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.8e-149], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * x$46$re + x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 6e+58], N[(N[(y$46$re * x$46$re + N[(x$46$im * 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(\frac{y.im}{y.re}, x.im, x.re\right)}{y.re}\\
\mathbf{if}\;y.re \leq -3.3 \cdot 10^{+172}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq -2.7 \cdot 10^{-89}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y.im, x.im, x.re \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-149}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.re}{y.im}, x.re, x.im\right)}{y.im}\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{+58}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y.re, x.re, x.im \cdot y.im\right)}{y.im \cdot y.im + y.re \cdot y.re}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -3.29999999999999983e172 or 6.0000000000000005e58 < y.re Initial program 40.8%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6440.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8
Applied rewrites40.8%
Taylor expanded in y.re around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6491.6
Applied rewrites91.6%
if -3.29999999999999983e172 < y.re < -2.69999999999999988e-89Initial program 81.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6481.5
lift-*.f64N/A
*-commutativeN/A
lower-*.f6481.5
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6481.5
Applied rewrites81.5%
if -2.69999999999999988e-89 < y.re < 2.7999999999999999e-149Initial program 67.6%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.6
Applied rewrites67.6%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
if 2.7999999999999999e-149 < y.re < 6.0000000000000005e58Initial program 76.5%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.6
Applied rewrites76.6%
Final simplification87.2%
(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 (* (/ y.re t_0) x.re)))
(if (<= y.re -3.3e+172)
(/ x.re y.re)
(if (<= y.re -1.75e-97)
t_1
(if (<= y.re 2e-124)
(/ x.im y.im)
(if (<= y.re 3.6e+39)
t_1
(if (<= y.re 3.9e+96) (* (/ y.im t_0) x.im) (/ x.re y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(y_46_im, y_46_im, (y_46_re * y_46_re));
double t_1 = (y_46_re / t_0) * x_46_re;
double tmp;
if (y_46_re <= -3.3e+172) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -1.75e-97) {
tmp = t_1;
} else if (y_46_re <= 2e-124) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 3.6e+39) {
tmp = t_1;
} else if (y_46_re <= 3.9e+96) {
tmp = (y_46_im / t_0) * x_46_im;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)) t_1 = Float64(Float64(y_46_re / t_0) * x_46_re) tmp = 0.0 if (y_46_re <= -3.3e+172) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= -1.75e-97) tmp = t_1; elseif (y_46_re <= 2e-124) tmp = Float64(x_46_im / y_46_im); elseif (y_46_re <= 3.6e+39) tmp = t_1; elseif (y_46_re <= 3.9e+96) tmp = Float64(Float64(y_46_im / t_0) * x_46_im); else tmp = Float64(x_46_re / 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$re), $MachinePrecision]}, If[LessEqual[y$46$re, -3.3e+172], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -1.75e-97], t$95$1, If[LessEqual[y$46$re, 2e-124], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 3.6e+39], t$95$1, If[LessEqual[y$46$re, 3.9e+96], N[(N[(y$46$im / t$95$0), $MachinePrecision] * x$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
t_1 := \frac{y.re}{t\_0} \cdot x.re\\
\mathbf{if}\;y.re \leq -3.3 \cdot 10^{+172}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq -1.75 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{-124}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.re \leq 3.6 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 3.9 \cdot 10^{+96}:\\
\;\;\;\;\frac{y.im}{t\_0} \cdot x.im\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.re < -3.29999999999999983e172 or 3.9e96 < y.re Initial program 35.3%
Taylor expanded in y.re around inf
lower-/.f6479.7
Applied rewrites79.7%
if -3.29999999999999983e172 < y.re < -1.7500000000000001e-97 or 1.99999999999999987e-124 < y.re < 3.59999999999999984e39Initial program 80.4%
Taylor expanded in x.re around inf
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
Applied rewrites61.7%
if -1.7500000000000001e-97 < y.re < 1.99999999999999987e-124Initial program 71.2%
Taylor expanded in y.re around 0
lower-/.f6474.2
Applied rewrites74.2%
if 3.59999999999999984e39 < y.re < 3.9e96Initial program 69.7%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6470.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6470.2
Applied rewrites70.2%
Taylor expanded in x.re around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6465.5
Applied rewrites65.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 (* (/ y.re t_0) x.re)))
(if (<= y.re -3.3e+172)
(/ x.re y.re)
(if (<= y.re -1.75e-97)
t_1
(if (<= y.re 2e-124)
(/ x.im y.im)
(if (<= y.re 1.02e+39)
t_1
(if (<= y.re 3.9e+96) (* (/ x.im t_0) y.im) (/ x.re y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = fma(y_46_im, y_46_im, (y_46_re * y_46_re));
double t_1 = (y_46_re / t_0) * x_46_re;
double tmp;
if (y_46_re <= -3.3e+172) {
tmp = x_46_re / y_46_re;
} else if (y_46_re <= -1.75e-97) {
tmp = t_1;
} else if (y_46_re <= 2e-124) {
tmp = x_46_im / y_46_im;
} else if (y_46_re <= 1.02e+39) {
tmp = t_1;
} else if (y_46_re <= 3.9e+96) {
tmp = (x_46_im / t_0) * y_46_im;
} else {
tmp = x_46_re / y_46_re;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)) t_1 = Float64(Float64(y_46_re / t_0) * x_46_re) tmp = 0.0 if (y_46_re <= -3.3e+172) tmp = Float64(x_46_re / y_46_re); elseif (y_46_re <= -1.75e-97) tmp = t_1; elseif (y_46_re <= 2e-124) tmp = Float64(x_46_im / y_46_im); elseif (y_46_re <= 1.02e+39) tmp = t_1; elseif (y_46_re <= 3.9e+96) tmp = Float64(Float64(x_46_im / t_0) * y_46_im); else tmp = Float64(x_46_re / 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$re), $MachinePrecision]}, If[LessEqual[y$46$re, -3.3e+172], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -1.75e-97], t$95$1, If[LessEqual[y$46$re, 2e-124], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.02e+39], t$95$1, If[LessEqual[y$46$re, 3.9e+96], N[(N[(x$46$im / t$95$0), $MachinePrecision] * y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
t_1 := \frac{y.re}{t\_0} \cdot x.re\\
\mathbf{if}\;y.re \leq -3.3 \cdot 10^{+172}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{elif}\;y.re \leq -1.75 \cdot 10^{-97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 2 \cdot 10^{-124}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.re \leq 1.02 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq 3.9 \cdot 10^{+96}:\\
\;\;\;\;\frac{x.im}{t\_0} \cdot y.im\\
\mathbf{else}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\end{array}
\end{array}
if y.re < -3.29999999999999983e172 or 3.9e96 < y.re Initial program 35.3%
Taylor expanded in y.re around inf
lower-/.f6479.7
Applied rewrites79.7%
if -3.29999999999999983e172 < y.re < -1.7500000000000001e-97 or 1.99999999999999987e-124 < y.re < 1.02e39Initial program 80.4%
Taylor expanded in x.re around inf
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
Applied rewrites61.7%
if -1.7500000000000001e-97 < y.re < 1.99999999999999987e-124Initial program 71.2%
Taylor expanded in y.re around 0
lower-/.f6474.2
Applied rewrites74.2%
if 1.02e39 < y.re < 3.9e96Initial program 69.7%
Taylor expanded in x.re around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6465.2
Applied rewrites65.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (fma y.im x.im (* x.re y.re)) (fma y.im y.im (* y.re y.re))))
(t_1 (/ (fma (/ y.im y.re) x.im x.re) y.re)))
(if (<= y.re -3.3e+172)
t_1
(if (<= y.re -2.7e-89)
t_0
(if (<= y.re 2.8e-149)
(/ (fma (/ y.re y.im) x.re x.im) y.im)
(if (<= y.re 6e+58) 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 = fma(y_46_im, x_46_im, (x_46_re * y_46_re)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
double t_1 = fma((y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re;
double tmp;
if (y_46_re <= -3.3e+172) {
tmp = t_1;
} else if (y_46_re <= -2.7e-89) {
tmp = t_0;
} else if (y_46_re <= 2.8e-149) {
tmp = fma((y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im;
} else if (y_46_re <= 6e+58) {
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(fma(y_46_im, x_46_im, Float64(x_46_re * y_46_re)) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))) t_1 = Float64(fma(Float64(y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re) tmp = 0.0 if (y_46_re <= -3.3e+172) tmp = t_1; elseif (y_46_re <= -2.7e-89) tmp = t_0; elseif (y_46_re <= 2.8e-149) tmp = Float64(fma(Float64(y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im); elseif (y_46_re <= 6e+58) 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[(y$46$im * x$46$im + N[(x$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -3.3e+172], t$95$1, If[LessEqual[y$46$re, -2.7e-89], t$95$0, If[LessEqual[y$46$re, 2.8e-149], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * x$46$re + x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 6e+58], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(y.im, x.im, x.re \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
t_1 := \frac{\mathsf{fma}\left(\frac{y.im}{y.re}, x.im, x.re\right)}{y.re}\\
\mathbf{if}\;y.re \leq -3.3 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y.re \leq -2.7 \cdot 10^{-89}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-149}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.re}{y.im}, x.re, x.im\right)}{y.im}\\
\mathbf{elif}\;y.re \leq 6 \cdot 10^{+58}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y.re < -3.29999999999999983e172 or 6.0000000000000005e58 < y.re Initial program 40.8%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6440.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.8
Applied rewrites40.8%
Taylor expanded in y.re around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6491.6
Applied rewrites91.6%
if -3.29999999999999983e172 < y.re < -2.69999999999999988e-89 or 2.7999999999999999e-149 < y.re < 6.0000000000000005e58Initial program 79.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6479.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.3
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6479.3
Applied rewrites79.3%
if -2.69999999999999988e-89 < y.re < 2.7999999999999999e-149Initial program 67.6%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6467.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.6
Applied rewrites67.6%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6495.6
Applied rewrites95.6%
Final simplification87.2%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -370.0)
(/ (fma (/ x.im y.re) y.im x.re) y.re)
(if (<= y.re 8.8e+55)
(/ (fma (/ y.re y.im) x.re x.im) y.im)
(/ (fma (/ y.im y.re) x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -370.0) {
tmp = fma((x_46_im / y_46_re), y_46_im, x_46_re) / y_46_re;
} else if (y_46_re <= 8.8e+55) {
tmp = fma((y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im;
} else {
tmp = fma((y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -370.0) tmp = Float64(fma(Float64(x_46_im / y_46_re), y_46_im, x_46_re) / y_46_re); elseif (y_46_re <= 8.8e+55) tmp = Float64(fma(Float64(y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im); else tmp = Float64(fma(Float64(y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -370.0], N[(N[(N[(x$46$im / y$46$re), $MachinePrecision] * y$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 8.8e+55], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * x$46$re + x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -370:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}\\
\mathbf{elif}\;y.re \leq 8.8 \cdot 10^{+55}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.re}{y.im}, x.re, x.im\right)}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.im}{y.re}, x.im, x.re\right)}{y.re}\\
\end{array}
\end{array}
if y.re < -370Initial program 51.9%
Taylor expanded in y.re around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6478.6
Applied rewrites78.6%
if -370 < y.re < 8.80000000000000042e55Initial program 73.7%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6473.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6473.8
Applied rewrites73.8%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6475.6
Applied rewrites75.6%
if 8.80000000000000042e55 < y.re Initial program 53.7%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6453.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6453.7
Applied rewrites53.7%
Taylor expanded in y.re around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.0
Applied rewrites93.0%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.re -370.0)
(/ (fma (/ x.im y.re) y.im x.re) y.re)
(if (<= y.re 8.8e+55)
(/ (fma (/ x.re y.im) y.re x.im) y.im)
(/ (fma (/ y.im y.re) x.im x.re) y.re))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_re <= -370.0) {
tmp = fma((x_46_im / y_46_re), y_46_im, x_46_re) / y_46_re;
} else if (y_46_re <= 8.8e+55) {
tmp = fma((x_46_re / y_46_im), y_46_re, x_46_im) / y_46_im;
} else {
tmp = fma((y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_re <= -370.0) tmp = Float64(fma(Float64(x_46_im / y_46_re), y_46_im, x_46_re) / y_46_re); elseif (y_46_re <= 8.8e+55) tmp = Float64(fma(Float64(x_46_re / y_46_im), y_46_re, x_46_im) / y_46_im); else tmp = Float64(fma(Float64(y_46_im / y_46_re), x_46_im, x_46_re) / y_46_re); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -370.0], N[(N[(N[(x$46$im / y$46$re), $MachinePrecision] * y$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 8.8e+55], N[(N[(N[(x$46$re / y$46$im), $MachinePrecision] * y$46$re + x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -370:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}\\
\mathbf{elif}\;y.re \leq 8.8 \cdot 10^{+55}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x.re}{y.im}, y.re, x.im\right)}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.im}{y.re}, x.im, x.re\right)}{y.re}\\
\end{array}
\end{array}
if y.re < -370Initial program 51.9%
Taylor expanded in y.re around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6478.6
Applied rewrites78.6%
if -370 < y.re < 8.80000000000000042e55Initial program 73.7%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6473.6
Applied rewrites73.6%
if 8.80000000000000042e55 < y.re Initial program 53.7%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6453.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6453.7
Applied rewrites53.7%
Taylor expanded in y.re around inf
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6493.0
Applied rewrites93.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.re)))
(if (<= y.re -370.0)
t_0
(if (<= y.re 8.8e+55) (/ (fma (/ x.re y.im) y.re x.im) 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 = fma((x_46_im / y_46_re), y_46_im, x_46_re) / y_46_re;
double tmp;
if (y_46_re <= -370.0) {
tmp = t_0;
} else if (y_46_re <= 8.8e+55) {
tmp = fma((x_46_re / y_46_im), y_46_re, x_46_im) / 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(fma(Float64(x_46_im / y_46_re), y_46_im, x_46_re) / y_46_re) tmp = 0.0 if (y_46_re <= -370.0) tmp = t_0; elseif (y_46_re <= 8.8e+55) tmp = Float64(fma(Float64(x_46_re / y_46_im), y_46_re, x_46_im) / y_46_im); 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[(N[(x$46$im / y$46$re), $MachinePrecision] * y$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -370.0], t$95$0, If[LessEqual[y$46$re, 8.8e+55], N[(N[(N[(x$46$re / y$46$im), $MachinePrecision] * y$46$re + x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}\\
\mathbf{if}\;y.re \leq -370:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y.re \leq 8.8 \cdot 10^{+55}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x.re}{y.im}, y.re, x.im\right)}{y.im}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y.re < -370 or 8.80000000000000042e55 < y.re Initial program 52.8%
Taylor expanded in y.re around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.4
Applied rewrites85.4%
if -370 < y.re < 8.80000000000000042e55Initial program 73.7%
Taylor expanded in y.im around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6473.6
Applied rewrites73.6%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -4.2e+205) (/ x.im y.im) (if (<= y.im 5e+41) (/ (fma (/ x.im y.re) y.im x.re) y.re) (/ x.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -4.2e+205) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 5e+41) {
tmp = fma((x_46_im / y_46_re), y_46_im, x_46_re) / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -4.2e+205) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 5e+41) tmp = Float64(fma(Float64(x_46_im / y_46_re), y_46_im, x_46_re) / y_46_re); else tmp = Float64(x_46_im / 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, -4.2e+205], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 5e+41], N[(N[(N[(x$46$im / y$46$re), $MachinePrecision] * y$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -4.2 \cdot 10^{+205}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 5 \cdot 10^{+41}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -4.2000000000000001e205 or 5.00000000000000022e41 < y.im Initial program 43.3%
Taylor expanded in y.re around 0
lower-/.f6475.9
Applied rewrites75.9%
if -4.2000000000000001e205 < y.im < 5.00000000000000022e41Initial program 72.0%
Taylor expanded in y.re around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6472.8
Applied rewrites72.8%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= y.im -5.2e+73)
(/ x.im y.im)
(if (<= y.im -2.7e-87)
(* (/ x.im (fma y.im y.im (* y.re y.re))) y.im)
(if (<= y.im 1.8e+41) (/ x.re y.re) (/ x.im y.im)))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -5.2e+73) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= -2.7e-87) {
tmp = (x_46_im / fma(y_46_im, y_46_im, (y_46_re * y_46_re))) * y_46_im;
} else if (y_46_im <= 1.8e+41) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -5.2e+73) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= -2.7e-87) tmp = Float64(Float64(x_46_im / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))) * y_46_im); elseif (y_46_im <= 1.8e+41) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(x_46_im / 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, -5.2e+73], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, -2.7e-87], N[(N[(x$46$im / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.8e+41], N[(x$46$re / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -5.2 \cdot 10^{+73}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq -2.7 \cdot 10^{-87}:\\
\;\;\;\;\frac{x.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot y.im\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+41}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -5.2000000000000001e73 or 1.80000000000000013e41 < y.im Initial program 37.7%
Taylor expanded in y.re around 0
lower-/.f6466.0
Applied rewrites66.0%
if -5.2000000000000001e73 < y.im < -2.69999999999999984e-87Initial program 81.7%
Taylor expanded in x.re around 0
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
unpow2N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6461.8
Applied rewrites61.8%
if -2.69999999999999984e-87 < y.im < 1.80000000000000013e41Initial program 79.2%
Taylor expanded in y.re around inf
lower-/.f6468.3
Applied rewrites68.3%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (<= y.im -1.6e+20) (/ x.im y.im) (if (<= y.im 1.8e+41) (/ x.re y.re) (/ x.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.6e+20) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.8e+41) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if (y_46im <= (-1.6d+20)) then
tmp = x_46im / y_46im
else if (y_46im <= 1.8d+41) then
tmp = x_46re / y_46re
else
tmp = x_46im / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if (y_46_im <= -1.6e+20) {
tmp = x_46_im / y_46_im;
} else if (y_46_im <= 1.8e+41) {
tmp = x_46_re / y_46_re;
} else {
tmp = x_46_im / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if y_46_im <= -1.6e+20: tmp = x_46_im / y_46_im elif y_46_im <= 1.8e+41: tmp = x_46_re / y_46_re else: tmp = x_46_im / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if (y_46_im <= -1.6e+20) tmp = Float64(x_46_im / y_46_im); elseif (y_46_im <= 1.8e+41) tmp = Float64(x_46_re / y_46_re); else tmp = Float64(x_46_im / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if (y_46_im <= -1.6e+20) tmp = x_46_im / y_46_im; elseif (y_46_im <= 1.8e+41) tmp = x_46_re / y_46_re; else tmp = x_46_im / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.6e+20], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 1.8e+41], N[(x$46$re / y$46$re), $MachinePrecision], N[(x$46$im / y$46$im), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -1.6 \cdot 10^{+20}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+41}:\\
\;\;\;\;\frac{x.re}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.im}\\
\end{array}
\end{array}
if y.im < -1.6e20 or 1.80000000000000013e41 < y.im Initial program 42.3%
Taylor expanded in y.re around 0
lower-/.f6463.7
Applied rewrites63.7%
if -1.6e20 < y.im < 1.80000000000000013e41Initial program 79.5%
Taylor expanded in y.re around inf
lower-/.f6463.5
Applied rewrites63.5%
(FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.im))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
code = x_46im / y_46im
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return x_46_im / y_46_im;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): return x_46_im / y_46_im
function code(x_46_re, x_46_im, y_46_re, y_46_im) return Float64(x_46_im / y_46_im) end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = x_46_im / y_46_im; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
\begin{array}{l}
\\
\frac{x.im}{y.im}
\end{array}
Initial program 64.1%
Taylor expanded in y.re around 0
lower-/.f6436.8
Applied rewrites36.8%
herbie shell --seed 2024285
(FPCore (x.re x.im y.re y.im)
:name "_divideComplex, real part"
:precision binary64
(/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))