
(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 (/ y.re (/ y.im x.im))))
(if (<= y.im -9.5e+31)
(- (/ t_0 y.im) (/ x.re y.im))
(if (<= y.im -2.1e-108)
(/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))
(if (<= y.im 1.3e-52)
(- (/ x.im y.re) (/ (/ (* y.im x.re) y.re) y.re))
(if (<= y.im 2.2e+145)
(/ (fma x.im y.re (* y.im (- x.re))) (fma y.re y.re (* y.im y.im)))
(/ (- t_0 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 / (y_46_im / x_46_im);
double tmp;
if (y_46_im <= -9.5e+31) {
tmp = (t_0 / y_46_im) - (x_46_re / y_46_im);
} else if (y_46_im <= -2.1e-108) {
tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
} else if (y_46_im <= 1.3e-52) {
tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re);
} else if (y_46_im <= 2.2e+145) {
tmp = fma(x_46_im, y_46_re, (y_46_im * -x_46_re)) / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
} else {
tmp = (t_0 - 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(y_46_re / Float64(y_46_im / x_46_im)) tmp = 0.0 if (y_46_im <= -9.5e+31) tmp = Float64(Float64(t_0 / y_46_im) - Float64(x_46_re / y_46_im)); elseif (y_46_im <= -2.1e-108) tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im))); elseif (y_46_im <= 1.3e-52) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(Float64(y_46_im * x_46_re) / y_46_re) / y_46_re)); elseif (y_46_im <= 2.2e+145) tmp = Float64(fma(x_46_im, y_46_re, Float64(y_46_im * Float64(-x_46_re))) / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im))); else tmp = Float64(Float64(t_0 - x_46_re) / y_46_im); end return tmp end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -9.5e+31], N[(N[(t$95$0 / y$46$im), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -2.1e-108], 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, 1.3e-52], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 2.2e+145], N[(N[(x$46$im * y$46$re + N[(y$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re}{\frac{y.im}{x.im}}\\
\mathbf{if}\;y.im \leq -9.5 \cdot 10^{+31}:\\
\;\;\;\;\frac{t_0}{y.im} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -2.1 \cdot 10^{-108}:\\
\;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{elif}\;y.im \leq 1.3 \cdot 10^{-52}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{\frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 2.2 \cdot 10^{+145}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, y.re, y.im \cdot \left(-x.re\right)\right)}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 - x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -9.5000000000000008e31Initial program 43.1%
Taylor expanded in y.re around 0 77.1%
+-commutative77.1%
mul-1-neg77.1%
unsub-neg77.1%
associate-/l*79.0%
associate-/r/80.5%
Simplified80.5%
*-un-lft-identity80.5%
pow280.5%
times-frac85.0%
Applied egg-rr85.0%
associate-*l/85.1%
*-un-lft-identity85.1%
Applied egg-rr85.1%
associate-*l/87.4%
*-commutative87.4%
clear-num87.4%
un-div-inv87.4%
Applied egg-rr87.4%
if -9.5000000000000008e31 < y.im < -2.0999999999999999e-108Initial program 96.7%
if -2.0999999999999999e-108 < y.im < 1.2999999999999999e-52Initial program 70.5%
Taylor expanded in y.re around inf 80.1%
+-commutative80.1%
mul-1-neg80.1%
unsub-neg80.1%
associate-/l*79.0%
associate-/r/80.2%
Simplified80.2%
associate-*l/80.1%
pow280.1%
associate-/r*89.5%
*-commutative89.5%
Applied egg-rr89.5%
if 1.2999999999999999e-52 < y.im < 2.20000000000000009e145Initial program 77.5%
fma-neg77.5%
distribute-lft-neg-out77.5%
*-commutative77.5%
fma-def77.5%
Simplified77.5%
if 2.20000000000000009e145 < y.im Initial program 24.5%
Taylor expanded in y.re around 0 64.4%
+-commutative64.4%
mul-1-neg64.4%
unsub-neg64.4%
associate-/l*70.5%
associate-/r/70.5%
Simplified70.5%
*-un-lft-identity70.5%
pow270.5%
times-frac81.2%
Applied egg-rr81.2%
associate-*l*86.8%
fma-neg86.8%
Applied egg-rr86.8%
fma-udef86.8%
unsub-neg86.8%
associate-*r*81.2%
times-frac70.5%
*-un-lft-identity70.5%
associate-/l/81.2%
associate-*l/86.8%
sub-div86.8%
*-commutative86.8%
clear-num86.8%
un-div-inv86.8%
Applied egg-rr86.8%
Final simplification87.7%
(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))))
(t_1 (/ y.re (/ y.im x.im))))
(if (<= y.im -9.5e+31)
(- (/ t_1 y.im) (/ x.re y.im))
(if (<= y.im -1.7e-112)
t_0
(if (<= y.im 1.8e-46)
(- (/ x.im y.re) (/ (/ (* y.im x.re) y.re) y.re))
(if (<= y.im 1.65e+145) t_0 (/ (- t_1 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 t_1 = y_46_re / (y_46_im / x_46_im);
double tmp;
if (y_46_im <= -9.5e+31) {
tmp = (t_1 / y_46_im) - (x_46_re / y_46_im);
} else if (y_46_im <= -1.7e-112) {
tmp = t_0;
} else if (y_46_im <= 1.8e-46) {
tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re);
} else if (y_46_im <= 1.65e+145) {
tmp = t_0;
} else {
tmp = (t_1 - 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) :: t_1
real(8) :: tmp
t_0 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
t_1 = y_46re / (y_46im / x_46im)
if (y_46im <= (-9.5d+31)) then
tmp = (t_1 / y_46im) - (x_46re / y_46im)
else if (y_46im <= (-1.7d-112)) then
tmp = t_0
else if (y_46im <= 1.8d-46) then
tmp = (x_46im / y_46re) - (((y_46im * x_46re) / y_46re) / y_46re)
else if (y_46im <= 1.65d+145) then
tmp = t_0
else
tmp = (t_1 - 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 t_1 = y_46_re / (y_46_im / x_46_im);
double tmp;
if (y_46_im <= -9.5e+31) {
tmp = (t_1 / y_46_im) - (x_46_re / y_46_im);
} else if (y_46_im <= -1.7e-112) {
tmp = t_0;
} else if (y_46_im <= 1.8e-46) {
tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re);
} else if (y_46_im <= 1.65e+145) {
tmp = t_0;
} else {
tmp = (t_1 - 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)) t_1 = y_46_re / (y_46_im / x_46_im) tmp = 0 if y_46_im <= -9.5e+31: tmp = (t_1 / y_46_im) - (x_46_re / y_46_im) elif y_46_im <= -1.7e-112: tmp = t_0 elif y_46_im <= 1.8e-46: tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re) elif y_46_im <= 1.65e+145: tmp = t_0 else: tmp = (t_1 - 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))) t_1 = Float64(y_46_re / Float64(y_46_im / x_46_im)) tmp = 0.0 if (y_46_im <= -9.5e+31) tmp = Float64(Float64(t_1 / y_46_im) - Float64(x_46_re / y_46_im)); elseif (y_46_im <= -1.7e-112) tmp = t_0; elseif (y_46_im <= 1.8e-46) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(Float64(y_46_im * x_46_re) / y_46_re) / y_46_re)); elseif (y_46_im <= 1.65e+145) tmp = t_0; else tmp = Float64(Float64(t_1 - 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)); t_1 = y_46_re / (y_46_im / x_46_im); tmp = 0.0; if (y_46_im <= -9.5e+31) tmp = (t_1 / y_46_im) - (x_46_re / y_46_im); elseif (y_46_im <= -1.7e-112) tmp = t_0; elseif (y_46_im <= 1.8e-46) tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re); elseif (y_46_im <= 1.65e+145) tmp = t_0; else tmp = (t_1 - 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]}, Block[{t$95$1 = N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -9.5e+31], N[(N[(t$95$1 / y$46$im), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.7e-112], t$95$0, If[LessEqual[y$46$im, 1.8e-46], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 1.65e+145], t$95$0, N[(N[(t$95$1 - x$46$re), $MachinePrecision] / y$46$im), $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}\\
t_1 := \frac{y.re}{\frac{y.im}{x.im}}\\
\mathbf{if}\;y.im \leq -9.5 \cdot 10^{+31}:\\
\;\;\;\;\frac{t_1}{y.im} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq -1.7 \cdot 10^{-112}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.im \leq 1.8 \cdot 10^{-46}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{\frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.im \leq 1.65 \cdot 10^{+145}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1 - x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -9.5000000000000008e31Initial program 43.1%
Taylor expanded in y.re around 0 77.1%
+-commutative77.1%
mul-1-neg77.1%
unsub-neg77.1%
associate-/l*79.0%
associate-/r/80.5%
Simplified80.5%
*-un-lft-identity80.5%
pow280.5%
times-frac85.0%
Applied egg-rr85.0%
associate-*l/85.1%
*-un-lft-identity85.1%
Applied egg-rr85.1%
associate-*l/87.4%
*-commutative87.4%
clear-num87.4%
un-div-inv87.4%
Applied egg-rr87.4%
if -9.5000000000000008e31 < y.im < -1.6999999999999999e-112 or 1.8e-46 < y.im < 1.65000000000000013e145Initial program 86.2%
if -1.6999999999999999e-112 < y.im < 1.8e-46Initial program 70.5%
Taylor expanded in y.re around inf 80.1%
+-commutative80.1%
mul-1-neg80.1%
unsub-neg80.1%
associate-/l*79.0%
associate-/r/80.2%
Simplified80.2%
associate-*l/80.1%
pow280.1%
associate-/r*89.5%
*-commutative89.5%
Applied egg-rr89.5%
if 1.65000000000000013e145 < y.im Initial program 24.5%
Taylor expanded in y.re around 0 64.4%
+-commutative64.4%
mul-1-neg64.4%
unsub-neg64.4%
associate-/l*70.5%
associate-/r/70.5%
Simplified70.5%
*-un-lft-identity70.5%
pow270.5%
times-frac81.2%
Applied egg-rr81.2%
associate-*l*86.8%
fma-neg86.8%
Applied egg-rr86.8%
fma-udef86.8%
unsub-neg86.8%
associate-*r*81.2%
times-frac70.5%
*-un-lft-identity70.5%
associate-/l/81.2%
associate-*l/86.8%
sub-div86.8%
*-commutative86.8%
clear-num86.8%
un-div-inv86.8%
Applied egg-rr86.8%
Final simplification87.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (* x.im (/ y.re y.im)) x.re) y.im))
(t_1 (+ (/ x.im y.re) (* y.im (* (/ x.re y.re) (/ -1.0 y.re))))))
(if (<= y.re -2.2e-20)
t_1
(if (<= y.re 4.8e-35)
t_0
(if (<= y.re 2.7e+19)
(- (/ x.im y.re) (/ (/ (* y.im x.re) y.re) y.re))
(if (<= y.re 5.9e+75) t_0 t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double t_1 = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re)));
double tmp;
if (y_46_re <= -2.2e-20) {
tmp = t_1;
} else if (y_46_re <= 4.8e-35) {
tmp = t_0;
} else if (y_46_re <= 2.7e+19) {
tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re);
} else if (y_46_re <= 5.9e+75) {
tmp = t_0;
} else {
tmp = t_1;
}
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 = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
t_1 = (x_46im / y_46re) + (y_46im * ((x_46re / y_46re) * ((-1.0d0) / y_46re)))
if (y_46re <= (-2.2d-20)) then
tmp = t_1
else if (y_46re <= 4.8d-35) then
tmp = t_0
else if (y_46re <= 2.7d+19) then
tmp = (x_46im / y_46re) - (((y_46im * x_46re) / y_46re) / y_46re)
else if (y_46re <= 5.9d+75) then
tmp = t_0
else
tmp = t_1
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 * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double t_1 = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re)));
double tmp;
if (y_46_re <= -2.2e-20) {
tmp = t_1;
} else if (y_46_re <= 4.8e-35) {
tmp = t_0;
} else if (y_46_re <= 2.7e+19) {
tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re);
} else if (y_46_re <= 5.9e+75) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im t_1 = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re))) tmp = 0 if y_46_re <= -2.2e-20: tmp = t_1 elif y_46_re <= 4.8e-35: tmp = t_0 elif y_46_re <= 2.7e+19: tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re) elif y_46_re <= 5.9e+75: tmp = t_0 else: tmp = t_1 return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) t_1 = 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)))) tmp = 0.0 if (y_46_re <= -2.2e-20) tmp = t_1; elseif (y_46_re <= 4.8e-35) tmp = t_0; elseif (y_46_re <= 2.7e+19) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(Float64(y_46_im * x_46_re) / y_46_re) / y_46_re)); elseif (y_46_re <= 5.9e+75) tmp = t_0; else tmp = t_1; 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 * (y_46_re / y_46_im)) - x_46_re) / y_46_im; t_1 = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re))); tmp = 0.0; if (y_46_re <= -2.2e-20) tmp = t_1; elseif (y_46_re <= 4.8e-35) tmp = t_0; elseif (y_46_re <= 2.7e+19) tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re); elseif (y_46_re <= 5.9e+75) tmp = t_0; else tmp = t_1; 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[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, Block[{t$95$1 = 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$re, -2.2e-20], t$95$1, If[LessEqual[y$46$re, 4.8e-35], t$95$0, If[LessEqual[y$46$re, 2.7e+19], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.9e+75], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
t_1 := \frac{x.im}{y.re} + y.im \cdot \left(\frac{x.re}{y.re} \cdot \frac{-1}{y.re}\right)\\
\mathbf{if}\;y.re \leq -2.2 \cdot 10^{-20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{-35}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 2.7 \cdot 10^{+19}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{\frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 5.9 \cdot 10^{+75}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y.re < -2.19999999999999991e-20 or 5.89999999999999983e75 < y.re Initial program 53.4%
Taylor expanded in y.re around inf 74.7%
+-commutative74.7%
mul-1-neg74.7%
unsub-neg74.7%
associate-/l*76.0%
associate-/r/77.6%
Simplified77.6%
*-un-lft-identity77.6%
pow277.6%
times-frac81.4%
Applied egg-rr81.4%
if -2.19999999999999991e-20 < y.re < 4.8000000000000003e-35 or 2.7e19 < y.re < 5.89999999999999983e75Initial program 67.2%
Taylor expanded in y.re around 0 80.2%
+-commutative80.2%
mul-1-neg80.2%
unsub-neg80.2%
associate-/l*81.2%
associate-/r/80.3%
Simplified80.3%
*-un-lft-identity80.3%
pow280.3%
times-frac83.4%
Applied egg-rr83.4%
associate-*l*87.8%
fma-neg87.8%
Applied egg-rr87.8%
expm1-log1p-u69.2%
expm1-udef34.4%
Applied egg-rr34.4%
expm1-def69.2%
expm1-log1p88.7%
associate-/r/89.3%
Simplified89.3%
if 4.8000000000000003e-35 < y.re < 2.7e19Initial program 76.8%
Taylor expanded in y.re around inf 71.7%
+-commutative71.7%
mul-1-neg71.7%
unsub-neg71.7%
associate-/l*71.6%
associate-/r/66.3%
Simplified66.3%
associate-*l/71.7%
pow271.7%
associate-/r*71.4%
*-commutative71.4%
Applied egg-rr71.4%
Final simplification84.4%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ (- (* x.im (/ y.re y.im)) x.re) y.im)))
(if (<= y.re -8.2e-21)
(+ (/ x.im y.re) (* y.im (* (/ x.re y.re) (/ -1.0 y.re))))
(if (<= y.re 6.6e-35)
t_0
(if (<= y.re 4.8e+18)
(- (/ x.im y.re) (/ (/ (* y.im x.re) y.re) y.re))
(if (<= y.re 9.2e+76)
t_0
(- (/ x.im y.re) (/ y.im (* y.re (/ y.re x.re))))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_re <= -8.2e-21) {
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_re <= 6.6e-35) {
tmp = t_0;
} else if (y_46_re <= 4.8e+18) {
tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re);
} else if (y_46_re <= 9.2e+76) {
tmp = t_0;
} else {
tmp = (x_46_im / y_46_re) - (y_46_im / (y_46_re * (y_46_re / x_46_re)));
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: t_0
real(8) :: tmp
t_0 = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
if (y_46re <= (-8.2d-21)) then
tmp = (x_46im / y_46re) + (y_46im * ((x_46re / y_46re) * ((-1.0d0) / y_46re)))
else if (y_46re <= 6.6d-35) then
tmp = t_0
else if (y_46re <= 4.8d+18) then
tmp = (x_46im / y_46re) - (((y_46im * x_46re) / y_46re) / y_46re)
else if (y_46re <= 9.2d+76) then
tmp = t_0
else
tmp = (x_46im / y_46re) - (y_46im / (y_46re * (y_46re / x_46re)))
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
double tmp;
if (y_46_re <= -8.2e-21) {
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_re <= 6.6e-35) {
tmp = t_0;
} else if (y_46_re <= 4.8e+18) {
tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re);
} else if (y_46_re <= 9.2e+76) {
tmp = t_0;
} else {
tmp = (x_46_im / y_46_re) - (y_46_im / (y_46_re * (y_46_re / x_46_re)));
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im tmp = 0 if y_46_re <= -8.2e-21: tmp = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re))) elif y_46_re <= 6.6e-35: tmp = t_0 elif y_46_re <= 4.8e+18: tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re) elif y_46_re <= 9.2e+76: tmp = t_0 else: tmp = (x_46_im / y_46_re) - (y_46_im / (y_46_re * (y_46_re / x_46_re))) return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im) tmp = 0.0 if (y_46_re <= -8.2e-21) 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_re <= 6.6e-35) tmp = t_0; elseif (y_46_re <= 4.8e+18) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(Float64(y_46_im * x_46_re) / y_46_re) / y_46_re)); elseif (y_46_re <= 9.2e+76) tmp = t_0; else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im / Float64(y_46_re * Float64(y_46_re / x_46_re)))); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) t_0 = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; tmp = 0.0; if (y_46_re <= -8.2e-21) tmp = (x_46_im / y_46_re) + (y_46_im * ((x_46_re / y_46_re) * (-1.0 / y_46_re))); elseif (y_46_re <= 6.6e-35) tmp = t_0; elseif (y_46_re <= 4.8e+18) tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re); elseif (y_46_re <= 9.2e+76) tmp = t_0; else tmp = (x_46_im / y_46_re) - (y_46_im / (y_46_re * (y_46_re / x_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[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$re, -8.2e-21], 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$re, 6.6e-35], t$95$0, If[LessEqual[y$46$re, 4.8e+18], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.2e+76], t$95$0, N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im / N[(y$46$re * N[(y$46$re / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\mathbf{if}\;y.re \leq -8.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{x.im}{y.re} + y.im \cdot \left(\frac{x.re}{y.re} \cdot \frac{-1}{y.re}\right)\\
\mathbf{elif}\;y.re \leq 6.6 \cdot 10^{-35}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y.re \leq 4.8 \cdot 10^{+18}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{\frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{elif}\;y.re \leq 9.2 \cdot 10^{+76}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{y.re \cdot \frac{y.re}{x.re}}\\
\end{array}
\end{array}
if y.re < -8.19999999999999988e-21Initial program 49.6%
Taylor expanded in y.re around inf 67.9%
+-commutative67.9%
mul-1-neg67.9%
unsub-neg67.9%
associate-/l*69.8%
associate-/r/71.4%
Simplified71.4%
*-un-lft-identity71.4%
pow271.4%
times-frac74.3%
Applied egg-rr74.3%
if -8.19999999999999988e-21 < y.re < 6.6000000000000001e-35 or 4.8e18 < y.re < 9.20000000000000005e76Initial program 67.2%
Taylor expanded in y.re around 0 80.2%
+-commutative80.2%
mul-1-neg80.2%
unsub-neg80.2%
associate-/l*81.2%
associate-/r/80.3%
Simplified80.3%
*-un-lft-identity80.3%
pow280.3%
times-frac83.4%
Applied egg-rr83.4%
associate-*l*87.8%
fma-neg87.8%
Applied egg-rr87.8%
expm1-log1p-u69.2%
expm1-udef34.4%
Applied egg-rr34.4%
expm1-def69.2%
expm1-log1p88.7%
associate-/r/89.3%
Simplified89.3%
if 6.6000000000000001e-35 < y.re < 4.8e18Initial program 76.8%
Taylor expanded in y.re around inf 71.7%
+-commutative71.7%
mul-1-neg71.7%
unsub-neg71.7%
associate-/l*71.6%
associate-/r/66.3%
Simplified66.3%
associate-*l/71.7%
pow271.7%
associate-/r*71.4%
*-commutative71.4%
Applied egg-rr71.4%
if 9.20000000000000005e76 < y.re Initial program 57.7%
Taylor expanded in y.re around inf 82.5%
+-commutative82.5%
mul-1-neg82.5%
unsub-neg82.5%
associate-/l*83.1%
associate-/r/84.8%
Simplified84.8%
*-commutative84.8%
clear-num84.8%
un-div-inv84.8%
Applied egg-rr84.8%
unpow284.8%
*-un-lft-identity84.8%
times-frac89.6%
Applied egg-rr89.6%
Final simplification84.4%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.im -7.2e+25) (not (<= y.im 5.5e-23))) (/ (- (/ y.re (/ 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 <= -7.2e+25) || !(y_46_im <= 5.5e-23)) {
tmp = ((y_46_re / (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 <= (-7.2d+25)) .or. (.not. (y_46im <= 5.5d-23))) then
tmp = ((y_46re / (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 <= -7.2e+25) || !(y_46_im <= 5.5e-23)) {
tmp = ((y_46_re / (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 <= -7.2e+25) or not (y_46_im <= 5.5e-23): tmp = ((y_46_re / (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 <= -7.2e+25) || !(y_46_im <= 5.5e-23)) tmp = Float64(Float64(Float64(y_46_re / Float64(y_46_im / x_46_im)) - x_46_re) / y_46_im); else tmp = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(Float64(y_46_im * x_46_re) / y_46_re) / y_46_re)); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_im <= -7.2e+25) || ~((y_46_im <= 5.5e-23))) tmp = ((y_46_re / (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, -7.2e+25], N[Not[LessEqual[y$46$im, 5.5e-23]], $MachinePrecision]], N[(N[(N[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.im \leq -7.2 \cdot 10^{+25} \lor \neg \left(y.im \leq 5.5 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{\frac{y.re}{\frac{y.im}{x.im}} - x.re}{y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{\frac{y.im \cdot x.re}{y.re}}{y.re}\\
\end{array}
\end{array}
if y.im < -7.20000000000000031e25 or 5.5000000000000001e-23 < y.im Initial program 46.8%
Taylor expanded in y.re around 0 67.5%
+-commutative67.5%
mul-1-neg67.5%
unsub-neg67.5%
associate-/l*70.8%
associate-/r/71.5%
Simplified71.5%
*-un-lft-identity71.5%
pow271.5%
times-frac76.6%
Applied egg-rr76.6%
associate-*l*79.3%
fma-neg79.3%
Applied egg-rr79.3%
fma-udef79.3%
unsub-neg79.3%
associate-*r*76.6%
times-frac71.5%
*-un-lft-identity71.5%
associate-/l/76.6%
associate-*l/79.3%
sub-div79.3%
*-commutative79.3%
clear-num79.3%
un-div-inv79.3%
Applied egg-rr79.3%
if -7.20000000000000031e25 < y.im < 5.5000000000000001e-23Initial program 77.8%
Taylor expanded in y.re around inf 75.7%
+-commutative75.7%
mul-1-neg75.7%
unsub-neg75.7%
associate-/l*75.0%
associate-/r/75.1%
Simplified75.1%
associate-*l/75.7%
pow275.7%
associate-/r*82.3%
*-commutative82.3%
Applied egg-rr82.3%
Final simplification80.7%
(FPCore (x.re x.im y.re y.im)
:precision binary64
(let* ((t_0 (/ y.re (/ y.im x.im))))
(if (<= y.im -1.55e+28)
(- (/ t_0 y.im) (/ x.re y.im))
(if (<= y.im 5.5e-23)
(- (/ x.im y.re) (/ (/ (* y.im x.re) y.re) y.re))
(/ (- t_0 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 / (y_46_im / x_46_im);
double tmp;
if (y_46_im <= -1.55e+28) {
tmp = (t_0 / y_46_im) - (x_46_re / y_46_im);
} else if (y_46_im <= 5.5e-23) {
tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re);
} else {
tmp = (t_0 - 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 / (y_46im / x_46im)
if (y_46im <= (-1.55d+28)) then
tmp = (t_0 / y_46im) - (x_46re / y_46im)
else if (y_46im <= 5.5d-23) then
tmp = (x_46im / y_46re) - (((y_46im * x_46re) / y_46re) / y_46re)
else
tmp = (t_0 - 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 / (y_46_im / x_46_im);
double tmp;
if (y_46_im <= -1.55e+28) {
tmp = (t_0 / y_46_im) - (x_46_re / y_46_im);
} else if (y_46_im <= 5.5e-23) {
tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re);
} else {
tmp = (t_0 - 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 / (y_46_im / x_46_im) tmp = 0 if y_46_im <= -1.55e+28: tmp = (t_0 / y_46_im) - (x_46_re / y_46_im) elif y_46_im <= 5.5e-23: tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re) else: tmp = (t_0 - 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(y_46_re / Float64(y_46_im / x_46_im)) tmp = 0.0 if (y_46_im <= -1.55e+28) tmp = Float64(Float64(t_0 / y_46_im) - Float64(x_46_re / y_46_im)); elseif (y_46_im <= 5.5e-23) tmp = Float64(Float64(x_46_im / y_46_re) - Float64(Float64(Float64(y_46_im * x_46_re) / y_46_re) / y_46_re)); else tmp = Float64(Float64(t_0 - 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 / (y_46_im / x_46_im); tmp = 0.0; if (y_46_im <= -1.55e+28) tmp = (t_0 / y_46_im) - (x_46_re / y_46_im); elseif (y_46_im <= 5.5e-23) tmp = (x_46_im / y_46_re) - (((y_46_im * x_46_re) / y_46_re) / y_46_re); else tmp = (t_0 - 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[(y$46$re / N[(y$46$im / x$46$im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$im, -1.55e+28], N[(N[(t$95$0 / y$46$im), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 5.5e-23], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y.re}{\frac{y.im}{x.im}}\\
\mathbf{if}\;y.im \leq -1.55 \cdot 10^{+28}:\\
\;\;\;\;\frac{t_0}{y.im} - \frac{x.re}{y.im}\\
\mathbf{elif}\;y.im \leq 5.5 \cdot 10^{-23}:\\
\;\;\;\;\frac{x.im}{y.re} - \frac{\frac{y.im \cdot x.re}{y.re}}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0 - x.re}{y.im}\\
\end{array}
\end{array}
if y.im < -1.55e28Initial program 43.1%
Taylor expanded in y.re around 0 77.1%
+-commutative77.1%
mul-1-neg77.1%
unsub-neg77.1%
associate-/l*79.0%
associate-/r/80.5%
Simplified80.5%
*-un-lft-identity80.5%
pow280.5%
times-frac85.0%
Applied egg-rr85.0%
associate-*l/85.1%
*-un-lft-identity85.1%
Applied egg-rr85.1%
associate-*l/87.4%
*-commutative87.4%
clear-num87.4%
un-div-inv87.4%
Applied egg-rr87.4%
if -1.55e28 < y.im < 5.5000000000000001e-23Initial program 77.8%
Taylor expanded in y.re around inf 75.7%
+-commutative75.7%
mul-1-neg75.7%
unsub-neg75.7%
associate-/l*75.0%
associate-/r/75.1%
Simplified75.1%
associate-*l/75.7%
pow275.7%
associate-/r*82.3%
*-commutative82.3%
Applied egg-rr82.3%
if 5.5000000000000001e-23 < y.im Initial program 49.8%
Taylor expanded in y.re around 0 59.9%
+-commutative59.9%
mul-1-neg59.9%
unsub-neg59.9%
associate-/l*64.3%
associate-/r/64.4%
Simplified64.4%
*-un-lft-identity64.4%
pow264.4%
times-frac70.0%
Applied egg-rr70.0%
associate-*l*72.9%
fma-neg72.9%
Applied egg-rr72.9%
fma-udef72.9%
unsub-neg72.9%
associate-*r*70.0%
times-frac64.4%
*-un-lft-identity64.4%
associate-/l/70.0%
associate-*l/72.9%
sub-div72.9%
*-commutative72.9%
clear-num72.9%
un-div-inv72.9%
Applied egg-rr72.9%
Final simplification80.7%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -1.75e-20) (not (<= y.re 7.4e+78))) (/ x.im y.re) (/ (- (* x.im (/ 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_re <= -1.75e-20) || !(y_46_re <= 7.4e+78)) {
tmp = x_46_im / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
real(8), intent (in) :: x_46re
real(8), intent (in) :: x_46im
real(8), intent (in) :: y_46re
real(8), intent (in) :: y_46im
real(8) :: tmp
if ((y_46re <= (-1.75d-20)) .or. (.not. (y_46re <= 7.4d+78))) then
tmp = x_46im / y_46re
else
tmp = ((x_46im * (y_46re / y_46im)) - x_46re) / y_46im
end if
code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
double tmp;
if ((y_46_re <= -1.75e-20) || !(y_46_re <= 7.4e+78)) {
tmp = x_46_im / y_46_re;
} else {
tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im;
}
return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im): tmp = 0 if (y_46_re <= -1.75e-20) or not (y_46_re <= 7.4e+78): tmp = x_46_im / y_46_re else: tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0 if ((y_46_re <= -1.75e-20) || !(y_46_re <= 7.4e+78)) tmp = Float64(x_46_im / y_46_re); else tmp = Float64(Float64(Float64(x_46_im * Float64(y_46_re / y_46_im)) - x_46_re) / y_46_im); end return tmp end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im) tmp = 0.0; if ((y_46_re <= -1.75e-20) || ~((y_46_re <= 7.4e+78))) tmp = x_46_im / y_46_re; else tmp = ((x_46_im * (y_46_re / y_46_im)) - x_46_re) / y_46_im; end tmp_2 = tmp; end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.75e-20], N[Not[LessEqual[y$46$re, 7.4e+78]], $MachinePrecision]], N[(x$46$im / y$46$re), $MachinePrecision], N[(N[(N[(x$46$im * N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.75 \cdot 10^{-20} \lor \neg \left(y.re \leq 7.4 \cdot 10^{+78}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{x.im \cdot \frac{y.re}{y.im} - x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -1.75000000000000002e-20 or 7.39999999999999969e78 < y.re Initial program 53.0%
Taylor expanded in y.re around inf 67.7%
if -1.75000000000000002e-20 < y.re < 7.39999999999999969e78Initial program 68.6%
Taylor expanded in y.re around 0 73.9%
+-commutative73.9%
mul-1-neg73.9%
unsub-neg73.9%
associate-/l*74.7%
associate-/r/73.9%
Simplified73.9%
*-un-lft-identity73.9%
pow273.9%
times-frac76.6%
Applied egg-rr76.6%
associate-*l*80.5%
fma-neg80.5%
Applied egg-rr80.5%
expm1-log1p-u63.2%
expm1-udef32.2%
Applied egg-rr32.3%
expm1-def63.2%
expm1-log1p81.2%
associate-/r/81.7%
Simplified81.7%
Final simplification75.2%
(FPCore (x.re x.im y.re y.im) :precision binary64 (if (or (<= y.re -2.1e-33) (not (<= y.re 5.4e+25))) (/ 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_re <= -2.1e-33) || !(y_46_re <= 5.4e+25)) {
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_46re <= (-2.1d-33)) .or. (.not. (y_46re <= 5.4d+25))) 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_re <= -2.1e-33) || !(y_46_re <= 5.4e+25)) {
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_re <= -2.1e-33) or not (y_46_re <= 5.4e+25): 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_re <= -2.1e-33) || !(y_46_re <= 5.4e+25)) 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_re <= -2.1e-33) || ~((y_46_re <= 5.4e+25))) 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[Or[LessEqual[y$46$re, -2.1e-33], N[Not[LessEqual[y$46$re, 5.4e+25]], $MachinePrecision]], 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.re \leq -2.1 \cdot 10^{-33} \lor \neg \left(y.re \leq 5.4 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x.im}{y.re}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x.re}{y.im}\\
\end{array}
\end{array}
if y.re < -2.1e-33 or 5.4e25 < y.re Initial program 53.3%
Taylor expanded in y.re around inf 65.1%
if -2.1e-33 < y.re < 5.4e25Initial program 69.9%
Taylor expanded in y.re around 0 72.6%
associate-*r/72.6%
neg-mul-172.6%
Simplified72.6%
Final simplification68.7%
(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 61.3%
Taylor expanded in x.im around inf 36.5%
*-commutative36.5%
Simplified36.5%
pow236.5%
add-sqr-sqrt36.5%
times-frac38.9%
+-commutative38.9%
pow238.9%
hypot-def38.9%
+-commutative38.9%
pow238.9%
hypot-def53.0%
Applied egg-rr53.0%
Taylor expanded in y.im around inf 15.5%
Taylor expanded in y.re around inf 8.8%
Final simplification8.8%
(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 61.3%
Taylor expanded in y.re around inf 40.4%
Final simplification40.4%
herbie shell --seed 2024026
(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))))