
(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 9 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
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
(if (<= y.im -6e+108)
(- (* (/ 1.0 y.im) (/ y.re (/ y.im x.im))) (/ x.re y.im))
(if (<= y.im -6.4e-58)
t_0
(if (<= y.im 1.2e-81)
(+ (/ x.im y.re) (* y.im (* (/ x.re y.re) (/ -1.0 y.re))))
(if (<= y.im 2.1e+118)
t_0
(- (/ y.re (* y.im (* y.im (/ 1.0 x.im)))) (/ x.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -6e+108) {
tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_46_im))) - (x_46_re / y_46_im);
} else if (y_46_im <= -6.4e-58) {
tmp = t_0;
} else if (y_46_im <= 1.2e-81) {
tmp = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re)));
} else if (y_46_im <= 2.1e+118) {
tmp = t_0;
} else {
tmp = (y_46_re / (y_46_im * (y_46_im * (1.0 / x_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) :: t_0
real(8) :: tmp
t_0 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
if (y_46im <= (-6d+108)) then
tmp = ((1.0d0 / y_46im) * (y_46re / (y_46im / x_46im))) - (x_46re / y_46im)
else if (y_46im <= (-6.4d-58)) then
tmp = t_0
else if (y_46im <= 1.2d-81) then
tmp = (x_46im / y_46re) + (y_46im * ((x_46re / y_46re) * ((-1.0d0) / y_46re)))
else if (y_46im <= 2.1d+118) then
tmp = t_0
else
tmp = (y_46re / (y_46im * (y_46im * (1.0d0 / x_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 t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
double tmp;
if (y_46_im <= -6e+108) {
tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_46_im))) - (x_46_re / y_46_im);
} else if (y_46_im <= -6.4e-58) {
tmp = t_0;
} else if (y_46_im <= 1.2e-81) {
tmp = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re)));
} else if (y_46_im <= 2.1e+118) {
tmp = t_0;
} else {
tmp = (y_46_re / (y_46_im * (y_46_im * (1.0 / x_46_im)))) - (x_46_re / y_46_im);
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)) tmp = 0 if y_46_im <= -6e+108: tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_46_im))) - (x_46_re / y_46_im) elif y_46_im <= -6.4e-58: tmp = t_0 elif y_46_im <= 1.2e-81: tmp = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re))) elif y_46_im <= 2.1e+118: tmp = t_0 else: tmp = (y_46_re / (y_46_im * (y_46_im * (1.0 / x_46_im)))) - (x_46_re / y_46_im) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))) tmp = 0.0 if (y_46_im <= -6e+108) tmp = Float64(Float64(Float64(1.0 / y_46_im) * Float64(y_46_re / Float64(y_46_im / x_46_im))) - Float64(x_46_re / y_46_im)); elseif (y_46_im <= -6.4e-58) tmp = t_0; elseif (y_46_im <= 1.2e-81) tmp = Float64(Float64(x_46_im / y_46_re) + Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) * Float64(-1.0 / y_46_re)))); elseif (y_46_im <= 2.1e+118) tmp = t_0; else tmp = Float64(Float64(y_46_re / Float64(y_46_im * Float64(y_46_im * Float64(1.0 / x_46_im)))) - 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) t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im)); tmp = 0.0; if (y_46_im <= -6e+108) tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_46_im))) - (x_46_re / y_46_im); elseif (y_46_im <= -6.4e-58) tmp = t_0; elseif (y_46_im <= 1.2e-81) tmp = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re))); elseif (y_46_im <= 2.1e+118) tmp = t_0; else tmp = (y_46_re / (y_46_im * (y_46_im * (1.0 / x_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_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -6e+108], N[(N[(N[(1.0 / y$46$im), $MachinePrecision] * N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -6.4e-58], t$95$0, If[LessEqual[y$46$im, 1.2e-81], N[(N[(x$46$im / y$46$re), $MachinePrecision] + N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] * N[(-1.0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.1e+118], t$95$0, N[(N[(y$46$re / N[(y$46$im * N[(y$46$im * N[(1.0 / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;y.im \leq -6 \cdot 10^{+108}:\\
\;\;\;\;\frac{1}{y.im} \cdot \frac{y.re}{\frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -6.4 \cdot 10^{-58}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.2 \cdot 10^{-81}:\\
\;\;\;\;\frac{x.im}{y.re} + y.im \cdot \left(\frac{x.re}{y.re} \cdot \frac{-1}{y.re}\right)\\
\mathbf{elif}\;y.im \leq 2.1 \cdot 10^{+118}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{y.re}{y.im \cdot \left(y.im \cdot \frac{1}{x.im}\right)} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -5.99999999999999968e108Initial program 21.3%
Taylor expanded in y.re around 0 77.3%
+-commutative77.3%
mul-1-neg77.3%
unsub-neg77.3%
*-commutative77.3%
associate-/l*77.4%
Simplified77.4%
pow277.4%
div-inv77.4%
associate-*l*83.0%
Applied egg-rr83.0%
*-un-lft-identity83.0%
times-frac84.8%
un-div-inv84.9%
Applied egg-rr84.9%
if -5.99999999999999968e108 < y.im < -6.4000000000000002e-58 or 1.2e-81 < y.im < 2.1e118Initial program 75.6%
if -6.4000000000000002e-58 < y.im < 1.2e-81Initial program 72.7%
Taylor expanded in y.re around inf 84.8%
+-commutative84.8%
mul-1-neg84.8%
unsub-neg84.8%
associate-/l*81.9%
associate-/r/80.0%
Simplified80.0%
*-un-lft-identity80.0%
pow280.0%
times-frac84.1%
Applied egg-rr84.1%
if 2.1e118 < y.im Initial program 19.2%
Taylor expanded in y.re around 0 81.1%
+-commutative81.1%
mul-1-neg81.1%
unsub-neg81.1%
*-commutative81.1%
associate-/l*90.9%
Simplified90.9%
pow290.9%
div-inv90.9%
associate-*l*96.9%
Applied egg-rr96.9%
Final simplification83.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -3.3e+17) (not (<= y.re 950.0))) (- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re))) (- (* (/ 1.0 y.im) (/ y.re (/ y.im x.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 <= -3.3e+17) || !(y_46_re <= 950.0)) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else {
tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_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 <= (-3.3d+17)) .or. (.not. (y_46re <= 950.0d0))) then
tmp = (x_46im / y_46re) - (y_46im * ((x_46re / y_46re) / y_46re))
else
tmp = ((1.0d0 / y_46im) * (y_46re / (y_46im / x_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 <= -3.3e+17) || !(y_46_re <= 950.0)) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else {
tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_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 <= -3.3e+17) or not (y_46_re <= 950.0): tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) else: tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_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 <= -3.3e+17) || !(y_46_re <= 950.0)) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))); else tmp = Float64(Float64(Float64(1.0 / y_46_im) * Float64(y_46_re / Float64(y_46_im / x_46_im))) - 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_re <= -3.3e+17) || ~((y_46_re <= 950.0))) tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); else tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_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, -3.3e+17], N[Not[LessEqual[y$46$re, 950.0]], $MachinePrecision]], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y$46$im), $MachinePrecision] * N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.3 \cdot 10^{+17} \lor \neg \left(y.re \leq 950\right):\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y.im} \cdot \frac{y.re}{\frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -3.3e17 or 950 < y.re Initial program 43.0%
Taylor expanded in y.re around inf 68.8%
+-commutative68.8%
mul-1-neg68.8%
unsub-neg68.8%
associate-/l*68.4%
associate-/r/70.1%
Simplified70.1%
*-un-lft-identity70.1%
pow270.1%
times-frac73.3%
Applied egg-rr73.3%
associate-*l/73.3%
*-un-lft-identity73.3%
Applied egg-rr73.3%
if -3.3e17 < y.re < 950Initial program 69.8%
Taylor expanded in y.re around 0 71.6%
+-commutative71.6%
mul-1-neg71.6%
unsub-neg71.6%
*-commutative71.6%
associate-/l*72.2%
Simplified72.2%
pow272.2%
div-inv72.1%
associate-*l*74.9%
Applied egg-rr74.9%
*-un-lft-identity74.9%
times-frac77.2%
un-div-inv77.2%
Applied egg-rr77.2%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -940000000.0) (not (<= y.re 4800.0))) (+ (/ x.im y.re) (* y.im (* (/ x.re y.re) (/ -1.0 y.re)))) (- (* (/ 1.0 y.im) (/ y.re (/ y.im x.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 <= -940000000.0) || !(y_46_re <= 4800.0)) {
tmp = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re)));
} else {
tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_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 <= (-940000000.0d0)) .or. (.not. (y_46re <= 4800.0d0))) then
tmp = (x_46im / y_46re) + (y_46im * ((x_46re / y_46re) * ((-1.0d0) / y_46re)))
else
tmp = ((1.0d0 / y_46im) * (y_46re / (y_46im / x_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 <= -940000000.0) || !(y_46_re <= 4800.0)) {
tmp = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re)));
} else {
tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_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 <= -940000000.0) or not (y_46_re <= 4800.0): tmp = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re))) else: tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_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 <= -940000000.0) || !(y_46_re <= 4800.0)) tmp = Float64(Float64(x_46_im / y_46_re) + Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) * Float64(-1.0 / y_46_re)))); else tmp = Float64(Float64(Float64(1.0 / y_46_im) * Float64(y_46_re / Float64(y_46_im / x_46_im))) - 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_re <= -940000000.0) || ~((y_46_re <= 4800.0))) tmp = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re))); else tmp = ((1.0 / y_46_im) * (y_46_re / (y_46_im / x_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, -940000000.0], N[Not[LessEqual[y$46$re, 4800.0]], $MachinePrecision]], N[(N[(x$46$im / y$46$re), $MachinePrecision] + N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] * N[(-1.0 / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / y$46$im), $MachinePrecision] * N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -940000000 \lor \neg \left(y.re \leq 4800\right):\\
\;\;\;\;\frac{x.im}{y.re} + y.im \cdot \left(\frac{x.re}{y.re} \cdot \frac{-1}{y.re}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y.im} \cdot \frac{y.re}{\frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -9.4e8 or 4800 < y.re Initial program 43.0%
Taylor expanded in y.re around inf 68.8%
+-commutative68.8%
mul-1-neg68.8%
unsub-neg68.8%
associate-/l*68.4%
associate-/r/70.1%
Simplified70.1%
*-un-lft-identity70.1%
pow270.1%
times-frac73.3%
Applied egg-rr73.3%
if -9.4e8 < y.re < 4800Initial program 69.8%
Taylor expanded in y.re around 0 71.6%
+-commutative71.6%
mul-1-neg71.6%
unsub-neg71.6%
*-commutative71.6%
associate-/l*72.2%
Simplified72.2%
pow272.2%
div-inv72.1%
associate-*l*74.9%
Applied egg-rr74.9%
*-un-lft-identity74.9%
times-frac77.2%
un-div-inv77.2%
Applied egg-rr77.2%
Final simplification75.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -7.6e+128) (not (<= y.im 1.9e+101))) (/ (- x.re) y.im) (- (/ x.im y.re) (* 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 <= -7.6e+128) || !(y_46_im <= 1.9e+101)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = (x_46_im / y_46_re) - (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 <= (-7.6d+128)) .or. (.not. (y_46im <= 1.9d+101))) then
tmp = -x_46re / y_46im
else
tmp = (x_46im / y_46re) - (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 <= -7.6e+128) || !(y_46_im <= 1.9e+101)) {
tmp = -x_46_re / y_46_im;
} else {
tmp = (x_46_im / y_46_re) - (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 <= -7.6e+128) or not (y_46_im <= 1.9e+101): tmp = -x_46_re / y_46_im else: tmp = (x_46_im / y_46_re) - (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 <= -7.6e+128) || !(y_46_im <= 1.9e+101)) tmp = Float64(Float64(-x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(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 <= -7.6e+128) || ~((y_46_im <= 1.9e+101))) tmp = -x_46_re / y_46_im; else tmp = (x_46_im / y_46_re) - (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, -7.6e+128], N[Not[LessEqual[y$46$im, 1.9e+101]], $MachinePrecision]], N[((-x$46$re) / y$46$im), $MachinePrecision], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -7.6 \cdot 10^{+128} \lor \neg \left(y.im \leq 1.9 \cdot 10^{+101}\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -7.5999999999999998e128 or 1.8999999999999999e101 < y.im Initial program 24.8%
Taylor expanded in y.re around 0 84.3%
associate-*r/84.3%
neg-mul-184.3%
Simplified84.3%
if -7.5999999999999998e128 < y.im < 1.8999999999999999e101Initial program 72.6%
Taylor expanded in y.re around inf 66.3%
+-commutative66.3%
mul-1-neg66.3%
unsub-neg66.3%
associate-/l*65.2%
associate-/r/63.7%
Simplified63.7%
*-un-lft-identity63.7%
pow263.7%
times-frac67.6%
Applied egg-rr67.6%
associate-*l/67.5%
*-un-lft-identity67.5%
Applied egg-rr67.5%
Final simplification73.0%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -3.8e+30) (not (<= y.im 5.5e-35))) (- (/ y.re (* y.im (/ y.im x.im))) (/ x.re y.im)) (- (/ x.im y.re) (* 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 <= -3.8e+30) || !(y_46_im <= 5.5e-35)) {
tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im);
} else {
tmp = (x_46_im / y_46_re) - (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 <= (-3.8d+30)) .or. (.not. (y_46im <= 5.5d-35))) then
tmp = (y_46re / (y_46im * (y_46im / x_46im))) - (x_46re / y_46im)
else
tmp = (x_46im / y_46re) - (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 <= -3.8e+30) || !(y_46_im <= 5.5e-35)) {
tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im);
} else {
tmp = (x_46_im / y_46_re) - (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 <= -3.8e+30) or not (y_46_im <= 5.5e-35): tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im) else: tmp = (x_46_im / y_46_re) - (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 <= -3.8e+30) || !(y_46_im <= 5.5e-35)) tmp = Float64(Float64(y_46_re / Float64(y_46_im * Float64(y_46_im / x_46_im))) - Float64(x_46_re / y_46_im)); else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(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 <= -3.8e+30) || ~((y_46_im <= 5.5e-35))) tmp = (y_46_re / (y_46_im * (y_46_im / x_46_im))) - (x_46_re / y_46_im); else tmp = (x_46_im / y_46_re) - (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, -3.8e+30], N[Not[LessEqual[y$46$im, 5.5e-35]], $MachinePrecision]], N[(N[(y$46$re / N[(y$46$im * N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -3.8 \cdot 10^{+30} \lor \neg \left(y.im \leq 5.5 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{y.re}{y.im \cdot \frac{y.im}{x.im}} - \frac{x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -3.8000000000000001e30 or 5.4999999999999997e-35 < y.im Initial program 41.6%
Taylor expanded in y.re around 0 70.9%
+-commutative70.9%
mul-1-neg70.9%
unsub-neg70.9%
*-commutative70.9%
associate-/l*72.8%
Simplified72.8%
pow272.8%
div-inv72.8%
associate-*l*76.2%
Applied egg-rr76.2%
Taylor expanded in y.im around 0 76.2%
if -3.8000000000000001e30 < y.im < 5.4999999999999997e-35Initial program 74.4%
Taylor expanded in y.re around inf 77.7%
+-commutative77.7%
mul-1-neg77.7%
unsub-neg77.7%
associate-/l*75.5%
associate-/r/74.0%
Simplified74.0%
*-un-lft-identity74.0%
pow274.0%
times-frac77.2%
Applied egg-rr77.2%
associate-*l/77.2%
*-un-lft-identity77.2%
Applied egg-rr77.2%
Final simplification76.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -17500000000.0) (not (<= y.re 220000.0))) (- (/ x.im y.re) (* y.im (/ (/ x.re y.re) y.re))) (- (/ (* x.im (/ y.re 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_re <= -17500000000.0) || !(y_46_re <= 220000.0)) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else {
tmp = ((x_46_im * (y_46_re / y_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 <= (-17500000000.0d0)) .or. (.not. (y_46re <= 220000.0d0))) then
tmp = (x_46im / y_46re) - (y_46im * ((x_46re / y_46re) / y_46re))
else
tmp = ((x_46im * (y_46re / y_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 <= -17500000000.0) || !(y_46_re <= 220000.0)) {
tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re));
} else {
tmp = ((x_46_im * (y_46_re / y_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 <= -17500000000.0) or not (y_46_re <= 220000.0): tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)) else: tmp = ((x_46_im * (y_46_re / y_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 <= -17500000000.0) || !(y_46_re <= 220000.0)) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(Float64(x_46_re / y_46_re) / y_46_re))); else tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) / y_46_im) - 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_re <= -17500000000.0) || ~((y_46_re <= 220000.0))) tmp = (x_46_im / y_46_re) - (y_46_im * ((x_46_re / y_46_re) / y_46_re)); else tmp = ((x_46_im * (y_46_re / y_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, -17500000000.0], N[Not[LessEqual[y$46$re, 220000.0]], $MachinePrecision]], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(N[(x$46$re / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$im), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -17500000000 \lor \neg \left(y.re \leq 220000\right):\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{\frac{x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im}}{y.im} - \frac{x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -1.75e10 or 2.2e5 < y.re Initial program 43.0%
Taylor expanded in y.re around inf 68.8%
+-commutative68.8%
mul-1-neg68.8%
unsub-neg68.8%
associate-/l*68.4%
associate-/r/70.1%
Simplified70.1%
*-un-lft-identity70.1%
pow270.1%
times-frac73.3%
Applied egg-rr73.3%
associate-*l/73.3%
*-un-lft-identity73.3%
Applied egg-rr73.3%
if -1.75e10 < y.re < 2.2e5Initial program 69.8%
Taylor expanded in y.re around 0 71.6%
+-commutative71.6%
mul-1-neg71.6%
unsub-neg71.6%
*-commutative71.6%
associate-/l*72.2%
Simplified72.2%
pow272.2%
div-inv72.1%
associate-*l*74.9%
Applied egg-rr74.9%
*-un-lft-identity74.9%
times-frac77.2%
un-div-inv77.2%
Applied egg-rr77.2%
associate-*l/77.2%
*-lft-identity77.2%
associate-/r/77.2%
Simplified77.2%
Final simplification75.3%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (or (<= y.im -7.6e+128)
(and (not (<= y.im -440.0))
(or (<= y.im -1.4e-60) (not (<= y.im 8.2e+99)))))
(/ (- 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 <= -7.6e+128) || (!(y_46_im <= -440.0) && ((y_46_im <= -1.4e-60) || !(y_46_im <= 8.2e+99)))) {
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 <= (-7.6d+128)) .or. (.not. (y_46im <= (-440.0d0))) .and. (y_46im <= (-1.4d-60)) .or. (.not. (y_46im <= 8.2d+99))) 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 <= -7.6e+128) || (!(y_46_im <= -440.0) && ((y_46_im <= -1.4e-60) || !(y_46_im <= 8.2e+99)))) {
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 <= -7.6e+128) or (not (y_46_im <= -440.0) and ((y_46_im <= -1.4e-60) or not (y_46_im <= 8.2e+99))): 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 <= -7.6e+128) || (!(y_46_im <= -440.0) && ((y_46_im <= -1.4e-60) || !(y_46_im <= 8.2e+99)))) 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 <= -7.6e+128) || (~((y_46_im <= -440.0)) && ((y_46_im <= -1.4e-60) || ~((y_46_im <= 8.2e+99))))) 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, -7.6e+128], And[N[Not[LessEqual[y$46$im, -440.0]], $MachinePrecision], Or[LessEqual[y$46$im, -1.4e-60], N[Not[LessEqual[y$46$im, 8.2e+99]], $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 -7.6 \cdot 10^{+128} \lor \neg \left(y.im \leq -440\right) \land \left(y.im \leq -1.4 \cdot 10^{-60} \lor \neg \left(y.im \leq 8.2 \cdot 10^{+99}\right)\right):\\
\;\;\;\;\frac{-x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re}\\
\end{array}
\end{array}
if y.im < -7.5999999999999998e128 or -440 < y.im < -1.4000000000000001e-60 or 8.19999999999999959e99 < y.im Initial program 31.7%
Taylor expanded in y.re around 0 81.9%
associate-*r/81.9%
neg-mul-181.9%
Simplified81.9%
if -7.5999999999999998e128 < y.im < -440 or -1.4000000000000001e-60 < y.im < 8.19999999999999959e99Initial program 71.6%
Taylor expanded in y.re around inf 58.5%
Final simplification67.0%
(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 57.1%
Taylor expanded in x.im around inf 36.0%
associate-/l*40.2%
Simplified40.2%
div-inv40.1%
pow240.1%
+-commutative40.1%
add-sqr-sqrt40.1%
associate-*l*40.1%
+-commutative40.1%
pow240.1%
hypot-def40.1%
+-commutative40.1%
pow240.1%
hypot-def53.6%
Applied egg-rr53.6%
Taylor expanded in y.im around inf 13.1%
Taylor expanded in y.im around 0 7.9%
Final simplification7.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 57.1%
Taylor expanded in y.re around inf 41.1%
Final simplification41.1%
herbie shell --seed 2023333
(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))))